tcg/optimize: Fix sign_mask for logical right-shift
commit2911e9b95f3bb03783ae5ca3e2494dc3b44a9161
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 26 Mar 2024 21:21:38 +0000 (26 11:21 -1000)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 29 Mar 2024 22:15:55 +0000 (29 12:15 -1000)
treec316e248a8843ced44d250823663f6f3f337ae60
parent889cd5a8e2dd6cf8793faba22fda38b78553ae24
tcg/optimize: Fix sign_mask for logical right-shift

The 'sign' computation is attempting to locate the sign bit that has
been repeated, so that we can test if that bit is known zero.  That
computation can be zero if there are no known sign repetitions.

Cc: qemu-stable@nongnu.org
Fixes: 93a967fbb57 ("tcg/optimize: Propagate sign info for shifting")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2248
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
tcg/optimize.c
tests/tcg/aarch64/Makefile.target
tests/tcg/aarch64/test-2248.c [new file with mode: 0644]