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.

Encoding

Binary Layout
4
0:5
vD
6:10
UIM
11:15
vB
16:20
970
21:31
 
Format VX-form
Opcode 0x100003CA
Extension VMX (AltiVec)

Operands

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

Example

vctsxs vd, vb, uim

Registers Altered

VSCR (SAT)

Related

More in VMX (AltiVec)

Reference

Description

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.

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

Extended Mnemonics

Extended Mnemonic Equivalent Instruction

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.