diff options
author | Richard Henderson <rth@twiddle.net> | 2013-04-02 11:13:28 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2013-04-15 19:51:50 +0200 |
commit | 752c1fdb6d3e7cc03157af213837f3b081b03858 (patch) | |
tree | baf1a1925e432c87e92d574a02ccfdb1aa20ee61 | |
parent | 2fd8eddcab144d29f9f58c842ad7a7fd65147394 (diff) |
tcg-ppc64: Fix setcond_i32
We weren't ignoring the high 32 bits during a NE comparison.
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
-rw-r--r-- | tcg/ppc64/tcg-target.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index b12cbec95a..822eb077b1 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -1129,6 +1129,12 @@ static void tcg_out_setcond (TCGContext *s, TCGType type, TCGCond cond, tcg_out32 (s, XOR | SAB (arg1, 0, arg2)); } + /* Make sure and discard the high 32-bits of the input. */ + if (type == TCG_TYPE_I32) { + tcg_out32(s, EXTSW | RA(TCG_REG_R0) | RS(arg)); + arg = TCG_REG_R0; + } + if (arg == arg1 && arg1 == arg0) { tcg_out32(s, ADDIC | TAI(0, arg, -1)); tcg_out32(s, SUBFE | TAB(arg0, 0, arg)); |