qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5020] Fix 64 bit constant generation
Date: Sun, 17 Aug 2008 20:14:17 +0000	[thread overview]
Message-ID: <E1KUodl-0003S1-Dj@cvs.savannah.gnu.org> (raw)

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

Log Message:
-----------
Fix 64 bit constant generation

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

Modified: trunk/tcg/sparc/tcg-target.c
===================================================================
--- trunk/tcg/sparc/tcg-target.c	2008-08-17 16:13:02 UTC (rev 5019)
+++ trunk/tcg/sparc/tcg-target.c	2008-08-17 20:14:16 UTC (rev 5020)
@@ -268,8 +268,8 @@
               INSN_RS2(rs2));
 }
 
-static inline void tcg_out_arithi(TCGContext *s, int rd, int rs1, int offset,
-                                  int op)
+static inline void tcg_out_arithi(TCGContext *s, int rd, int rs1,
+                                  uint32_t offset, int op)
 {
     tcg_out32(s, op | INSN_RD(rd) | INSN_RS1(rs1) |
               INSN_IMM13(offset));
@@ -292,7 +292,7 @@
 
 static inline void tcg_out_movi_imm32(TCGContext *s, int ret, uint32_t arg)
 {
-    if (check_fit_i32(arg, 12))
+    if (check_fit_tl(arg, 12))
         tcg_out_movi_imm13(s, ret, arg);
     else {
         tcg_out_sethi(s, ret, arg);
@@ -310,9 +310,16 @@
         tcg_out_arithi(s, TCG_REG_I4, TCG_REG_I4, 32, SHIFT_SLLX);
         tcg_out_movi_imm32(s, ret, arg);
         tcg_out_arith(s, ret, ret, TCG_REG_I4, ARITH_OR);
-    } else
+    } else if (check_fit_tl(arg, 12))
+        tcg_out_movi_imm13(s, ret, arg);
+    else {
+        tcg_out_sethi(s, ret, arg);
+        if (arg & 0x3ff)
+            tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR);
+    }
+#else
+    tcg_out_movi_imm32(s, ret, arg);
 #endif
-        tcg_out_movi_imm32(s, ret, arg);
 }
 
 static inline void tcg_out_ld_raw(TCGContext *s, int ret,

                 reply	other threads:[~2008-08-17 20:14 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=E1KUodl-0003S1-Dj@cvs.savannah.gnu.org \
    --to=blauwirbel@gmail.com \
    --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).