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.

Encoding

Binary Layout
4
0:5
RA
6:10
0
11:15
vB
16:20
1543
21:31
 
Format VX-form
Opcode 0x10010602
Extension VMX (AltiVec)

Operands

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

Example

vctzlsbb r4, vb

Related

More in VMX (AltiVec)

Reference

Description

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.

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.