Backport optimizations to AArch32's REV16 handling

Backports commit 68cedf733ae32363ccf54f0b52c8a424d5ec98ed from qemu
This commit is contained in:
Lioncash 2018-02-04 14:51:46 -05:00
parent 4a8a92bad2
commit 5a37b8c28e
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -248,11 +248,13 @@ static void gen_rev16(DisasContext *s, TCGv_i32 var)
{
TCGContext *tcg_ctx = s->uc->tcg_ctx;
TCGv_i32 tmp = tcg_temp_new_i32(tcg_ctx);
TCGv_i32 mask = tcg_const_i32(tcg_ctx, 0x00ff00ff);
tcg_gen_shri_i32(tcg_ctx, tmp, var, 8);
tcg_gen_andi_i32(tcg_ctx, tmp, tmp, 0x00ff00ff);
tcg_gen_and_i32(tcg_ctx, tmp, tmp, mask);
tcg_gen_and_i32(tcg_ctx, var, var, mask);
tcg_gen_shli_i32(tcg_ctx, var, var, 8);
tcg_gen_andi_i32(tcg_ctx, var, var, 0xff00ff00);
tcg_gen_or_i32(tcg_ctx, var, var, tmp);
tcg_temp_free_i32(tcg_ctx, mask);
tcg_temp_free_i32(tcg_ctx, tmp);
}