vrfip

Vector Round to Floating-Point Integer towards Plus Infinity

vrfip vD, vB

Rounds each element of a vector to the nearest integer towards positive infinity.

Encoding

Binary Layout
4
0:5
VRT
6:10
VRB
11:15
11
16:30
0
31
 
Format VX-form
Opcode 0x1000028A
Extension VMX (AltiVec)

Operands

  • vD
    Target
  • vB
    Source
  • VRT
    Target Vector Register
  • VRB
    Source Vector Register

Example

vrfip vd, vb

Registers Altered

MSR

Related

More in VMX (AltiVec)

Reference

Description

For vrfip, each single-precision floating-point value in VSR[VRB+32] is rounded towards positive infinity and placed into the corresponding word element of VSR[VRT+32].

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_CEIL(src)
end

Programming Note

This instruction rounds each single-precision floating-point value in the source vector towards positive infinity. Ensure that the Vector Facility is enabled by checking and setting the appropriate bit in the MSR register. Be cautious of potential overflow when rounding very large numbers.