From: malc <av1474@comtv.ru>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5404] Optimize 64 bit bswap
Date: Thu, 02 Oct 2008 20:02:32 +0000 [thread overview]
Message-ID: <E1KlUNc-0003Ye-C0@cvs.savannah.gnu.org> (raw)
Revision: 5404
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5404
Author: malc
Date: 2008-10-02 20:02:31 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
Optimize 64 bit bswap
Use rldimi instead of rldicr/or pair, saves us one instruction.
Suggested by Hollis Blanchard.
Modified Paths:
--------------
trunk/tcg/ppc64/tcg-target.c
Modified: trunk/tcg/ppc64/tcg-target.c
===================================================================
--- trunk/tcg/ppc64/tcg-target.c 2008-10-02 20:02:27 UTC (rev 5403)
+++ trunk/tcg/ppc64/tcg-target.c 2008-10-02 20:02:31 UTC (rev 5404)
@@ -303,6 +303,7 @@
#define RLDICL XO30( 0)
#define RLDICR XO30( 1)
+#define RLDIMI XO30( 3)
#define BCLR XO19( 16)
#define BCCTR XO19(528)
@@ -691,11 +692,10 @@
break;
case 3:
if (bswap) {
- tcg_out32 (s, LWBRX | RT (0) | RB (r0));
- tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4);
- tcg_out32 (s, LWBRX | RT (data_reg) | RB (r1));
- tcg_out_rld (s, RLDICR, data_reg, data_reg, 32, 31);
- tcg_out32 (s, OR | SAB (0, data_reg, data_reg));
+ tcg_out_movi32 (s, 0, 4);
+ tcg_out32 (s, LWBRX | RT (data_reg) | RB (r0));
+ tcg_out32 (s, LWBRX | RT ( r1) | RA (r0));
+ tcg_out_rld (s, RLDIMI, data_reg, r1, 32, 0);
}
else tcg_out32 (s, LD | RT (data_reg) | RA (r0));
break;
reply other threads:[~2008-10-02 20:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1KlUNc-0003Ye-C0@cvs.savannah.gnu.org \
--to=av1474@comtv.ru \
--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).