revert: i386.c (ix86_rtx_costs): For standard 80387 constants...
authorUros Bizjak <uros@gcc.gnu.org>
Mon, 27 Nov 2006 08:03:45 +0000 (09:03 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 27 Nov 2006 08:03:45 +0000 (09:03 +0100)
        Revert:
        2006-05-08  Uros Bizjak  <uros@kss-loka.si>
        * 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.

        * config/i386/i386.md: Add new splitter pattern to split
        float_extended load of constant from constant pool into
        pure constant load.

From-SVN: r119246

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

index d3f2578e0e93fd7c89d81d1b02fc5d04fb40399a..543995a04bcd7c684303d00124c84159934b162b 100644 (file)
@@ -1,3 +1,15 @@
+2006-11-27  Uros Bizjak  <ubizjak@gmail.com>
+
+       Revert:
+       2006-05-08  Uros Bizjak  <uros@kss-loka.si>
+       * 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.
+
+       * config/i386/i386.md: Add new splitter pattern to split
+       float_extended load of constant from constant pool into
+       pure constant load.
+
 2006-11-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * doc/install.texi: Move GMP/MPFR configure options from Fortran
@@ -10,8 +22,8 @@
 
 2006-11-26  Razya Ladklesky  <razya@il.ibm.com> 
 
-        * testsuite/gcc.dg/ipa/ipa-6.c: New.
-        
+       * testsuite/gcc.dg/ipa/ipa-6.c: New.
+
 2006-11-26  Razya Ladklesky  <razya@il.ibm.com>
        
        PR tree-optimization/29122
 2006-11-05  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * config/sh/lib1funcs-4-300.asm: Guard entire file with
-        #if !__SHMEDIA__ .
+       #if !__SHMEDIA__ .
 
 2006-11-05  Jakub Jelinek  <jakub@redhat.com>
 
index b6898a1302fb20d1bbc58aec202c9553e30e5de3..9e11787db4c35da15b73927b7052595a494904cd 100644 (file)
@@ -17705,22 +17705,7 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
       if (!TARGET_SSE_MATH
          || mode == XFmode
          || (mode == DFmode && !TARGET_SSE2))
-       /* 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);
-         }
+       *total = 0;
       return false;
 
     case ABS:
index 4caeda664d6d9289e2fefdc0e53ad19698ad180d..5265d838ecfc8a7c4796ed566defc57bdb26322d 100644 (file)
   operands[1] = c;
 })
 
+(define_split
+  [(set (match_operand 0 "register_operand" "")
+       (float_extend (match_operand 1 "memory_operand" "")))]
+  "reload_completed
+   && GET_CODE (operands[1]) == MEM
+   && (GET_MODE (operands[0]) == XFmode
+       || GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode)
+   && constant_pool_reference_p (operands[1])"
+  [(set (match_dup 0) (match_dup 1))]
+{
+  rtx c = avoid_constant_pool_reference (SET_SRC (PATTERN (curr_insn)));
+  rtx r = operands[0];
+
+  if (GET_CODE (r) == SUBREG)
+    r = SUBREG_REG (r);
+
+  if (SSE_REG_P (r))
+    {
+      if (!standard_sse_constant_p (c))
+       FAIL;
+    }
+  else if (FP_REG_P (r))
+    {
+      if (!standard_80387_constant_p (c))
+       FAIL;
+    }
+  else if (MMX_REG_P (r))
+    FAIL;
+
+  operands[1] = c;
+})
+
 (define_insn "swapxf"
   [(set (match_operand:XF 0 "register_operand" "+f")
        (match_operand:XF 1 "register_operand" "+f"))