[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/14] target/sh4: optimize gen_write_sr using ex
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH v2 10/14] target/sh4: optimize gen_write_sr using extract op |
Date: |
Sat, 6 May 2017 13:14:27 +0200 |
This doesn't change the generated code on x86, but optimizes it on most
RISC architectures and makes the code simpler to read.
Signed-off-by: Aurelien Jarno <address@hidden>
---
target/sh4/translate.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index b4e5606098..8c766eed2a 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -204,12 +204,9 @@ static void gen_write_sr(TCGv src)
{
tcg_gen_andi_i32(cpu_sr, src,
~((1u << SR_Q) | (1u << SR_M) | (1u << SR_T)));
- tcg_gen_shri_i32(cpu_sr_q, src, SR_Q);
- tcg_gen_andi_i32(cpu_sr_q, cpu_sr_q, 1);
- tcg_gen_shri_i32(cpu_sr_m, src, SR_M);
- tcg_gen_andi_i32(cpu_sr_m, cpu_sr_m, 1);
- tcg_gen_shri_i32(cpu_sr_t, src, SR_T);
- tcg_gen_andi_i32(cpu_sr_t, cpu_sr_t, 1);
+ tcg_gen_extract_i32(cpu_sr_q, src, SR_Q, 1);
+ tcg_gen_extract_i32(cpu_sr_m, src, SR_M, 1);
+ tcg_gen_extract_i32(cpu_sr_t, src, SR_T, 1);
}
static inline void gen_save_cpu_state(DisasContext *ctx, bool save_pc)
--
2.11.0
- Re: [Qemu-devel] [PATCH v2 06/14] target/sh4: fix BS_EXCP exit, (continued)
- [Qemu-devel] [PATCH v2 03/14] target/sh4: do not include DELAY_SLOT_TRUE in the TB state, Aurelien Jarno, 2017/05/06
- [Qemu-devel] [PATCH v2 09/14] target/sh4: optimize gen_store_fpr64, Aurelien Jarno, 2017/05/06
- [Qemu-devel] [PATCH v2 02/14] target/sh4: get rid of DELAY_SLOT_CLEARME, Aurelien Jarno, 2017/05/06
- [Qemu-devel] [PATCH v2 08/14] target/sh4: fold ctx->bstate = BS_BRANCH into gen_conditional_jump, Aurelien Jarno, 2017/05/06
- [Qemu-devel] [PATCH v2 10/14] target/sh4: optimize gen_write_sr using extract op,
Aurelien Jarno <=
- [Qemu-devel] [PATCH v2 12/14] target/sh4: implement tas.b using atomic helper, Aurelien Jarno, 2017/05/06
- [Qemu-devel] [PATCH v2 13/14] target/sh4: movua.l is an SH4-A only instruction, Aurelien Jarno, 2017/05/06
- [Qemu-devel] [PATCH v2 07/14] target/sh4: only save flags state at the end of the TB, Aurelien Jarno, 2017/05/06
- [Qemu-devel] [PATCH v2 04/14] target/sh4: move DELAY_SLOT_TRUE flag into a separate global, Aurelien Jarno, 2017/05/06