vcntmbb
Vector Count Mask Bits Byte
Counts the number of true (or false) mask bits in a VSR and places the count in the leftmost byte of a GPR.
Details
The Vector Count Mask Bits Byte instruction counts the number of byte elements having bit 0 set to the value MP in VSR[VRB+32] and places the count into bits 0:7 of GPR[RT]. Bits 8:63 of GPR[RT] are set to 0.
Pseudocode Operation
Programming Note
This instruction is useful for counting the number of bytes in a vector register where the least significant bit matches a specified mask value (MP). Ensure that the Vector Facility is enabled by checking and setting the VEC bit in the Machine State Register (MSR) before using this instruction. The result is left-shifted 56 bits, so only the lower byte of GPR[RT] contains the count. This instruction operates at the problem state privilege level.
Example
Encoding
Operands
-
RT
Target General Purpose Register -
VRB
Source Vector Register -
MP
Mask Bit (0 or 1)