]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.c (output_mi_thunk): Don't determine insns for loading delta with num_insns_co...
authorAlan Modra <amodra@bigpond.net.au>
Fri, 23 Aug 2002 01:20:21 +0000 (01:20 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Fri, 23 Aug 2002 01:20:21 +0000 (10:50 +0930)
* config/rs6000/rs6000.c (output_mi_thunk): Don't determine insns
for loading delta with num_insns_constant_wide.  Calculate
delta_low, delta_high without using a conditional.

From-SVN: r56526

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 2b372262fccf4d987c9cc19aaee4033928c1972f..ea095095199a2840fed1d43b9baa7168213b5199 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-23  Alan Modra  <amodra@bigpond.net.au>
+
+       * config/rs6000/rs6000.c (output_mi_thunk): Don't determine insns
+       for loading delta with num_insns_constant_wide.  Calculate
+       delta_low, delta_high without using a conditional.
+
 2002-08-20  Andreas Jaeger  <aj@suse.de>
 
        Merge from trunk:
index 2582c118c5bd3fb38ba64ff86fb21eae4a74d6ae..0976323fca6b476945bc0c172147845770112ef0 100644 (file)
@@ -9735,23 +9735,22 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
        fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta);
     }
 
+  /* 64-bit constants.  If "int" is 32 bits, we'll never hit this abort.  */
+  else if (TARGET_64BIT && (delta < -2147483647 - 1 || delta > 2147483647))
+    abort ();
+
   /* Large constants that can be done by one addis instruction.  */
-  else if ((delta & 0xffff) == 0 && num_insns_constant_wide (delta) == 1)
+  else if ((delta & 0xffff) == 0)
     asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg,
                 delta >> 16);
 
   /* 32-bit constants that can be done by an add and addis instruction.  */
-  else if (TARGET_32BIT || num_insns_constant_wide (delta) == 1)
+  else
     {
       /* Break into two pieces, propagating the sign bit from the low
         word to the upper word.  */
-      int delta_high = delta >> 16;
-      int delta_low  = delta & 0xffff;
-      if ((delta_low & 0x8000) != 0)
-       {
-         delta_high++;
-         delta_low = (delta_low ^ 0x8000) - 0x8000;    /* sign extend */
-       }
+      int delta_low  = ((delta & 0xffff) ^ 0x8000) - 0x8000;
+      int delta_high = (delta - delta_low) >> 16;
 
       asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg,
                   delta_high);
@@ -9762,10 +9761,6 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
        fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta_low);
     }
 
-  /* 64-bit constants, fixme */
-  else
-    abort ();
-
   /* Get the prefix in front of the names.  */
   switch (DEFAULT_ABI)
     {