mirror of https://github.com/xemu-project/xemu.git
target-sh4: optimize swap.w
It's possible swap the two 16-bit words of a 32-bit register using a rotation. If the TCG target doesn't implement rotation, the replacement code is similar to the previously implemented code. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
f16640f47b
commit
c53b36d210
|
@ -732,17 +732,7 @@ static void _decode_opc(DisasContext * ctx)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case 0x6009: /* swap.w Rm,Rn */
|
case 0x6009: /* swap.w Rm,Rn */
|
||||||
{
|
tcg_gen_rotli_i32(REG(B11_8), REG(B7_4), 16);
|
||||||
TCGv high, low;
|
|
||||||
high = tcg_temp_new();
|
|
||||||
tcg_gen_shli_i32(high, REG(B7_4), 16);
|
|
||||||
low = tcg_temp_new();
|
|
||||||
tcg_gen_shri_i32(low, REG(B7_4), 16);
|
|
||||||
tcg_gen_ext16u_i32(low, low);
|
|
||||||
tcg_gen_or_i32(REG(B11_8), high, low);
|
|
||||||
tcg_temp_free(low);
|
|
||||||
tcg_temp_free(high);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
case 0x200d: /* xtrct Rm,Rn */
|
case 0x200d: /* xtrct Rm,Rn */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue