From: malc <av1474@comtv.ru>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5287] Avoid clobbering input register in qemu_ld64+bswap+useronly case
Date: Mon, 22 Sep 2008 01:08:09 +0000 [thread overview]
Message-ID: <E1KhZuL-0001cU-AU@cvs.savannah.gnu.org> (raw)
Revision: 5287
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5287
Author: malc
Date: 2008-09-22 01:08:08 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
Avoid clobbering input register in qemu_ld64+bswap+useronly case
Modified Paths:
--------------
trunk/tcg/ppc/tcg-target.c
Modified: trunk/tcg/ppc/tcg-target.c
===================================================================
--- trunk/tcg/ppc/tcg-target.c 2008-09-22 00:52:42 UTC (rev 5286)
+++ trunk/tcg/ppc/tcg-target.c 2008-09-22 01:08:08 UTC (rev 5287)
@@ -474,9 +474,9 @@
static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
{
- int addr_reg, data_reg, data_reg2, r0, mem_index, s_bits, bswap;
+ int addr_reg, data_reg, data_reg2, r0, r1, mem_index, s_bits, bswap;
#ifdef CONFIG_SOFTMMU
- int r1, r2;
+ int r2;
void *label1_ptr, *label2_ptr;
#endif
#if TARGET_LONG_BITS == 64
@@ -599,6 +599,7 @@
#else /* !CONFIG_SOFTMMU */
r0 = addr_reg;
+ r1 = 3;
#endif
#ifdef TARGET_WORDS_BIGENDIAN
@@ -632,17 +633,9 @@
break;
case 3:
if (bswap) {
- if (r0 == data_reg) {
- tcg_out32 (s, LWBRX | RT (0) | RB (r0));
- tcg_out32 (s, ADDI | RT (r0) | RA (r0) | 4);
- tcg_out32 (s, LWBRX | RT (data_reg2) | RB (r0));
- tcg_out_mov (s, data_reg, 0);
- }
- else {
- tcg_out32 (s, LWBRX | RT (data_reg) | RB (r0));
- tcg_out32 (s, ADDI | RT (r0) | RA (r0) | 4);
- tcg_out32 (s, LWBRX | RT (data_reg2) | RB (r0));
- }
+ tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4);
+ tcg_out32 (s, LWBRX | RT (data_reg) | RB (r0));
+ tcg_out32 (s, LWBRX | RT (data_reg2) | RB (r1));
}
else {
if (r0 == data_reg2) {
reply other threads:[~2008-09-22 1:08 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=E1KhZuL-0001cU-AU@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).