tcg: rename trunc_shr_i32 into trunc_shr_i64_i32
The op is sometimes named trunc_shr_i32 and sometimes trunc_shr_i64_i32, and the name in the README doesn't match the name offered to the frontends. Always use the long name to make it clear it is a size changing op. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
299f801304
commit
0632e555fc
@ -314,7 +314,7 @@ This operation would be equivalent to
|
|||||||
|
|
||||||
dest = (t1 & ~0x0f00) | ((t2 << 8) & 0x0f00)
|
dest = (t1 & ~0x0f00) | ((t2 << 8) & 0x0f00)
|
||||||
|
|
||||||
* trunc_shr_i32 t0, t1, pos
|
* trunc_shr_i64_i32 t0, t1, pos
|
||||||
|
|
||||||
For 64-bit hosts only, right shift the 64-bit input T1 by POS and
|
For 64-bit hosts only, right shift the 64-bit input T1 by POS and
|
||||||
truncate to 32-bit output T0. Depending on the host, this may be
|
truncate to 32-bit output T0. Depending on the host, this may be
|
||||||
|
@ -70,7 +70,7 @@ typedef enum {
|
|||||||
#define TCG_TARGET_HAS_muls2_i32 0
|
#define TCG_TARGET_HAS_muls2_i32 0
|
||||||
#define TCG_TARGET_HAS_muluh_i32 0
|
#define TCG_TARGET_HAS_muluh_i32 0
|
||||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 0
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 0
|
||||||
|
|
||||||
#define TCG_TARGET_HAS_div_i64 1
|
#define TCG_TARGET_HAS_div_i64 1
|
||||||
#define TCG_TARGET_HAS_rem_i64 1
|
#define TCG_TARGET_HAS_rem_i64 1
|
||||||
|
@ -102,7 +102,7 @@ extern bool have_bmi1;
|
|||||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||||
|
|
||||||
#if TCG_TARGET_REG_BITS == 64
|
#if TCG_TARGET_REG_BITS == 64
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 0
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 0
|
||||||
#define TCG_TARGET_HAS_div2_i64 1
|
#define TCG_TARGET_HAS_div2_i64 1
|
||||||
#define TCG_TARGET_HAS_rot_i64 1
|
#define TCG_TARGET_HAS_rot_i64 1
|
||||||
#define TCG_TARGET_HAS_ext8s_i64 1
|
#define TCG_TARGET_HAS_ext8s_i64 1
|
||||||
|
@ -160,7 +160,7 @@ typedef enum {
|
|||||||
#define TCG_TARGET_HAS_muluh_i64 0
|
#define TCG_TARGET_HAS_muluh_i64 0
|
||||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||||
#define TCG_TARGET_HAS_mulsh_i64 0
|
#define TCG_TARGET_HAS_mulsh_i64 0
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 0
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 0
|
||||||
|
|
||||||
#define TCG_TARGET_deposit_i32_valid(ofs, len) ((len) <= 16)
|
#define TCG_TARGET_deposit_i32_valid(ofs, len) ((len) <= 16)
|
||||||
#define TCG_TARGET_deposit_i64_valid(ofs, len) ((len) <= 16)
|
#define TCG_TARGET_deposit_i64_valid(ofs, len) ((len) <= 16)
|
||||||
|
@ -288,7 +288,7 @@ static TCGArg do_constant_folding_2(TCGOpcode op, TCGArg x, TCGArg y)
|
|||||||
case INDEX_op_shr_i32:
|
case INDEX_op_shr_i32:
|
||||||
return (uint32_t)x >> (y & 31);
|
return (uint32_t)x >> (y & 31);
|
||||||
|
|
||||||
case INDEX_op_trunc_shr_i32:
|
case INDEX_op_trunc_shr_i64_i32:
|
||||||
case INDEX_op_shr_i64:
|
case INDEX_op_shr_i64:
|
||||||
return (uint64_t)x >> (y & 63);
|
return (uint64_t)x >> (y & 63);
|
||||||
|
|
||||||
@ -874,7 +874,7 @@ void tcg_optimize(TCGContext *s)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INDEX_op_trunc_shr_i32:
|
case INDEX_op_trunc_shr_i64_i32:
|
||||||
mask = (uint64_t)temps[args[1]].mask >> args[2];
|
mask = (uint64_t)temps[args[1]].mask >> args[2];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1022,7 +1022,7 @@ void tcg_optimize(TCGContext *s)
|
|||||||
}
|
}
|
||||||
goto do_default;
|
goto do_default;
|
||||||
|
|
||||||
case INDEX_op_trunc_shr_i32:
|
case INDEX_op_trunc_shr_i64_i32:
|
||||||
if (temp_is_const(args[1])) {
|
if (temp_is_const(args[1])) {
|
||||||
tmp = do_constant_folding(opc, temps[args[1]].val, args[2]);
|
tmp = do_constant_folding(opc, temps[args[1]].val, args[2]);
|
||||||
tcg_opt_gen_movi(s, op, args, args[0], tmp);
|
tcg_opt_gen_movi(s, op, args, args[0], tmp);
|
||||||
|
@ -77,7 +77,7 @@ typedef enum {
|
|||||||
#if TCG_TARGET_REG_BITS == 64
|
#if TCG_TARGET_REG_BITS == 64
|
||||||
#define TCG_TARGET_HAS_add2_i32 0
|
#define TCG_TARGET_HAS_add2_i32 0
|
||||||
#define TCG_TARGET_HAS_sub2_i32 0
|
#define TCG_TARGET_HAS_sub2_i32 0
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 0
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 0
|
||||||
#define TCG_TARGET_HAS_div_i64 1
|
#define TCG_TARGET_HAS_div_i64 1
|
||||||
#define TCG_TARGET_HAS_rem_i64 0
|
#define TCG_TARGET_HAS_rem_i64 0
|
||||||
#define TCG_TARGET_HAS_rot_i64 1
|
#define TCG_TARGET_HAS_rot_i64 1
|
||||||
|
@ -72,7 +72,7 @@ typedef enum TCGReg {
|
|||||||
#define TCG_TARGET_HAS_muls2_i32 0
|
#define TCG_TARGET_HAS_muls2_i32 0
|
||||||
#define TCG_TARGET_HAS_muluh_i32 0
|
#define TCG_TARGET_HAS_muluh_i32 0
|
||||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 0
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 0
|
||||||
|
|
||||||
#define TCG_TARGET_HAS_div2_i64 1
|
#define TCG_TARGET_HAS_div2_i64 1
|
||||||
#define TCG_TARGET_HAS_rot_i64 1
|
#define TCG_TARGET_HAS_rot_i64 1
|
||||||
|
@ -1413,7 +1413,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
|||||||
case INDEX_op_ext32u_i64:
|
case INDEX_op_ext32u_i64:
|
||||||
tcg_out_arithi(s, a0, a1, 0, SHIFT_SRL);
|
tcg_out_arithi(s, a0, a1, 0, SHIFT_SRL);
|
||||||
break;
|
break;
|
||||||
case INDEX_op_trunc_shr_i32:
|
case INDEX_op_trunc_shr_i64_i32:
|
||||||
if (a2 == 0) {
|
if (a2 == 0) {
|
||||||
tcg_out_mov(s, TCG_TYPE_I32, a0, a1);
|
tcg_out_mov(s, TCG_TYPE_I32, a0, a1);
|
||||||
} else {
|
} else {
|
||||||
@ -1533,7 +1533,7 @@ static const TCGTargetOpDef sparc_op_defs[] = {
|
|||||||
|
|
||||||
{ INDEX_op_ext32s_i64, { "R", "r" } },
|
{ INDEX_op_ext32s_i64, { "R", "r" } },
|
||||||
{ INDEX_op_ext32u_i64, { "R", "r" } },
|
{ INDEX_op_ext32u_i64, { "R", "r" } },
|
||||||
{ INDEX_op_trunc_shr_i32, { "r", "R" } },
|
{ INDEX_op_trunc_shr_i64_i32, { "r", "R" } },
|
||||||
|
|
||||||
{ INDEX_op_brcond_i64, { "RZ", "RJ" } },
|
{ INDEX_op_brcond_i64, { "RZ", "RJ" } },
|
||||||
{ INDEX_op_setcond_i64, { "R", "RZ", "RJ" } },
|
{ INDEX_op_setcond_i64, { "R", "RZ", "RJ" } },
|
||||||
|
@ -118,7 +118,7 @@ extern bool use_vis3_instructions;
|
|||||||
#define TCG_TARGET_HAS_muluh_i32 0
|
#define TCG_TARGET_HAS_muluh_i32 0
|
||||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||||
|
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 1
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 1
|
||||||
#define TCG_TARGET_HAS_div_i64 1
|
#define TCG_TARGET_HAS_div_i64 1
|
||||||
#define TCG_TARGET_HAS_rem_i64 0
|
#define TCG_TARGET_HAS_rem_i64 0
|
||||||
#define TCG_TARGET_HAS_rot_i64 0
|
#define TCG_TARGET_HAS_rot_i64 0
|
||||||
|
@ -1751,8 +1751,8 @@ void tcg_gen_trunc_shr_i64_i32(TCGv_i32 ret, TCGv_i64 arg, unsigned count)
|
|||||||
tcg_gen_mov_i32(ret, TCGV_LOW(t));
|
tcg_gen_mov_i32(ret, TCGV_LOW(t));
|
||||||
tcg_temp_free_i64(t);
|
tcg_temp_free_i64(t);
|
||||||
}
|
}
|
||||||
} else if (TCG_TARGET_HAS_trunc_shr_i32) {
|
} else if (TCG_TARGET_HAS_trunc_shr_i64_i32) {
|
||||||
tcg_gen_op3i_i32(INDEX_op_trunc_shr_i32, ret,
|
tcg_gen_op3i_i32(INDEX_op_trunc_shr_i64_i32, ret,
|
||||||
MAKE_TCGV_I32(GET_TCGV_I64(arg)), count);
|
MAKE_TCGV_I32(GET_TCGV_I64(arg)), count);
|
||||||
} else if (count == 0) {
|
} else if (count == 0) {
|
||||||
tcg_gen_mov_i32(ret, MAKE_TCGV_I32(GET_TCGV_I64(arg)));
|
tcg_gen_mov_i32(ret, MAKE_TCGV_I32(GET_TCGV_I64(arg)));
|
||||||
|
@ -138,8 +138,8 @@ DEF(rotl_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_rot_i64))
|
|||||||
DEF(rotr_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_rot_i64))
|
DEF(rotr_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_rot_i64))
|
||||||
DEF(deposit_i64, 1, 2, 2, IMPL64 | IMPL(TCG_TARGET_HAS_deposit_i64))
|
DEF(deposit_i64, 1, 2, 2, IMPL64 | IMPL(TCG_TARGET_HAS_deposit_i64))
|
||||||
|
|
||||||
DEF(trunc_shr_i32, 1, 1, 1,
|
DEF(trunc_shr_i64_i32, 1, 1, 1,
|
||||||
IMPL(TCG_TARGET_HAS_trunc_shr_i32)
|
IMPL(TCG_TARGET_HAS_trunc_shr_i64_i32)
|
||||||
| (TCG_TARGET_REG_BITS == 32 ? TCG_OPF_NOT_PRESENT : 0))
|
| (TCG_TARGET_REG_BITS == 32 ? TCG_OPF_NOT_PRESENT : 0))
|
||||||
|
|
||||||
DEF(brcond_i64, 0, 2, 2, TCG_OPF_BB_END | IMPL64)
|
DEF(brcond_i64, 0, 2, 2, TCG_OPF_BB_END | IMPL64)
|
||||||
|
@ -66,7 +66,7 @@ typedef uint64_t TCGRegSet;
|
|||||||
|
|
||||||
#if TCG_TARGET_REG_BITS == 32
|
#if TCG_TARGET_REG_BITS == 32
|
||||||
/* Turn some undef macros into false macros. */
|
/* Turn some undef macros into false macros. */
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 0
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 0
|
||||||
#define TCG_TARGET_HAS_div_i64 0
|
#define TCG_TARGET_HAS_div_i64 0
|
||||||
#define TCG_TARGET_HAS_rem_i64 0
|
#define TCG_TARGET_HAS_rem_i64 0
|
||||||
#define TCG_TARGET_HAS_div2_i64 0
|
#define TCG_TARGET_HAS_div2_i64 0
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||||
|
|
||||||
#if TCG_TARGET_REG_BITS == 64
|
#if TCG_TARGET_REG_BITS == 64
|
||||||
#define TCG_TARGET_HAS_trunc_shr_i32 0
|
#define TCG_TARGET_HAS_trunc_shr_i64_i32 0
|
||||||
#define TCG_TARGET_HAS_bswap16_i64 1
|
#define TCG_TARGET_HAS_bswap16_i64 1
|
||||||
#define TCG_TARGET_HAS_bswap32_i64 1
|
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||||
|
Loading…
Reference in New Issue
Block a user