[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/7] target-ppc: Use deposit operation.
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 7/7] target-ppc: Use deposit operation. |
Date: |
Fri, 7 Jan 2011 14:43:03 -0800 |
Use this in implementing rl[wd]imi, at least for the cases
that don't require true rotation.
Signed-off-by: Richard Henderson <address@hidden>
---
target-ppc/translate.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 74e06d7..f45c0ec 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -1516,6 +1516,11 @@ static void gen_rlwimi(DisasContext *ctx)
sh = SH(ctx->opcode);
if (likely(sh == 0 && mb == 0 && me == 31)) {
tcg_gen_ext32u_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]);
+ } else if ((31 - me) == sh && mb <= me) {
+ /* This is a well-behaved bitfield deposit. */
+ tcg_gen_deposit_tl (cpu_gpr[rA(ctx->opcode)],
+ cpu_gpr[rA(ctx->opcode)],
+ cpu_gpr[rS(ctx->opcode)], sh, me - mb + 1);
} else {
target_ulong mask;
TCGv t1;
@@ -1761,6 +1766,11 @@ static inline void gen_rldimi(DisasContext *ctx, int
mbn, int shn)
me = 63 - sh;
if (unlikely(sh == 0 && mb == 0)) {
tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]);
+ } else if (mb <= me) {
+ /* This is a well-behaved bitfield deposit. */
+ tcg_gen_deposit_tl (cpu_gpr[rA(ctx->opcode)],
+ cpu_gpr[rA(ctx->opcode)],
+ cpu_gpr[rS(ctx->opcode)], sh, me - mb + 1);
} else {
TCGv t0, t1;
target_ulong mask;
--
1.7.2.3
- [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation, Richard Henderson, 2011/01/07
- [Qemu-devel] [PATCH 6/7] target-i386: Use deposit operation., Richard Henderson, 2011/01/07
- [Qemu-devel] [PATCH 3/7] tcg-hppa: Implement deposit operation., Richard Henderson, 2011/01/07
- [Qemu-devel] [PATCH 7/7] target-ppc: Use deposit operation.,
Richard Henderson <=
- [Qemu-devel] [PATCH 4/7] tcg-ia64: Implement deposit operation., Richard Henderson, 2011/01/07
- [Qemu-devel] [PATCH 5/7] tcg-i386: Implement deposit operation., Richard Henderson, 2011/01/07
- Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation., Aurelien Jarno, 2011/01/10
- Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation., Richard Henderson, 2011/01/10