tools/nolibc/stdlib: avoid a 64-bit shift in u64toh_r()
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Feb 2022 16:23:37 +0000 (17:23 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 14 Feb 2022 18:48:53 +0000 (10:48 -0800)
commitfc719fb64370c4ef94360a989f2a471abbf32ad8
tree79889c213154dd1a160d4d581598bedd32604030
parent5f0935d23308806608c21dfeb553f63c8f7d6d53
tools/nolibc/stdlib: avoid a 64-bit shift in u64toh_r()

The build of printf() on mips requires libgcc for functions __ashldi3 and
__lshrdi3 due to 64-bit shifts when scanning the input number. These are
not really needed in fact since we scan the number 4 bits at a time. Let's
arrange the loop to perform two 32-bit shifts instead on 32-bit platforms.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/stdlib.h