aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2016-01-16 23:38:08 +0100
committerLaurent Vivier <laurent@vivier.eu>2016-10-28 10:38:48 +0200
commit52dc23c5956159a79a4e2d4193e44d2c4cf3883c (patch)
tree8386b495947fcf0d741763f389a049041885dd39
parent020a4659208a6f9a985881504fd4d3b44ab589be (diff)
target-m68k: and can manage word and byte operands
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net>
-rw-r--r--target-m68k/translate.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index a6aaf5ea64..3f7db833f8 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -2179,19 +2179,23 @@ DISAS_INSN(and)
TCGv reg;
TCGv dest;
TCGv addr;
+ int opsize;
- reg = DREG(insn, 9);
dest = tcg_temp_new();
+
+ opsize = insn_opsize(insn);
+ reg = DREG(insn, 9);
if (insn & 0x100) {
- SRC_EA(env, src, OS_LONG, 0, &addr);
+ SRC_EA(env, src, opsize, 0, &addr);
tcg_gen_and_i32(dest, src, reg);
- DEST_EA(env, insn, OS_LONG, dest, &addr);
+ DEST_EA(env, insn, opsize, dest, &addr);
} else {
- SRC_EA(env, src, OS_LONG, 0, NULL);
+ SRC_EA(env, src, opsize, 0, NULL);
tcg_gen_and_i32(dest, src, reg);
- tcg_gen_mov_i32(reg, dest);
+ gen_partset_reg(opsize, reg, dest);
}
- gen_logic_cc(s, dest, OS_LONG);
+ tcg_temp_free(dest);
+ gen_logic_cc(s, dest, opsize);
}
DISAS_INSN(adda)