mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 06:21:52 -06:00
target/arm: Use tcg_gen_ext_i64
The ext_and_shift_reg helper does this plus a shift. The non-zero check for shift count is duplicate to the one done within tcg_gen_shli_i64. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
c048b68385
commit
2f02c14b21
1 changed files with 2 additions and 35 deletions
|
@ -1324,42 +1324,9 @@ static void ext_and_shift_reg(TCGv_i64 tcg_out, TCGv_i64 tcg_in,
|
||||||
int extsize = extract32(option, 0, 2);
|
int extsize = extract32(option, 0, 2);
|
||||||
bool is_signed = extract32(option, 2, 1);
|
bool is_signed = extract32(option, 2, 1);
|
||||||
|
|
||||||
if (is_signed) {
|
tcg_gen_ext_i64(tcg_out, tcg_in, extsize | (is_signed ? MO_SIGN : 0));
|
||||||
switch (extsize) {
|
|
||||||
case 0:
|
|
||||||
tcg_gen_ext8s_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
tcg_gen_ext16s_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
tcg_gen_ext32s_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
tcg_gen_mov_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch (extsize) {
|
|
||||||
case 0:
|
|
||||||
tcg_gen_ext8u_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
tcg_gen_ext16u_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
tcg_gen_ext32u_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
tcg_gen_mov_i64(tcg_out, tcg_in);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shift) {
|
|
||||||
tcg_gen_shli_i64(tcg_out, tcg_out, shift);
|
tcg_gen_shli_i64(tcg_out, tcg_out, shift);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static inline void gen_check_sp_alignment(DisasContext *s)
|
static inline void gen_check_sp_alignment(DisasContext *s)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue