vctuxs

Vector Convert to Unsigned Fixed-Point Word Saturate

vctuxs vD, vB, UIM

Converts 4 floats to 4 unsigned 32-bit integers.

Details

The vctuxs instruction converts each element of the source vector VRB from a floating-point format to an unsigned fixed-point word format, using saturation if necessary. The conversion is based on the rounding mode specified by UIM.

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] ← ui32_CONVERT_FROM_BFP32(src, UIM)
end

Programming Note

The vctuxs instruction converts floating-point elements to unsigned fixed-point words with saturation. Ensure the vector facility is enabled by checking and setting MSR.VEC. Handle exceptions for invalid operations or overflow carefully. The conversion respects the rounding mode specified by UIM, so verify its configuration for accurate results.

Example

vctuxs vd, vb, uim

Encoding

Binary Layout
4
0
vD
6
UIM
11
vB
16
906
21
 
Format VX-form
Opcode 0x1000038A
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vB
    Source
  • UIM
    Fraction bits