vclzh
Vector Count Leading Zeros Halfword
Counts leading zeros in each halfword.
Details
The Vector Count Leading Zeros Halfword instruction counts the number of consecutive zero bits starting from bit 0 for each halfword element in the source vector register and stores the result in the destination vector register. The count ranges from 0 to 16, inclusive.
Pseudocode Operation
Programming Note
The vclzh instruction is useful for counting leading zeros in each halfword of a vector, which can be helpful in various bit manipulation tasks. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. The instruction processes 8 halfwords per vector register, and results are stored directly in the destination vector register.
Example
Encoding
Operands
-
vD
Target -
vB
Source