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.
Hi willwow11,
jensbauer has a document A fairly quick Count Leading Zeroes for Cortex-M0. Read the section Trailer to use it for counting trailing zeroes.
This can help you too, Bit Twiddling Hacks. daith is also peddling this web page .
Regards,
Goodwin