mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
tcg: Remove INDEX_op_ext{8,16,32}*
Use the fully general extract opcodes instead. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -396,20 +396,6 @@ Misc
|
||||
- | *t0* = *t1*
|
||||
| Move *t1* to *t0* (both operands must have the same type).
|
||||
|
||||
* - ext8s_i32/i64 *t0*, *t1*
|
||||
|
||||
ext8u_i32/i64 *t0*, *t1*
|
||||
|
||||
ext16s_i32/i64 *t0*, *t1*
|
||||
|
||||
ext16u_i32/i64 *t0*, *t1*
|
||||
|
||||
ext32s_i64 *t0*, *t1*
|
||||
|
||||
ext32u_i64 *t0*, *t1*
|
||||
|
||||
- | 8, 16 or 32 bit sign/zero extension (both operands must have the same type)
|
||||
|
||||
* - bswap16_i32/i64 *t0*, *t1*, *flags*
|
||||
|
||||
- | 16 bit byte swap on the low bits of a 32/64 bit input.
|
||||
|
||||
@@ -85,10 +85,6 @@ DEF(mulsh_i32, 1, 2, 0, 0)
|
||||
DEF(brcond2_i32, 0, 4, 2, TCG_OPF_BB_END | TCG_OPF_COND_BRANCH)
|
||||
DEF(setcond2_i32, 1, 4, 1, 0)
|
||||
|
||||
DEF(ext8s_i32, 1, 1, 0, 0)
|
||||
DEF(ext16s_i32, 1, 1, 0, 0)
|
||||
DEF(ext8u_i32, 1, 1, 0, 0)
|
||||
DEF(ext16u_i32, 1, 1, 0, 0)
|
||||
DEF(bswap16_i32, 1, 1, 1, 0)
|
||||
DEF(bswap32_i32, 1, 1, 1, 0)
|
||||
DEF(not_i32, 1, 1, 0, 0)
|
||||
@@ -149,12 +145,6 @@ DEF(extrl_i64_i32, 1, 1, 0, 0)
|
||||
DEF(extrh_i64_i32, 1, 1, 0, 0)
|
||||
|
||||
DEF(brcond_i64, 0, 2, 2, TCG_OPF_BB_END | TCG_OPF_COND_BRANCH)
|
||||
DEF(ext8s_i64, 1, 1, 0, 0)
|
||||
DEF(ext16s_i64, 1, 1, 0, 0)
|
||||
DEF(ext32s_i64, 1, 1, 0, 0)
|
||||
DEF(ext8u_i64, 1, 1, 0, 0)
|
||||
DEF(ext16u_i64, 1, 1, 0, 0)
|
||||
DEF(ext32u_i64, 1, 1, 0, 0)
|
||||
DEF(bswap16_i64, 1, 1, 1, 0)
|
||||
DEF(bswap32_i64, 1, 1, 1, 0)
|
||||
DEF(bswap64_i64, 1, 1, 1, 0)
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_div_i32 1
|
||||
#define TCG_TARGET_HAS_rem_i32 1
|
||||
#define TCG_TARGET_HAS_ext8s_i32 1
|
||||
#define TCG_TARGET_HAS_ext16s_i32 1
|
||||
#define TCG_TARGET_HAS_ext8u_i32 1
|
||||
#define TCG_TARGET_HAS_ext16u_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_not_i32 1
|
||||
@@ -44,12 +40,6 @@
|
||||
|
||||
#define TCG_TARGET_HAS_div_i64 1
|
||||
#define TCG_TARGET_HAS_rem_i64 1
|
||||
#define TCG_TARGET_HAS_ext8s_i64 1
|
||||
#define TCG_TARGET_HAS_ext16s_i64 1
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext8u_i64 1
|
||||
#define TCG_TARGET_HAS_ext16u_i64 1
|
||||
#define TCG_TARGET_HAS_ext32u_i64 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 1
|
||||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
|
||||
@@ -2493,17 +2493,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext_i32_i64: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
default:
|
||||
@@ -2979,16 +2969,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_bswap16_i64:
|
||||
case INDEX_op_bswap32_i64:
|
||||
case INDEX_op_bswap64_i64:
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extract_i32:
|
||||
|
||||
@@ -24,10 +24,6 @@ extern bool use_neon_instructions;
|
||||
#endif
|
||||
|
||||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_ext8s_i32 1
|
||||
#define TCG_TARGET_HAS_ext16s_i32 1
|
||||
#define TCG_TARGET_HAS_ext8u_i32 0 /* and r0, r1, #0xff */
|
||||
#define TCG_TARGET_HAS_ext16u_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_not_i32 1
|
||||
|
||||
@@ -2113,10 +2113,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16u_i32:
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
@@ -2138,9 +2134,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_not_i32:
|
||||
case INDEX_op_bswap16_i32:
|
||||
case INDEX_op_bswap32_i32:
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_extract_i32:
|
||||
case INDEX_op_sextract_i32:
|
||||
return C_O1_I1(r, r);
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_div2_i32 1
|
||||
#define TCG_TARGET_HAS_rot_i32 1
|
||||
#define TCG_TARGET_HAS_ext8s_i32 1
|
||||
#define TCG_TARGET_HAS_ext16s_i32 1
|
||||
#define TCG_TARGET_HAS_ext8u_i32 1
|
||||
#define TCG_TARGET_HAS_ext16u_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_not_i32 1
|
||||
@@ -57,12 +53,6 @@
|
||||
#define TCG_TARGET_HAS_extr_i64_i32 1
|
||||
#define TCG_TARGET_HAS_div2_i64 1
|
||||
#define TCG_TARGET_HAS_rot_i64 1
|
||||
#define TCG_TARGET_HAS_ext8s_i64 1
|
||||
#define TCG_TARGET_HAS_ext16s_i64 1
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext8u_i64 1
|
||||
#define TCG_TARGET_HAS_ext16u_i64 1
|
||||
#define TCG_TARGET_HAS_ext32u_i64 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 1
|
||||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
|
||||
@@ -3016,17 +3016,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext_i32_i64: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
default:
|
||||
@@ -3663,18 +3653,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_extrh_i64_i32:
|
||||
return C_O1_I1(r, 0);
|
||||
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
return C_O1_I1(r, q);
|
||||
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
#define TCG_TARGET_HAS_muls2_i32 0
|
||||
#define TCG_TARGET_HAS_muluh_i32 1
|
||||
#define TCG_TARGET_HAS_mulsh_i32 1
|
||||
#define TCG_TARGET_HAS_ext8s_i32 1
|
||||
#define TCG_TARGET_HAS_ext16s_i32 1
|
||||
#define TCG_TARGET_HAS_ext8u_i32 1
|
||||
#define TCG_TARGET_HAS_ext16u_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_not_i32 1
|
||||
@@ -47,12 +43,6 @@
|
||||
#define TCG_TARGET_HAS_rot_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_extr_i64_i32 1
|
||||
#define TCG_TARGET_HAS_ext8s_i64 1
|
||||
#define TCG_TARGET_HAS_ext16s_i64 1
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext8u_i64 1
|
||||
#define TCG_TARGET_HAS_ext16u_i64 1
|
||||
#define TCG_TARGET_HAS_ext32u_i64 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 1
|
||||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
|
||||
@@ -1707,17 +1707,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext_i32_i64: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
default:
|
||||
@@ -2243,16 +2233,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_brcond_i64:
|
||||
return C_O0_I2(rz, rz);
|
||||
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
case INDEX_op_extrh_i64_i32:
|
||||
|
||||
@@ -80,8 +80,6 @@ extern bool use_mips32r2_instructions;
|
||||
|
||||
/* optional instructions detected at runtime */
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_rot_i32 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_clz_i32 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_ctz_i32 0
|
||||
@@ -93,23 +91,12 @@ extern bool use_mips32r2_instructions;
|
||||
#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_ext8s_i64 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_rot_i64 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_clz_i64 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_ctz_i64 0
|
||||
#define TCG_TARGET_HAS_ctpop_i64 0
|
||||
#endif
|
||||
|
||||
/* optional instructions automatically implemented */
|
||||
#define TCG_TARGET_HAS_ext8u_i32 0 /* andi rt, rs, 0xff */
|
||||
#define TCG_TARGET_HAS_ext16u_i32 0 /* andi rt, rs, 0xffff */
|
||||
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
#define TCG_TARGET_HAS_ext8u_i64 0 /* andi rt, rs, 0xff */
|
||||
#define TCG_TARGET_HAS_ext16u_i64 0 /* andi rt, rs, 0xffff */
|
||||
#endif
|
||||
|
||||
#define TCG_TARGET_HAS_qemu_ldst_i128 0
|
||||
#define TCG_TARGET_HAS_tst 0
|
||||
|
||||
|
||||
@@ -647,7 +647,7 @@ static void tcg_out_movi(TCGContext *s, TCGType type,
|
||||
|
||||
static void tcg_out_ext8s(TCGContext *s, TCGType type, TCGReg rd, TCGReg rs)
|
||||
{
|
||||
tcg_debug_assert(TCG_TARGET_HAS_ext8s_i32);
|
||||
tcg_debug_assert(use_mips32r2_instructions);
|
||||
tcg_out_opc_reg(s, OPC_SEB, rd, TCG_REG_ZERO, rs);
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ static void tcg_out_ext8u(TCGContext *s, TCGReg rd, TCGReg rs)
|
||||
|
||||
static void tcg_out_ext16s(TCGContext *s, TCGType type, TCGReg rd, TCGReg rs)
|
||||
{
|
||||
tcg_debug_assert(TCG_TARGET_HAS_ext16s_i32);
|
||||
tcg_debug_assert(use_mips32r2_instructions);
|
||||
tcg_out_opc_reg(s, OPC_SEH, rd, TCG_REG_ZERO, rs);
|
||||
}
|
||||
|
||||
@@ -2106,15 +2106,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext_i32_i64: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
default:
|
||||
@@ -2138,8 +2130,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_not_i32:
|
||||
case INDEX_op_bswap16_i32:
|
||||
case INDEX_op_bswap32_i32:
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_extract_i32:
|
||||
case INDEX_op_sextract_i32:
|
||||
case INDEX_op_ld8u_i64:
|
||||
@@ -2154,10 +2144,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_bswap16_i64:
|
||||
case INDEX_op_bswap32_i64:
|
||||
case INDEX_op_bswap64_i64:
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
|
||||
+3
-58
@@ -513,18 +513,6 @@ static uint64_t do_constant_folding_2(TCGOpcode op, uint64_t x, uint64_t y)
|
||||
case INDEX_op_ctpop_i64:
|
||||
return ctpop64(x);
|
||||
|
||||
CASE_OP_32_64(ext8s):
|
||||
return (int8_t)x;
|
||||
|
||||
CASE_OP_32_64(ext16s):
|
||||
return (int16_t)x;
|
||||
|
||||
CASE_OP_32_64(ext8u):
|
||||
return (uint8_t)x;
|
||||
|
||||
CASE_OP_32_64(ext16u):
|
||||
return (uint16_t)x;
|
||||
|
||||
CASE_OP_32_64(bswap16):
|
||||
x = bswap16(x);
|
||||
return y & TCG_BSWAP_OS ? (int16_t)x : x;
|
||||
@@ -537,12 +525,10 @@ static uint64_t do_constant_folding_2(TCGOpcode op, uint64_t x, uint64_t y)
|
||||
return bswap64(x);
|
||||
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
return (int32_t)x;
|
||||
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
case INDEX_op_ext32u_i64:
|
||||
return (uint32_t)x;
|
||||
|
||||
case INDEX_op_extrh_i64_i32:
|
||||
@@ -1869,8 +1855,7 @@ static bool fold_extract2(OptContext *ctx, TCGOp *op)
|
||||
|
||||
static bool fold_exts(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
uint64_t s_mask_old, s_mask, z_mask;
|
||||
bool type_change = false;
|
||||
uint64_t s_mask, z_mask;
|
||||
TempOptInfo *t1;
|
||||
|
||||
if (fold_const1(ctx, op)) {
|
||||
@@ -1880,72 +1865,38 @@ static bool fold_exts(OptContext *ctx, TCGOp *op)
|
||||
t1 = arg_info(op->args[1]);
|
||||
z_mask = t1->z_mask;
|
||||
s_mask = t1->s_mask;
|
||||
s_mask_old = s_mask;
|
||||
|
||||
switch (op->opc) {
|
||||
CASE_OP_32_64(ext8s):
|
||||
s_mask |= INT8_MIN;
|
||||
z_mask = (int8_t)z_mask;
|
||||
break;
|
||||
CASE_OP_32_64(ext16s):
|
||||
s_mask |= INT16_MIN;
|
||||
z_mask = (int16_t)z_mask;
|
||||
break;
|
||||
case INDEX_op_ext_i32_i64:
|
||||
type_change = true;
|
||||
QEMU_FALLTHROUGH;
|
||||
case INDEX_op_ext32s_i64:
|
||||
s_mask |= INT32_MIN;
|
||||
z_mask = (int32_t)z_mask;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return fold_masks_zs(ctx, op, z_mask, s_mask);
|
||||
}
|
||||
|
||||
static bool fold_extu(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
uint64_t z_mask_old, z_mask;
|
||||
bool type_change = false;
|
||||
uint64_t z_mask;
|
||||
|
||||
if (fold_const1(ctx, op)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
z_mask_old = z_mask = arg_info(op->args[1])->z_mask;
|
||||
|
||||
z_mask = arg_info(op->args[1])->z_mask;
|
||||
switch (op->opc) {
|
||||
CASE_OP_32_64(ext8u):
|
||||
z_mask = (uint8_t)z_mask;
|
||||
break;
|
||||
CASE_OP_32_64(ext16u):
|
||||
z_mask = (uint16_t)z_mask;
|
||||
break;
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
type_change = true;
|
||||
QEMU_FALLTHROUGH;
|
||||
case INDEX_op_ext32u_i64:
|
||||
z_mask = (uint32_t)z_mask;
|
||||
break;
|
||||
case INDEX_op_extrh_i64_i32:
|
||||
type_change = true;
|
||||
z_mask >>= 32;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return fold_masks_z(ctx, op, z_mask);
|
||||
}
|
||||
|
||||
@@ -2948,15 +2899,9 @@ void tcg_optimize(TCGContext *s)
|
||||
CASE_OP_32_64(extract2):
|
||||
done = fold_extract2(&ctx, op);
|
||||
break;
|
||||
CASE_OP_32_64(ext8s):
|
||||
CASE_OP_32_64(ext16s):
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
done = fold_exts(&ctx, op);
|
||||
break;
|
||||
CASE_OP_32_64(ext8u):
|
||||
CASE_OP_32_64(ext16u):
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
case INDEX_op_extrh_i64_i32:
|
||||
|
||||
@@ -16,16 +16,10 @@
|
||||
#define have_altivec (cpuinfo & CPUINFO_ALTIVEC)
|
||||
#define have_vsx (cpuinfo & CPUINFO_VSX)
|
||||
|
||||
/* optional instructions automatically implemented */
|
||||
#define TCG_TARGET_HAS_ext8u_i32 0 /* andi */
|
||||
#define TCG_TARGET_HAS_ext16u_i32 0
|
||||
|
||||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_div_i32 1
|
||||
#define TCG_TARGET_HAS_rem_i32 have_isa_3_00
|
||||
#define TCG_TARGET_HAS_rot_i32 1
|
||||
#define TCG_TARGET_HAS_ext8s_i32 1
|
||||
#define TCG_TARGET_HAS_ext16s_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_not_i32 1
|
||||
@@ -52,12 +46,6 @@
|
||||
#define TCG_TARGET_HAS_div_i64 1
|
||||
#define TCG_TARGET_HAS_rem_i64 have_isa_3_00
|
||||
#define TCG_TARGET_HAS_rot_i64 1
|
||||
#define TCG_TARGET_HAS_ext8s_i64 1
|
||||
#define TCG_TARGET_HAS_ext16s_i64 1
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext8u_i64 0
|
||||
#define TCG_TARGET_HAS_ext16u_i64 0
|
||||
#define TCG_TARGET_HAS_ext32u_i64 0
|
||||
#define TCG_TARGET_HAS_bswap16_i64 1
|
||||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
|
||||
@@ -3473,17 +3473,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext_i32_i64: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
default:
|
||||
@@ -4109,8 +4099,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_ctpop_i32:
|
||||
case INDEX_op_neg_i32:
|
||||
case INDEX_op_not_i32:
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_bswap16_i32:
|
||||
case INDEX_op_bswap32_i32:
|
||||
case INDEX_op_extract_i32:
|
||||
@@ -4125,9 +4113,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_ctpop_i64:
|
||||
case INDEX_op_neg_i64:
|
||||
case INDEX_op_not_i64:
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_bswap16_i64:
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
#define TCG_TARGET_HAS_muls2_i32 0
|
||||
#define TCG_TARGET_HAS_muluh_i32 0
|
||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||
#define TCG_TARGET_HAS_ext8s_i32 1
|
||||
#define TCG_TARGET_HAS_ext16s_i32 1
|
||||
#define TCG_TARGET_HAS_ext8u_i32 1
|
||||
#define TCG_TARGET_HAS_ext16u_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i32 (cpuinfo & CPUINFO_ZBB)
|
||||
#define TCG_TARGET_HAS_bswap32_i32 (cpuinfo & CPUINFO_ZBB)
|
||||
#define TCG_TARGET_HAS_not_i32 1
|
||||
@@ -46,12 +42,6 @@
|
||||
#define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB)
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_extr_i64_i32 1
|
||||
#define TCG_TARGET_HAS_ext8s_i64 1
|
||||
#define TCG_TARGET_HAS_ext16s_i64 1
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext8u_i64 1
|
||||
#define TCG_TARGET_HAS_ext16u_i64 1
|
||||
#define TCG_TARGET_HAS_ext32u_i64 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 (cpuinfo & CPUINFO_ZBB)
|
||||
#define TCG_TARGET_HAS_bswap32_i64 (cpuinfo & CPUINFO_ZBB)
|
||||
#define TCG_TARGET_HAS_bswap64_i64 (cpuinfo & CPUINFO_ZBB)
|
||||
|
||||
@@ -2385,17 +2385,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext_i32_i64: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
default:
|
||||
@@ -2643,17 +2633,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_ld_i64:
|
||||
case INDEX_op_not_i64:
|
||||
case INDEX_op_neg_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
case INDEX_op_extrh_i64_i32:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
|
||||
@@ -31,10 +31,6 @@ extern uint64_t s390_facilities[3];
|
||||
/* optional instructions */
|
||||
#define TCG_TARGET_HAS_div2_i32 1
|
||||
#define TCG_TARGET_HAS_rot_i32 1
|
||||
#define TCG_TARGET_HAS_ext8s_i32 1
|
||||
#define TCG_TARGET_HAS_ext16s_i32 1
|
||||
#define TCG_TARGET_HAS_ext8u_i32 1
|
||||
#define TCG_TARGET_HAS_ext16u_i32 1
|
||||
#define TCG_TARGET_HAS_bswap16_i32 1
|
||||
#define TCG_TARGET_HAS_bswap32_i32 1
|
||||
#define TCG_TARGET_HAS_not_i32 HAVE_FACILITY(MISC_INSN_EXT3)
|
||||
@@ -59,12 +55,6 @@ extern uint64_t s390_facilities[3];
|
||||
|
||||
#define TCG_TARGET_HAS_div2_i64 1
|
||||
#define TCG_TARGET_HAS_rot_i64 1
|
||||
#define TCG_TARGET_HAS_ext8s_i64 1
|
||||
#define TCG_TARGET_HAS_ext16s_i64 1
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext8u_i64 1
|
||||
#define TCG_TARGET_HAS_ext16u_i64 1
|
||||
#define TCG_TARGET_HAS_ext32u_i64 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 1
|
||||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
|
||||
@@ -2781,17 +2781,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type,
|
||||
case INDEX_op_call: /* Always emitted via tcg_out_call. */
|
||||
case INDEX_op_exit_tb: /* Always emitted via tcg_out_exit_tb. */
|
||||
case INDEX_op_goto_tb: /* Always emitted via tcg_out_goto_tb. */
|
||||
case INDEX_op_ext8s_i32: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext_i32_i64: /* Always emitted via tcg_reg_alloc_op. */
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extrl_i64_i32:
|
||||
default:
|
||||
@@ -3340,16 +3330,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
|
||||
case INDEX_op_neg_i64:
|
||||
case INDEX_op_not_i32:
|
||||
case INDEX_op_not_i64:
|
||||
case INDEX_op_ext8s_i32:
|
||||
case INDEX_op_ext8s_i64:
|
||||
case INDEX_op_ext8u_i32:
|
||||
case INDEX_op_ext8u_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16u_i32:
|
||||
case INDEX_op_ext16u_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
case INDEX_op_ext32u_i64:
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_extu_i32_i64:
|
||||
case INDEX_op_extract_i32:
|
||||
|
||||
@@ -17,10 +17,6 @@ extern bool use_vis3_instructions;
|
||||
#define TCG_TARGET_HAS_div_i32 1
|
||||
#define TCG_TARGET_HAS_rem_i32 0
|
||||
#define TCG_TARGET_HAS_rot_i32 0
|
||||
#define TCG_TARGET_HAS_ext8s_i32 0
|
||||
#define TCG_TARGET_HAS_ext16s_i32 0
|
||||
#define TCG_TARGET_HAS_ext8u_i32 0
|
||||
#define TCG_TARGET_HAS_ext16u_i32 0
|
||||
#define TCG_TARGET_HAS_bswap16_i32 0
|
||||
#define TCG_TARGET_HAS_bswap32_i32 0
|
||||
#define TCG_TARGET_HAS_not_i32 1
|
||||
@@ -46,12 +42,6 @@ extern bool use_vis3_instructions;
|
||||
#define TCG_TARGET_HAS_div_i64 1
|
||||
#define TCG_TARGET_HAS_rem_i64 0
|
||||
#define TCG_TARGET_HAS_rot_i64 0
|
||||
#define TCG_TARGET_HAS_ext8s_i64 0
|
||||
#define TCG_TARGET_HAS_ext16s_i64 0
|
||||
#define TCG_TARGET_HAS_ext32s_i64 1
|
||||
#define TCG_TARGET_HAS_ext8u_i64 0
|
||||
#define TCG_TARGET_HAS_ext16u_i64 0
|
||||
#define TCG_TARGET_HAS_ext32u_i64 1
|
||||
#define TCG_TARGET_HAS_bswap16_i64 0
|
||||
#define TCG_TARGET_HAS_bswap32_i64 0
|
||||
#define TCG_TARGET_HAS_bswap64_i64 0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user