qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5019] Fix 32 bit address overflow
@ 2008-08-17 16:13 Blue Swirl
  0 siblings, 0 replies; only message in thread
From: Blue Swirl @ 2008-08-17 16:13 UTC (permalink / raw)
  To: qemu-devel

Revision: 5019
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5019
Author:   blueswir1
Date:     2008-08-17 16:13:02 +0000 (Sun, 17 Aug 2008)

Log Message:
-----------
Fix 32 bit address overflow

Modified Paths:
--------------
    trunk/tcg/sparc/tcg-target.c

Modified: trunk/tcg/sparc/tcg-target.c
===================================================================
--- trunk/tcg/sparc/tcg-target.c	2008-08-17 14:34:27 UTC (rev 5018)
+++ trunk/tcg/sparc/tcg-target.c	2008-08-17 16:13:02 UTC (rev 5019)
@@ -625,8 +625,18 @@
     /* ld [arg1 + x], arg1 */
     tcg_out_ldst(s, arg1, arg1, offsetof(CPUTLBEntry, addend) -
                  offsetof(CPUTLBEntry, addr_read), HOST_LD_OP);
+
+#if TARGET_LONG_BITS == 32
+    /* and addr_reg, x, arg0 */
+    tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_I5, 0xffffffff);
+    tcg_out_arith(s, arg0, addr_reg, TCG_REG_I5, ARITH_AND);
+    /* add arg0, arg1, arg0 */
+    tcg_out_arith(s, arg0, arg0, arg1, ARITH_ADD);
+#else
     /* add addr_reg, arg1, arg0 */
     tcg_out_arith(s, arg0, addr_reg, arg1, ARITH_ADD);
+#endif
+
 #else
     arg0 = addr_reg;
 #endif
@@ -785,8 +795,17 @@
     tcg_out_ldst(s, arg1, arg1, offsetof(CPUTLBEntry, addend) -
                  offsetof(CPUTLBEntry, addr_write), HOST_LD_OP);
 
+#if TARGET_LONG_BITS == 32
+    /* and addr_reg, x, arg0 */
+    tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_I5, 0xffffffff);
+    tcg_out_arith(s, arg0, addr_reg, TCG_REG_I5, ARITH_AND);
+    /* add arg0, arg1, arg0 */
+    tcg_out_arith(s, arg0, arg0, arg1, ARITH_ADD);
+#else
     /* add addr_reg, arg1, arg0 */
     tcg_out_arith(s, arg0, addr_reg, arg1, ARITH_ADD);
+#endif
+
 #else
     arg0 = addr_reg;
 #endif

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-17 16:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-17 16:13 [Qemu-devel] [5019] Fix 32 bit address overflow Blue Swirl

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).