target/arm: Use tcg_gen_extract_i32 for shifter_out_im

Extract is a compact combination of shift + and.

Backports commit 191f4bfe8d6cf0c7d5cd7f84cd7076e32e3745dd from qemu
This commit is contained in:
Richard Henderson 2019-11-18 20:19:30 -05:00 committed by Lioncash
parent ad63ee7509
commit 25ccd28e78
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -631,14 +631,7 @@ static void gen_sar(DisasContext *s, TCGv_i32 dest, TCGv_i32 t0, TCGv_i32 t1)
static void shifter_out_im(DisasContext *s, TCGv_i32 var, int shift)
{
TCGContext *tcg_ctx = s->uc->tcg_ctx;
if (shift == 0) {
tcg_gen_andi_i32(tcg_ctx, tcg_ctx->cpu_CF, var, 1);
} else {
tcg_gen_shri_i32(tcg_ctx, tcg_ctx->cpu_CF, var, shift);
if (shift != 31) {
tcg_gen_andi_i32(tcg_ctx, tcg_ctx->cpu_CF, tcg_ctx->cpu_CF, 1);
}
}
tcg_gen_extract_i32(tcg_ctx, tcg_ctx->cpu_CF, var, shift, 1);
}
/* Shift by immediate. Includes special handling for shift == 0. */