vclrrb
Vector Clear Right Bytes
Clears the N rightmost bytes of a vector.
Details
The Vector Clear Rightmost Bytes instruction (vclrrb) copies the contents of each byte element from VSR[VRA+32] to VSR[VRT+32]. If the integer value in GPR[RB] is greater than 15, N is set to 16; otherwise, N is the integer value in GPR[RB]. Bytes from position N to 15 in VSR[VRT+32] are then cleared (set to 0x00).
Pseudocode Operation
Programming Note
The vclrrb instruction is useful for clearing the rightmost bytes of a vector register based on a specified count. Ensure that the Vector Facility (MSR.VEC) is enabled to avoid a Vector_Unavailable exception. The value in GPR[RB] should be between 0 and 15; values greater than 15 will result in all bytes being cleared. This instruction operates on vector registers, so ensure proper alignment and privilege level as required by the system.
Example
Encoding
Operands
-
vD
Target -
vA
Source -
RB
Count (GPR)