diff options
author | Richard Henderson <rth@twiddle.net> | 2016-06-20 11:03:37 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2016-06-22 11:12:17 +1000 |
commit | 820724d170dd97bd216810c6965ee1ebd0ba01e8 (patch) | |
tree | 2ecdbd9fa21570b5a23415462df71a02b53fadf4 /target-ppc/translate.c | |
parent | 7f2b1744b3ea0f9860ece4bd9493d88286601408 (diff) |
target-ppc: Fix rlwimi, rlwinm, rlwnm again
In 63ae0915f8ec, I arranged to use a 32-bit rotate, without
considering the effect of a mask value that wraps around to
the high bits of the word.
[dwg: In 2e11b15 this was partially fixed, but an edge case was still
incorrect, which this fixes]
Signed-off-by: Richard Henderson <rth@twiddle.net>
[dwg: Folded with a revert of 2e11b15, an earlier buggy version of
this patch which already went upstream]
Tested-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target-ppc/translate.c')
-rw-r--r-- | target-ppc/translate.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 72b67e42cf..395b885f5b 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -1696,9 +1696,7 @@ static void gen_rlwinm(DisasContext *ctx) #endif mask = MASK(mb, me); - if (sh == 0) { - tcg_gen_andi_tl(t_ra, t_rs, mask); - } else if (mask <= 0xffffffffu) { + if (mask <= 0xffffffffu) { TCGv_i32 t0 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(t0, t_rs); tcg_gen_rotli_i32(t0, t0, sh); |