Instruction Descriptions 4–31
4.4.7 Count Leading Zero
Format:
Operation:
temp = 0
FOR i FROM 63 DOWN TO 0
IF { Rbv<i> EQ 1 } THEN BREAK
temp = temp + 1
END
Rc<6:0> ← temp<6:0>
Rc<63:7> ← 0
Exceptions:
Instruction mnemonics:
Qualifiers:
Description:
The number of leading zeros in Rb, starting at the most significant bit position, is written to Rc.
Ra must be R31.
CTLZ Rb.rq,Rc.wq
! Operate format
None
CTLZ Count Leading Zero
None