[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 2/6] target-ppc: Optimize rlwinm MB=0 ME=31
From: |
Tom Musta |
Subject: |
[Qemu-ppc] [PATCH 2/6] target-ppc: Optimize rlwinm MB=0 ME=31 |
Date: |
Mon, 25 Aug 2014 14:25:40 -0500 |
Optimize the special case of rlwinm where MB=0 and ME=31. This can
be implemented as a 32-bit ROTL.
Signed-off-by: Tom Musta <address@hidden>
Suggested-by: Richard Henderson <address@hidden>
---
target-ppc/translate.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 095b83c..889e37d 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -1691,6 +1691,12 @@ static void gen_rlwinm(DisasContext *ctx)
tcg_gen_shri_tl(t0, t0, mb);
tcg_gen_ext32u_tl(cpu_gpr[rA(ctx->opcode)], t0);
tcg_temp_free(t0);
+ } else if (likely(mb == 0 && me == 31)) {
+ TCGv_i32 t0 = tcg_temp_new_i32();
+ tcg_gen_trunc_tl_i32(t0, cpu_gpr[rS(ctx->opcode)]);
+ tcg_gen_rotli_i32(t0, t0, sh);
+ tcg_gen_extu_i32_tl(cpu_gpr[rA(ctx->opcode)], t0);
+ tcg_temp_free_i32(t0);
} else {
TCGv t0 = tcg_temp_new();
#if defined(TARGET_PPC64)
--
1.7.1
- [Qemu-ppc] [PATCH 0/6] target-ppc: More Cleanup of FXU Instructions, Tom Musta, 2014/08/25
- [Qemu-ppc] [PATCH 2/6] target-ppc: Optimize rlwinm MB=0 ME=31,
Tom Musta <=
- [Qemu-ppc] [PATCH 1/6] target-ppc: Special Case of rlwimi Should Use Deposit, Tom Musta, 2014/08/25
- [Qemu-ppc] [PATCH 3/6] target-ppc: Optimize rlwnm MB=0 ME=31, Tom Musta, 2014/08/25
- [Qemu-ppc] [PATCH 4/6] target-ppc: Clean Up mullw, Tom Musta, 2014/08/25
- [Qemu-ppc] [PATCH 5/6] target-ppc: Clean up mullwo, Tom Musta, 2014/08/25
- [Qemu-ppc] [PATCH 6/6] target-ppc: Implement mulldo with TCG, Tom Musta, 2014/08/25
- Re: [Qemu-ppc] [PATCH 0/6] target-ppc: More Cleanup of FXU Instructions, Richard Henderson, 2014/08/25