aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-03-26 18:56:31 -0700
committerRichard Henderson <rth@twiddle.net>2014-06-23 07:31:56 -0700
commitb31284cecf36c75179dac828344fcce2b21204c4 (patch)
tree6d6eaf18472aa7c9d340adff8706801642eadcfc /tcg
parentffcfbecec39d1459a5f09a5f39b5c6c92c6fd753 (diff)
downloadqemu-b31284cecf36c75179dac828344fcce2b21204c4.zip
qemu-b31284cecf36c75179dac828344fcce2b21204c4.tar.gz
qemu-b31284cecf36c75179dac828344fcce2b21204c4.tar.bz2
tcg-ppc64: Fix sub2 implementation
All sorts of confusion on argument ordering. Tested-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/ppc64/tcg-target.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index 8d932eb..22cfa1e 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -2009,18 +2009,18 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
case INDEX_op_sub2_i64:
a0 = args[0], a1 = args[1];
- if (a0 == args[5] || (!const_args[4] && a0 == args[4])) {
+ if (a0 == args[5] || (!const_args[3] && a0 == args[3])) {
a0 = TCG_REG_R0;
}
if (const_args[2]) {
- tcg_out32(s, SUBFIC | TAI(a0, args[3], args[2]));
+ tcg_out32(s, SUBFIC | TAI(a0, args[4], args[2]));
} else {
- tcg_out32(s, SUBFC | TAB(a0, args[3], args[2]));
+ tcg_out32(s, SUBFC | TAB(a0, args[4], args[2]));
}
- if (const_args[4]) {
- tcg_out32(s, (args[4] ? SUBFME : SUBFZE) | RT(a1) | RA(args[5]));
+ if (const_args[3]) {
+ tcg_out32(s, (args[3] ? SUBFME : SUBFZE) | RT(a1) | RA(args[5]));
} else {
- tcg_out32(s, SUBFE | TAB(a1, args[5], args[4]));
+ tcg_out32(s, SUBFE | TAB(a1, args[5], args[3]));
}
if (a0 != args[0]) {
tcg_out_mov(s, TCG_TYPE_REG, args[0], a0);
@@ -2146,7 +2146,7 @@ static const TCGTargetOpDef ppc_op_defs[] = {
{ INDEX_op_deposit_i64, { "r", "0", "rZ" } },
{ INDEX_op_add2_i64, { "r", "r", "r", "r", "rI", "rZM" } },
- { INDEX_op_sub2_i64, { "r", "r", "rI", "r", "rZM", "r" } },
+ { INDEX_op_sub2_i64, { "r", "r", "rI", "rZM", "r", "r" } },
{ INDEX_op_mulsh_i64, { "r", "r", "r" } },
{ INDEX_op_muluh_i64, { "r", "r", "r" } },