2007-11-03 David S. Miller <davem@davemloft.net>
authorZoltan Varga <vargaz@gmail.com>
Sat, 10 Nov 2007 15:22:00 +0000 (15:22 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 10 Nov 2007 15:22:00 +0000 (15:22 -0000)
       * sparc/sparc-codegen.h (sparc_set32, sparc_set): A plain sethi
       can be used if the constant value only has the top 22 bits set.

svn path=/trunk/mono/; revision=89409

mono/arch/ChangeLog
mono/arch/sparc/sparc-codegen.h

index a066cc72305500ddf7c9ab8bf156502b805de792..b4a3ffedb493f3d222b3450b2fb4d682ccedb860 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-03  David S. Miller  <davem@davemloft.net>
+
+       * sparc/sparc-codegen.h (sparc_set32, sparc_set): A plain sethi
+       can be used if the constant value only has the top 22 bits set.
+
 2007-11-01  Geoff Norton  <gnorton@novell.com>
 
        * x86/Makefile.am:  Only compile tramp.c if INTERP_SUPPORTED is true
index c04f5ced951d40a6cac98070be2e645455bbe92e..eb421bbcf9a6fc0290d150b58811e9696d1b8209 100644 (file)
@@ -855,7 +855,7 @@ typedef struct {
        do {    \
         if ((val) == 0) \
             sparc_clr_reg((ins),(reg)); \
-               else if (((guint32)(val) & 0x1fff) == 0)        \
+               else if (((guint32)(val) & 0x3ff) == 0) \
                        sparc_sethi((ins),(guint32)(val),(reg));        \
                else if (((gint32)(val) >= -4096) && ((gint32)(val) <= 4095))   \
                        sparc_or_imm((ins),FALSE,sparc_g0,(gint32)(val),(reg)); \
@@ -883,7 +883,8 @@ typedef struct {
                else if ((val >= -4096) && ((val) <= 4095))     \
                        sparc_or_imm((ins),FALSE,sparc_g0,bottom_word,(reg));   \
         else if ((val >= 0) && (val <= 4294967295L)) {   \
-                       sparc_sethi((ins),bottom_word,(reg));   \
+               sparc_sethi((ins),bottom_word,(reg));   \
+               if (bottom_word & 0x3ff) \
                        sparc_or_imm((ins),FALSE,(reg),bottom_word&0x3ff,(reg));        \
         } \
         else if ((val >= 0) && (val <= (1L << 44) - 1)) {  \
@@ -913,7 +914,7 @@ typedef struct {
        do {    \
         if ((val) == 0) \
             sparc_clr_reg((ins),(reg)); \
-               else if (((guint32)(val) & 0x1fff) == 0)        \
+               else if (((guint32)(val) & 0x3ff) == 0) \
                        sparc_sethi((ins),(guint32)(val),(reg));        \
                else if (((gint32)(val) >= -4096) && ((gint32)(val) <= 4095))   \
                        sparc_or_imm((ins),FALSE,sparc_g0,(gint32)(val),(reg)); \