vctzlsbb

Vector Count Trailing Zero Least Significant Bits Byte

vctzlsbb RA, vB

Counts the number of trailing zero bits in each byte element of a vector.

Details

Counts the number of trailing zero bits in each byte of the source vector and stores the scalar result (the count from the least-significant byte) in a GPR. This VMX instruction updates CR6 based on the result to indicate whether all bytes contain zero or not.

Pseudocode Operation

RA ← count_trailing_zeros_lsb_byte(vB[0:7])

Programming Note

Use vctzlsbb to efficiently count the number of contiguous trailing zero bytes with a zero least-significant bit. Ensure that the input vector is properly aligned and that you have the necessary privileges to execute this instruction. The result is stored in a general-purpose register, so be mindful of register usage and dependencies.

Example

vctzlsbb r4, vb

Encoding

Binary Layout
4
0
RA
6
0
11
vB
16
1543
21
 
Format VX-form
Opcode 0x10010602
Extension VMX (AltiVec)

Operands

  • RA
    Target GPR
  • vB
    Source
  • VRT
    Target Vector Register
  • VRA
    Source Vector Register