mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
target-arm: fix bug in translation of REVSH
The translation of REVSH shifted the low byte 8 steps left before performing an 8-bit sign extend, causing this part of the expression to alwas be 0. Reported-by: Johan Bengtsson <teofrastius@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
5697f6ae41
commit
1a855029af
1 changed files with 3 additions and 7 deletions
|
@ -250,13 +250,9 @@ static void gen_rev16(TCGv var)
|
||||||
/* Byteswap low halfword and sign extend. */
|
/* Byteswap low halfword and sign extend. */
|
||||||
static void gen_revsh(TCGv var)
|
static void gen_revsh(TCGv var)
|
||||||
{
|
{
|
||||||
TCGv tmp = new_tmp();
|
tcg_gen_ext16u_i32(var, var);
|
||||||
tcg_gen_shri_i32(tmp, var, 8);
|
tcg_gen_bswap16_i32(var, var);
|
||||||
tcg_gen_andi_i32(tmp, tmp, 0x00ff);
|
tcg_gen_ext16s_i32(var, var);
|
||||||
tcg_gen_shli_i32(var, var, 8);
|
|
||||||
tcg_gen_ext8s_i32(var, var);
|
|
||||||
tcg_gen_or_i32(var, var, tmp);
|
|
||||||
dead_tmp(tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unsigned bitfield extract. */
|
/* Unsigned bitfield extract. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue