re PR target/27277 (standard i387 constant loading insns (fldz, fld1) are not generat...
authorUros Bizjak <uros@kss-loka.si>
Mon, 8 May 2006 06:10:03 +0000 (08:10 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 8 May 2006 06:10:03 +0000 (08:10 +0200)
PR target/27277
* config/i386/i386.c (ix86_rtx_costs) [FLOAT_EXTEND]: For
standard 80387 constants, raise the cost to prevent
compress_float_constant() to generate load from memory.

From-SVN: r113622

gcc/ChangeLog
gcc/config/i386/i386.c

index 1bb7acb315264afdc63b3f253c4ec615bd23ba30..631921b45a6e7ee708fa72fd2d5e09f83b4f8813 100644 (file)
@@ -1,3 +1,10 @@
+2006-05-08  Uros Bizjak  <uros@kss-loka.si>
+
+       PR target/27277
+       * config/i386/i386.c (ix86_rtx_costs) [FLOAT_EXTEND]: For
+       standard 80387 constants, raise the cost to prevent
+       compress_float_constant() to generate load from memory.
+
 2006-05-08  Kazu Hirata  <kazu@codesourcery.com>
 
        * config/arm/constraints.md (c): Fix a typo.
index a092484da186b526622fbe0febd607fd6e3b67f8..df5a4e68d43d6fb96918fb72f9bb2438805c7b87 100644 (file)
@@ -17102,7 +17102,22 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
       if (!TARGET_SSE_MATH
          || mode == XFmode
          || (mode == DFmode && !TARGET_SSE2))
-       *total = 0;
+       /* For standard 80387 constants, raise the cost to prevent
+          compress_float_constant() to generate load from memory.  */
+       switch (standard_80387_constant_p (XEXP (x, 0)))
+         {
+         case -1:
+         case 0:
+           *total = 0;
+           break;
+         case 1: /* 0.0 */
+           *total = 1;
+           break;
+         default:
+           *total = (x86_ext_80387_constants & TUNEMASK
+                     || optimize_size
+                     ? 1 : 0);
+         }
       return false;
 
     case ABS: