提交 3c980d2e 编写于 作者: L Laurent Vivier

target-m68k: some bit ops cleanup

Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
Reviewed-by: NRichard Henderson <rth@twiddle.net>
上级 415f4b62
......@@ -1290,39 +1290,36 @@ DISAS_INSN(bitop_reg)
else
opsize = OS_LONG;
op = (insn >> 6) & 3;
gen_flush_flags(s);
SRC_EA(env, src1, opsize, 0, op ? &addr: NULL);
src2 = DREG(insn, 9);
dest = tcg_temp_new();
tmp = tcg_temp_new();
gen_flush_flags(s);
src2 = tcg_temp_new();
if (opsize == OS_BYTE)
tcg_gen_andi_i32(tmp, src2, 7);
tcg_gen_andi_i32(src2, DREG(insn, 9), 7);
else
tcg_gen_andi_i32(tmp, src2, 31);
tcg_gen_andi_i32(src2, DREG(insn, 9), 31);
src2 = tcg_const_i32(1);
tcg_gen_shl_i32(src2, src2, tmp);
tcg_temp_free(tmp);
tmp = tcg_const_i32(1);
tcg_gen_shl_i32(tmp, tmp, src2);
tcg_temp_free(src2);
tcg_gen_and_i32(QREG_CC_Z, src1, src2);
tcg_gen_and_i32(QREG_CC_Z, src1, tmp);
dest = tcg_temp_new();
switch (op) {
case 1: /* bchg */
tcg_gen_xor_i32(dest, src1, src2);
tcg_gen_xor_i32(dest, src1, tmp);
break;
case 2: /* bclr */
tcg_gen_andc_i32(dest, src1, src2);
tcg_gen_andc_i32(dest, src1, tmp);
break;
case 3: /* bset */
tcg_gen_or_i32(dest, src1, src2);
tcg_gen_or_i32(dest, src1, tmp);
break;
default: /* btst */
break;
}
tcg_temp_free(src2);
tcg_temp_free(tmp);
if (op) {
DEST_EA(env, insn, opsize, dest, &addr);
}
......@@ -1406,17 +1403,16 @@ DISAS_INSN(bitop_im)
return;
}
gen_flush_flags(s);
SRC_EA(env, src1, opsize, 0, op ? &addr: NULL);
gen_flush_flags(s);
if (opsize == OS_BYTE)
bitnum &= 7;
else
bitnum &= 31;
mask = 1 << bitnum;
tcg_gen_andi_i32(QREG_CC_Z, src1, mask);
tcg_gen_andi_i32(QREG_CC_Z, src1, mask);
if (op) {
tmp = tcg_temp_new();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册