vcntmbw
Vector Count Mask Bits Word
Counts the number of word elements in a vector register that have bit 0 set to a specified value.
Details
The vcntmbw instruction counts the number of word elements in VSR[VRB+32] that have bit 0 set to the value specified by MP. The count is then placed into bits 0:5 of GPR[RT], with bits 6:63 of GPR[RT] being set to 0.
Pseudocode Operation
Programming Note
The vcntmbw instruction is useful for counting the number of word elements in a vector register that have their least significant bit set to a specified value. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. The result is stored in the upper bits of the target GPR, so be cautious when interpreting the output.
Example
Encoding
Operands
-
RT
Target General Purpose Register -
VRB
Source Vector Register -
MP
Mask Bit Value