提交 ff99b952 编写于 作者: L Laurent Vivier

target-m68k: cmp manages word and bytes operands

Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
Reviewed-by: NRichard Henderson <rth@twiddle.net>
上级 8a370c6c
......@@ -582,6 +582,13 @@ static void gen_logic_cc(DisasContext *s, TCGv val, int opsize)
set_cc_op(s, CC_OP_LOGIC);
}
static void gen_update_cc_cmp(DisasContext *s, TCGv dest, TCGv src, int opsize)
{
tcg_gen_mov_i32(QREG_CC_N, dest);
tcg_gen_mov_i32(QREG_CC_V, src);
set_cc_op(s, CC_OP_CMPB + opsize);
}
static void gen_update_cc_add(TCGv dest, TCGv src, int opsize)
{
gen_ext(QREG_CC_N, dest, opsize, 1);
......@@ -2132,10 +2139,9 @@ DISAS_INSN(cmp)
int opsize;
opsize = insn_opsize(insn);
SRC_EA(env, src, opsize, -1, NULL);
reg = DREG(insn, 9);
gen_update_cc_add(reg, src, OS_LONG);
set_cc_op(s, CC_OP_CMPL);
SRC_EA(env, src, opsize, 1, NULL);
reg = gen_extend(DREG(insn, 9), opsize, 1);
gen_update_cc_cmp(s, reg, src, opsize);
}
DISAS_INSN(cmpa)
......@@ -2151,8 +2157,7 @@ DISAS_INSN(cmpa)
}
SRC_EA(env, src, opsize, 1, NULL);
reg = AREG(insn, 9);
gen_update_cc_add(reg, src, OS_LONG);
set_cc_op(s, CC_OP_CMPL);
gen_update_cc_cmp(s, reg, src, opsize);
}
DISAS_INSN(eor)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册