mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-05-05 05:42:21 +00:00
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:
parent
ad63ee7509
commit
25ccd28e78
|
@ -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)
|
static void shifter_out_im(DisasContext *s, TCGv_i32 var, int shift)
|
||||||
{
|
{
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
if (shift == 0) {
|
tcg_gen_extract_i32(tcg_ctx, tcg_ctx->cpu_CF, var, shift, 1);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shift by immediate. Includes special handling for shift == 0. */
|
/* Shift by immediate. Includes special handling for shift == 0. */
|
||||||
|
|
Loading…
Reference in a new issue