From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: Alexander Graf <agraf@suse.de>, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 7/7] target-ppc: Use deposit operation.
Date: Fri, 7 Jan 2011 14:43:03 -0800 [thread overview]
Message-ID: <1294440183-885-8-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1294440183-885-1-git-send-email-rth@twiddle.net>
Use this in implementing rl[wd]imi, at least for the cases
that don't require true rotation.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
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
next prev parent reply other threads:[~2011-01-07 22:44 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 22:42 [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation Richard Henderson
2011-01-07 22:42 ` [Qemu-devel] [PATCH 1/7] tcg: Define "deposit" as an optional operation Richard Henderson
2011-01-07 23:48 ` Stuart Brady
2011-01-09 21:38 ` Aurelien Jarno
2011-01-09 22:45 ` Richard Henderson
2011-01-07 22:42 ` [Qemu-devel] [PATCH 2/7] tcg-ppc: Implement deposit operation Richard Henderson
2011-01-07 23:33 ` [Qemu-devel] " malc
2011-01-07 22:42 ` [Qemu-devel] [PATCH 3/7] tcg-hppa: " Richard Henderson
2011-01-07 23:35 ` Stuart Brady
2011-01-07 23:41 ` Richard Henderson
2011-01-07 22:43 ` [Qemu-devel] [PATCH 4/7] tcg-ia64: " Richard Henderson
2011-01-09 22:04 ` [Qemu-devel] " Aurelien Jarno
2011-01-07 22:43 ` [Qemu-devel] [PATCH 5/7] tcg-i386: " Richard Henderson
2011-01-09 21:53 ` [Qemu-devel] " Aurelien Jarno
2011-01-09 22:55 ` Richard Henderson
2011-01-10 0:16 ` Aurelien Jarno
2011-01-10 0:43 ` Richard Henderson
2011-01-10 16:52 ` Aurelien Jarno
2011-01-10 18:37 ` Aurelien Jarno
2011-01-10 19:19 ` Richard Henderson
2011-01-07 22:43 ` [Qemu-devel] [PATCH 6/7] target-i386: Use " Richard Henderson
2011-01-07 22:43 ` Richard Henderson [this message]
2011-01-07 23:10 ` [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation Peter Maydell
2011-01-07 23:37 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2011-01-11 3:23 [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation, v2 Richard Henderson
2011-01-11 3:23 ` [Qemu-devel] [PATCH 7/7] target-ppc: Use deposit operation Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294440183-885-8-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).