mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 08:45:52 +00:00
compiler_rt: Fix clzsi2 implementation for Thumb1
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 #4415
This commit is contained in:
parent
b55bc5eb26
commit
c4d0f97b4c
@ -45,8 +45,9 @@ fn __clzsi2_thumb1() callconv(.Naked) void {
|
||||
\\ subs r0, r1, r0
|
||||
\\ bx lr
|
||||
\\ .p2align 2
|
||||
\\ // Number of bits set in the 0-15 range
|
||||
\\ LUT:
|
||||
\\ .byte 4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0
|
||||
\\ .byte 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4
|
||||
);
|
||||
|
||||
unreachable;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user