mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00:00
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:93a967fbb5
("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> (cherry picked from commit2911e9b95f
) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
committed by
Michael Tokarev
parent
d3e9e0fb29
commit
3cdfd68e4e
@ -2123,7 +2123,7 @@ static bool fold_shift(OptContext *ctx, TCGOp *op)
|
||||
* will not reduced the number of input sign repetitions.
|
||||
*/
|
||||
sign = (s_mask & -s_mask) >> 1;
|
||||
if (!(z_mask & sign)) {
|
||||
if (sign && !(z_mask & sign)) {
|
||||
ctx->s_mask = s_mask;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user