vrfiz
Vector Round to Floating-Point Integer towards Zero
vrfiz vD, vB
Rounds 4 floats to integer (trunc).
Details
Rounds each of four 32-bit floating-point elements in vB towards zero (truncate) and stores the integer results as floating-point values in vD. This instruction operates on the VMX/AltiVec extension and does not modify condition registers or exception flags.
Pseudocode Operation
for i in 0 to 3:
vD[32*i:32*i+31] ← RoundTowardZero(vB[32*i:32*i+31])
Programming Note
The vrfiz instruction rounds each single-precision floating-point value in the source vector towards zero. Ensure that the Vector Facility is enabled by checking and setting the VEC bit in the MSR register. This instruction operates on 32-bit words, so ensure proper alignment of the data for optimal performance.
Example
vrfiz vd, vb
Encoding
Binary Layout
4
0
vD
6
0
11
vB
16
586
21
Operands
-
vD
Target -
vB
Source