vmodsw
Vector Modulo Signed Word
Performs modulo operation on signed integers in vector registers.
Details
For vmodsw, the signed integer in word element i of VSR[VRA+32] is divided by the signed integer in word element i of VSR[VRB+32]. The remainder is placed into word element i of VSR[VRT+32].
Pseudocode Operation
Programming Note
The vmodsw instruction performs element-wise signed modulo division on vectors. Ensure that the vector registers are properly aligned and that the Vector Facility is enabled (MSR.VEC=1). Be cautious of division by zero, which may result in undefined behavior or exceptions. This operation is typically used in scenarios requiring periodic or cyclic calculations with signed integers.
Example
Encoding
Operands
-
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Source Vector Register