OSDN Git Service

PR target/27277
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 May 2006 06:10:03 +0000 (06:10 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 May 2006 06:10:03 +0000 (06:10 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113622 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 1bb7acb..631921b 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 a092484..df5a4e6 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: