ctz

CTZ <Wd>, <Wn>

Count Trailing Zeros.

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
0
31
1
30
0
29
11010110
28:21
00000
20:16
000110
15:10
Rn
9:5
Rd
4:0
 
Format CSSC
Opcode 0x5AC01800
Extension CSSC

Related

More in CSSC

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x5AC01800 CTZ <Wd>, <Wn> A64 0 | 1 | 0 | 11010110 | 00000 | 000110 | Rn | Rd
0xDAC01800 CTZ <Xd>, <Xn> A64 1 | 1 | 0 | 11010110 | 00000 | 000110 | Rn | Rd

Description

Count Trailing Zeros counts the number of consecutive binary zero bits, starting from the least significant bit in the source register, and places the count in the destination register.

Operation

bits(datasize) operand1 = X[n, datasize];
integer result = CountLeadingZeroBits(BitReverse(operand1));
X[d, datasize] = result<datasize-1:0>;