vctuxs

Vector Convert to Unsigned Fixed-Point Word Saturate

vctuxs vD, vB, UIM

Converts 4 floats to 4 unsigned 32-bit integers.

Details

Converts four single-precision floating-point elements in vB to unsigned 32-bit fixed-point integers with UIM fractional bits, saturating to the unsigned 32-bit range and storing results in vD. Sets the saturation bit (VSCR[SAT]) if any conversion saturates. This is a Classic VMX (AltiVec) instruction.

Pseudocode Operation

scale ← 2^UIM
for i in 0 to 3 do
  converted ← round(vB[i] × scale)
  vD[i] ← SATURATE_UNSIGNED_WORD(converted)
  if saturated then VSCR[SAT] ← 1
endfor

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