| author | |
| committer | |
| log | c4d0f97b4c3f85796c4953d6e87b5c0186616bc1 |
| tree | 478f50dc11c5d2fbc548ced3dd5ed1d52a949c0e |
| parent | b55bc5eb266f2dc62cf520e8b572893adf5f979c |
The LUT contains the number of bits set, not the number of leading zeros
as we're subtracting from the total number of bits in a word.
Closes #44151 files changed, 2 insertions(+), 1 deletions(-)
lib/std/special/compiler_rt/clzsi2.zig+2-1| ... | ... | @@ -45,8 +45,9 @@ fn __clzsi2_thumb1() callconv(.Naked) void { |
| 45 | 45 | \\ subs r0, r1, r0 |
| 46 | 46 | \\ bx lr |
| 47 | 47 | \\ .p2align 2 |
| 48 | \\ // Number of bits set in the 0-15 range | |
| 48 | 49 | \\ LUT: |
| 49 | \\ .byte 4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0 | |
| 50 | \\ .byte 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4 | |
| 50 | 51 | ); |
| 51 | 52 | |
| 52 | 53 | unreachable; |