mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
tcg: Split out tcg_out_ext16s
We will need a backend interface for performing 16-bit sign-extend. Use it in tcg_reg_alloc_op in the meantime. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
d0e66c897f
commit
753e42eada
11 changed files with 79 additions and 52 deletions
|
@ -1424,6 +1424,11 @@ static void tcg_out_ext8s(TCGContext *s, TCGType type, TCGReg rd, TCGReg rn)
|
|||
tcg_out_sxt(s, type, MO_8, rd, rn);
|
||||
}
|
||||
|
||||
static void tcg_out_ext16s(TCGContext *s, TCGType type, TCGReg rd, TCGReg rn)
|
||||
{
|
||||
tcg_out_sxt(s, type, MO_16, rd, rn);
|
||||
}
|
||||
|
||||
static inline void tcg_out_uxt(TCGContext *s, MemOp s_bits,
|
||||
TCGReg rd, TCGReg rn)
|
||||
{
|
||||
|
@ -2233,17 +2238,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
|||
tcg_out_rev(s, TCG_TYPE_I32, MO_16, a0, a1);
|
||||
if (a2 & TCG_BSWAP_OS) {
|
||||
/* Output must be sign-extended. */
|
||||
tcg_out_sxt(s, ext, MO_16, a0, a0);
|
||||
tcg_out_ext16s(s, ext, a0, a0);
|
||||
} else if ((a2 & (TCG_BSWAP_IZ | TCG_BSWAP_OZ)) == TCG_BSWAP_OZ) {
|
||||
/* Output must be zero-extended, but input isn't. */
|
||||
tcg_out_uxt(s, MO_16, a0, a0);
|
||||
}
|
||||
break;
|
||||
|
||||
case INDEX_op_ext16s_i64:
|
||||
case INDEX_op_ext16s_i32:
|
||||
tcg_out_sxt(s, ext, MO_16, a0, a1);
|
||||
break;
|
||||
case INDEX_op_ext_i32_i64:
|
||||
case INDEX_op_ext32s_i64:
|
||||
tcg_out_sxt(s, TCG_TYPE_I64, MO_32, a0, a1);
|
||||
|
@ -2316,6 +2317,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
|||
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:
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue