vrfiz

Vector Round to Floating-Point Integer towards Zero

vrfiz vD, vB

Rounds 4 floats to integer (trunc).

Details

The vrfiz instruction rounds each single-precision floating-point value in the source vector to the nearest integer towards zero and stores the result in the destination vector.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 3
   src ← VSR[VRB+32].word[i]
   VSR[VRT+32].word[i] ← bfp32_ROUND_TO_INTEGER_TRUNC(src)
end

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
 
Format VX-form
Opcode 0x1000024A
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vB
    Source