vctsxs

Vector Convert to Signed Fixed-Point Word Saturate

vctsxs vD, vB, UIM

Converts a vector of floating-point values to signed fixed-point integers with rounding towards zero and saturation.

Details

For vctsxs, each element in the source vector VRB is converted to a signed fixed-point integer using the specified scale factor UIM. The result is saturated if it exceeds the range of a 32-bit signed integer.

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

Programming Note

The vctsxs instruction converts each element of the source vector to a signed fixed-point integer using the specified scale factor. Ensure that the scale factor is appropriate for your data range to avoid saturation. This instruction operates at user privilege level and will raise an exception if the VEC bit in the MSR register is not set.

Extended Mnemonics

Extended Mnemonic Equivalent Instruction

Example

vctsxs vd, vb, uim

Encoding

Binary Layout
4
0
vD
6
UIM
11
vB
21
970
 
Format VX-form
Opcode 0x100003CA
Extension VMX (AltiVec)
Registers Altered VSCR (SAT)

Operands

  • vD
    Target
  • vB
    Source
  • UIM
    Fraction bits
  • VRT
    Target Vector Register
  • VRB
    Source Vector Register