[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/7] target/arm: Use tcg_gen_extract_i32 for shifter
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 1/7] target/arm: Use tcg_gen_extract_i32 for shifter_out_im |
Date: |
Thu, 8 Aug 2019 13:26:10 -0700 |
Extract is a compact combination of shift + and.
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/translate.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 846052acea..43e005d191 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -620,14 +620,7 @@ static void gen_sar(TCGv_i32 dest, TCGv_i32 t0, TCGv_i32
t1)
static void shifter_out_im(TCGv_i32 var, int shift)
{
- if (shift == 0) {
- tcg_gen_andi_i32(cpu_CF, var, 1);
- } else {
- tcg_gen_shri_i32(cpu_CF, var, shift);
- if (shift != 31) {
- tcg_gen_andi_i32(cpu_CF, cpu_CF, 1);
- }
- }
+ tcg_gen_extract_i32(cpu_CF, var, shift, 1);
}
/* Shift by immediate. Includes special handling for shift == 0. */
--
2.17.1
- [Qemu-devel] [PATCH 0/7] target/arm: Misc cleanups, Richard Henderson, 2019/08/08
- [Qemu-devel] [PATCH 1/7] target/arm: Use tcg_gen_extract_i32 for shifter_out_im,
Richard Henderson <=
- [Qemu-devel] [PATCH 3/7] target/arm: Remove redundant shift tests, Richard Henderson, 2019/08/08
- [Qemu-devel] [PATCH 2/7] target/arm: Use tcg_gen_deposit_i32 for PKHBT, PKHTB, Richard Henderson, 2019/08/08
- [Qemu-devel] [PATCH 4/7] target/arm: Use ror32 instead of open-coding the operation, Richard Henderson, 2019/08/08
- [Qemu-devel] [PATCH 5/7] target/arm: Use tcg_gen_rotri_i32 for gen_swap_half, Richard Henderson, 2019/08/08
- [Qemu-devel] [PATCH 6/7] target/arm: Simplify SMMLA, SMMLAR, SMMLS, SMMLSR, Richard Henderson, 2019/08/08
- [Qemu-devel] [PATCH 7/7] target/arm: Use tcg_gen_extrh_i64_i32 to extract the high word, Richard Henderson, 2019/08/08