mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
tcg: Remove add2/sub2 opcodes
All uses have been replaced by add/sub carry opcodes. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
4b0ee858be
commit
f2b1708e80
16 changed files with 3 additions and 217 deletions
36
tcg/tcg.c
36
tcg/tcg.c
|
@ -2430,11 +2430,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags)
|
|||
case INDEX_op_st_i32:
|
||||
return true;
|
||||
|
||||
case INDEX_op_add2_i32:
|
||||
return TCG_TARGET_HAS_add2_i32;
|
||||
case INDEX_op_sub2_i32:
|
||||
return TCG_TARGET_HAS_sub2_i32;
|
||||
|
||||
case INDEX_op_brcond2_i32:
|
||||
case INDEX_op_setcond2_i32:
|
||||
return TCG_TARGET_REG_BITS == 32;
|
||||
|
@ -2456,11 +2451,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags)
|
|||
case INDEX_op_extrh_i64_i32:
|
||||
return TCG_TARGET_REG_BITS == 64;
|
||||
|
||||
case INDEX_op_add2_i64:
|
||||
return TCG_TARGET_HAS_add2_i64;
|
||||
case INDEX_op_sub2_i64:
|
||||
return TCG_TARGET_HAS_sub2_i64;
|
||||
|
||||
case INDEX_op_mov_vec:
|
||||
case INDEX_op_dup_vec:
|
||||
case INDEX_op_dupm_vec:
|
||||
|
@ -4101,32 +4091,6 @@ liveness_pass_1(TCGContext *s)
|
|||
la_reset_pref(ts);
|
||||
break;
|
||||
|
||||
case INDEX_op_add2_i32:
|
||||
case INDEX_op_add2_i64:
|
||||
opc_new = INDEX_op_add;
|
||||
goto do_addsub2;
|
||||
case INDEX_op_sub2_i32:
|
||||
case INDEX_op_sub2_i64:
|
||||
opc_new = INDEX_op_sub;
|
||||
do_addsub2:
|
||||
assert_carry_dead(s);
|
||||
/* Test if the high part of the operation is dead, but not
|
||||
the low part. The result can be optimized to a simple
|
||||
add or sub. This happens often for x86_64 guest when the
|
||||
cpu mode is set to 32 bit. */
|
||||
if (arg_temp(op->args[1])->state == TS_DEAD) {
|
||||
if (arg_temp(op->args[0])->state == TS_DEAD) {
|
||||
goto do_remove;
|
||||
}
|
||||
/* Replace the opcode and adjust the args in place,
|
||||
leaving 3 unused args at the end. */
|
||||
op->opc = opc = opc_new;
|
||||
op->args[1] = op->args[2];
|
||||
op->args[2] = op->args[4];
|
||||
/* Fall through and mark the single-word operation live. */
|
||||
}
|
||||
goto do_not_remove;
|
||||
|
||||
case INDEX_op_muls2:
|
||||
opc_new = INDEX_op_mul;
|
||||
opc_new2 = INDEX_op_mulsh;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue