Skip to content

Commit

Permalink
tcg-ppc64: Fix setcond_i32
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rth7680 committed Apr 15, 2013
1 parent 2fd8edd commit 752c1fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tcg/ppc64/tcg-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 752c1fd

Please sign in to comment.