aboutsummaryrefslogtreecommitdiff
path: root/target-m68k
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2016-01-16 23:13:23 +0100
committerLaurent Vivier <laurent@vivier.eu>2016-10-28 10:38:48 +0200
commit227de713e0f4224a82c32991b4e4c4973381426b (patch)
treecb5de69e41b00ca76a72aa253db9ec9de120d652 /target-m68k
parentdb3d7945ae7992c91cc5705dccf60fec79b24dc4 (diff)
target-m68k: add addressing modes to neg
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-m68k')
-rw-r--r--target-m68k/translate.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index aa09bd418c..f7e6920657 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -1631,16 +1631,20 @@ DISAS_INSN(move_from_ccr)
DISAS_INSN(neg)
{
- TCGv reg;
TCGv src1;
+ TCGv dest;
+ TCGv addr;
+ int opsize;
- reg = DREG(insn, 0);
- src1 = tcg_temp_new();
- tcg_gen_mov_i32(src1, reg);
- tcg_gen_neg_i32(reg, src1);
- gen_update_cc_add(reg, src1, OS_LONG);
- tcg_gen_setcondi_i32(TCG_COND_NE, QREG_CC_X, src1, 0);
- set_cc_op(s, CC_OP_SUBL);
+ opsize = insn_opsize(insn);
+ SRC_EA(env, src1, opsize, 1, &addr);
+ dest = tcg_temp_new();
+ tcg_gen_neg_i32(dest, src1);
+ set_cc_op(s, CC_OP_SUBB + opsize);
+ gen_update_cc_add(dest, src1, opsize);
+ tcg_gen_setcondi_i32(TCG_COND_NE, QREG_CC_X, dest, 0);
+ DEST_EA(env, insn, opsize, dest, &addr);
+ tcg_temp_free(dest);
}
static void gen_set_sr_im(DisasContext *s, uint16_t val, int ccr_only)