tcg: Remove TCG_TARGET_HAS_negsetcond_{i32,i64}
All targets now provide negsetcond, so remove the conditional. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
9204be8dec
commit
f791458932
14 changed files with 14 additions and 48 deletions
|
|
@ -16,7 +16,6 @@
|
|||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 1
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_add2_i32 1
|
||||
#define TCG_TARGET_HAS_sub2_i32 1
|
||||
#define TCG_TARGET_HAS_extr_i64_i32 0
|
||||
|
|
@ -26,7 +25,6 @@
|
|||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 1
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_add2_i64 1
|
||||
#define TCG_TARGET_HAS_sub2_i64 1
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ extern bool use_neon_instructions;
|
|||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 1
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_qemu_st8_i32 0
|
||||
|
||||
#define TCG_TARGET_HAS_qemu_ldst_i128 0
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 1
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_add2_i32 1
|
||||
#define TCG_TARGET_HAS_sub2_i32 1
|
||||
|
||||
|
|
@ -40,7 +39,6 @@
|
|||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 1
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_add2_i64 1
|
||||
#define TCG_TARGET_HAS_sub2_i64 1
|
||||
#define TCG_TARGET_HAS_qemu_st8_i32 0
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "host/cpuinfo.h"
|
||||
|
||||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_add2_i32 0
|
||||
#define TCG_TARGET_HAS_sub2_i32 0
|
||||
|
|
@ -19,7 +18,6 @@
|
|||
#define TCG_TARGET_HAS_qemu_st8_i32 0
|
||||
|
||||
/* 64-bit operations */
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_extr_i64_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 1
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ extern bool use_mips32r2_instructions;
|
|||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
#define TCG_TARGET_HAS_add2_i32 0
|
||||
|
|
@ -51,7 +50,6 @@ extern bool use_mips32r2_instructions;
|
|||
#define TCG_TARGET_HAS_sub2_i64 0
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext32u_i64 1
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#endif
|
||||
|
||||
/* optional instructions detected at runtime */
|
||||
|
|
|
|||
|
|
@ -1996,23 +1996,19 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op)
|
|||
if (ti_is_const(tt) && ti_is_const(ft)) {
|
||||
uint64_t tv = ti_const_val(tt);
|
||||
uint64_t fv = ti_const_val(ft);
|
||||
TCGOpcode opc, negopc = 0;
|
||||
TCGOpcode opc, negopc;
|
||||
TCGCond cond = op->args[5];
|
||||
|
||||
switch (ctx->type) {
|
||||
case TCG_TYPE_I32:
|
||||
opc = INDEX_op_setcond_i32;
|
||||
if (TCG_TARGET_HAS_negsetcond_i32) {
|
||||
negopc = INDEX_op_negsetcond_i32;
|
||||
}
|
||||
negopc = INDEX_op_negsetcond_i32;
|
||||
tv = (int32_t)tv;
|
||||
fv = (int32_t)fv;
|
||||
break;
|
||||
case TCG_TYPE_I64:
|
||||
opc = INDEX_op_setcond_i64;
|
||||
if (TCG_TARGET_HAS_negsetcond_i64) {
|
||||
negopc = INDEX_op_negsetcond_i64;
|
||||
}
|
||||
negopc = INDEX_op_negsetcond_i64;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
|
@ -2024,14 +2020,12 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op)
|
|||
} else if (fv == 1 && tv == 0) {
|
||||
op->opc = opc;
|
||||
op->args[3] = tcg_invert_cond(cond);
|
||||
} else if (negopc) {
|
||||
if (tv == -1 && fv == 0) {
|
||||
op->opc = negopc;
|
||||
op->args[3] = cond;
|
||||
} else if (fv == -1 && tv == 0) {
|
||||
op->opc = negopc;
|
||||
op->args[3] = tcg_invert_cond(cond);
|
||||
}
|
||||
} else if (tv == -1 && fv == 0) {
|
||||
op->opc = negopc;
|
||||
op->args[3] = cond;
|
||||
} else if (fv == -1 && tv == 0) {
|
||||
op->opc = negopc;
|
||||
op->args[3] = tcg_invert_cond(cond);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_qemu_st8_i32 0
|
||||
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
|
|
@ -31,7 +30,6 @@
|
|||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_add2_i64 1
|
||||
#define TCG_TARGET_HAS_sub2_i64 1
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "host/cpuinfo.h"
|
||||
|
||||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_add2_i32 1
|
||||
#define TCG_TARGET_HAS_sub2_i32 1
|
||||
|
|
@ -18,7 +17,6 @@
|
|||
#define TCG_TARGET_HAS_bswap32_i32 (cpuinfo & CPUINFO_ZBB)
|
||||
#define TCG_TARGET_HAS_qemu_st8_i32 0
|
||||
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_extr_i64_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 (cpuinfo & CPUINFO_ZBB)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ extern uint64_t s390_facilities[3];
|
|||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_add2_i32 1
|
||||
#define TCG_TARGET_HAS_sub2_i32 1
|
||||
#define TCG_TARGET_HAS_extr_i64_i32 0
|
||||
|
|
@ -42,7 +41,6 @@ extern uint64_t s390_facilities[3];
|
|||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_add2_i64 1
|
||||
#define TCG_TARGET_HAS_sub2_i64 1
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ extern bool use_vis3_instructions;
|
|||
#define TCG_TARGET_HAS_bswap16_i32 0
|
||||
#define TCG_TARGET_HAS_bswap32_i32 0
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_add2_i32 1
|
||||
#define TCG_TARGET_HAS_sub2_i32 1
|
||||
#define TCG_TARGET_HAS_qemu_st8_i32 0
|
||||
|
|
@ -27,7 +26,6 @@ extern bool use_vis3_instructions;
|
|||
#define TCG_TARGET_HAS_bswap32_i64 0
|
||||
#define TCG_TARGET_HAS_bswap64_i64 0
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_add2_i64 1
|
||||
#define TCG_TARGET_HAS_sub2_i64 1
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#define TCG_TARGET_HAS_bswap32_i64 0
|
||||
#define TCG_TARGET_HAS_bswap64_i64 0
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 0
|
||||
#define TCG_TARGET_HAS_add2_i64 0
|
||||
#define TCG_TARGET_HAS_sub2_i64 0
|
||||
/* Turn some undef macros into true macros. */
|
||||
|
|
|
|||
12
tcg/tcg-op.c
12
tcg/tcg-op.c
|
|
@ -569,11 +569,8 @@ void tcg_gen_negsetcond_i32(TCGCond cond, TCGv_i32 ret,
|
|||
tcg_gen_movi_i32(ret, -1);
|
||||
} else if (cond == TCG_COND_NEVER) {
|
||||
tcg_gen_movi_i32(ret, 0);
|
||||
} else if (TCG_TARGET_HAS_negsetcond_i32) {
|
||||
tcg_gen_op4i_i32(INDEX_op_negsetcond_i32, ret, arg1, arg2, cond);
|
||||
} else {
|
||||
tcg_gen_setcond_i32(cond, ret, arg1, arg2);
|
||||
tcg_gen_neg_i32(ret, ret);
|
||||
tcg_gen_op4i_i32(INDEX_op_negsetcond_i32, ret, arg1, arg2, cond);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1950,17 +1947,14 @@ void tcg_gen_negsetcond_i64(TCGCond cond, TCGv_i64 ret,
|
|||
tcg_gen_movi_i64(ret, -1);
|
||||
} else if (cond == TCG_COND_NEVER) {
|
||||
tcg_gen_movi_i64(ret, 0);
|
||||
} else if (TCG_TARGET_HAS_negsetcond_i64) {
|
||||
} else if (TCG_TARGET_REG_BITS == 64) {
|
||||
tcg_gen_op4i_i64(INDEX_op_negsetcond_i64, ret, arg1, arg2, cond);
|
||||
} else if (TCG_TARGET_REG_BITS == 32) {
|
||||
} else {
|
||||
tcg_gen_op6i_i32(INDEX_op_setcond2_i32, TCGV_LOW(ret),
|
||||
TCGV_LOW(arg1), TCGV_HIGH(arg1),
|
||||
TCGV_LOW(arg2), TCGV_HIGH(arg2), cond);
|
||||
tcg_gen_neg_i32(TCGV_LOW(ret), TCGV_LOW(ret));
|
||||
tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_LOW(ret));
|
||||
} else {
|
||||
tcg_gen_setcond_i64(cond, ret, arg1, arg2);
|
||||
tcg_gen_neg_i64(ret, ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2268,6 +2268,7 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags)
|
|||
return has_type;
|
||||
|
||||
case INDEX_op_setcond_i32:
|
||||
case INDEX_op_negsetcond_i32:
|
||||
case INDEX_op_brcond_i32:
|
||||
case INDEX_op_movcond_i32:
|
||||
case INDEX_op_ld8u_i32:
|
||||
|
|
@ -2283,8 +2284,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags)
|
|||
case INDEX_op_deposit_i32:
|
||||
return true;
|
||||
|
||||
case INDEX_op_negsetcond_i32:
|
||||
return TCG_TARGET_HAS_negsetcond_i32;
|
||||
case INDEX_op_extract2_i32:
|
||||
return TCG_TARGET_HAS_extract2_i32;
|
||||
case INDEX_op_add2_i32:
|
||||
|
|
@ -2301,6 +2300,7 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags)
|
|||
return TCG_TARGET_REG_BITS == 32;
|
||||
|
||||
case INDEX_op_setcond_i64:
|
||||
case INDEX_op_negsetcond_i64:
|
||||
case INDEX_op_brcond_i64:
|
||||
case INDEX_op_movcond_i64:
|
||||
case INDEX_op_ld8u_i64:
|
||||
|
|
@ -2321,8 +2321,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags)
|
|||
case INDEX_op_deposit_i64:
|
||||
return TCG_TARGET_REG_BITS == 64;
|
||||
|
||||
case INDEX_op_negsetcond_i64:
|
||||
return TCG_TARGET_HAS_negsetcond_i64;
|
||||
case INDEX_op_extract2_i64:
|
||||
return TCG_TARGET_HAS_extract2_i64;
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i32 1
|
||||
#define TCG_TARGET_HAS_qemu_st8_i32 0
|
||||
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
|
|
@ -19,7 +18,6 @@
|
|||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_negsetcond_i64 1
|
||||
#define TCG_TARGET_HAS_add2_i32 1
|
||||
#define TCG_TARGET_HAS_sub2_i32 1
|
||||
#define TCG_TARGET_HAS_add2_i64 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue