qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix qemu_ld64 on arm
@ 2009-02-24  8:03 Pablo Virolainen
  2009-02-24  8:27 ` Laurent Desnogues
  2009-03-10 21:44 ` Aurelien Jarno
  0 siblings, 2 replies; 5+ messages in thread
From: Pablo Virolainen @ 2009-02-24  8:03 UTC (permalink / raw)
  To: qemu-devel


Emulating fldl on arm doesn't seem to work too well. It's the way 
qemu_ld64 is translated to arm instructions.

         tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
         tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);


Consider case where data_reg==0, data_reg2==1, and addr_reg==0. First 
load overwrited addr_reg. So let's put an if (data_ref==addr_reg).

Index: tcg-target.c
===================================================================
--- tcg-target.c        (revision 6642)
+++ tcg-target.c        (working copy)
@@ -1011,8 +1011,14 @@
      case 3:
          /* TODO: use block load -
           * check that data_reg2 > data_reg or the other way */
-        tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
-        tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
+
+        if (data_reg==addr_reg) {
+            tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
+            tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
+        } else {
+            tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
+            tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
+        }
          break;
      }
  #endif

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-10 21:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24  8:03 [Qemu-devel] [PATCH] Fix qemu_ld64 on arm Pablo Virolainen
2009-02-24  8:27 ` Laurent Desnogues
2009-02-24  8:44   ` Pablo Virolainen
2009-02-24  8:57     ` Laurent Desnogues
2009-03-10 21:44 ` Aurelien Jarno

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