I am trying to count the number of trailing zeros in floating points without using the clz command. what would be the easiest way to rewrite this code?
ctz RSB r1,r0,#0 CMP r0,#0 AND r0,r0,r1 CLZ r0,r0 RSBNE r0,r0,#0x1f BX lr
hth
s.
.
In particular, you can change the following lines from the CLZ example:
value = data >> shift; // MOV Rv,Rd | // LSRS Rv,Rs |
to perform CTZ instead:
value = data << shift; // MOV Rv,Rd | // LSLS Rv,Rs |
Simon.