]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2007 09:10:08 +0000 (09:10 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2007 09:10:08 +0000 (09:10 +0000)
* rtl.h (constant_pool_reference_p): Delete.
(find_constant_src): Declare.
* rtlanal.c (find_constant_src): New function.
* simplify-rtx.c (constant_pool_reference_p): Delete.
* config/i386/i386.md: Use find_constant_src instead of
constant_pool_reference_p/avoid_constant_pool_reference pairs.

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

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/rtl.h
gcc/rtlanal.c
gcc/simplify-rtx.c

index c2bcf896c9c59481d079d25d3b970b1bc447f209..f6edacf979b444116f1b76e1cd2a3da87ee4ced3 100644 (file)
@@ -1,3 +1,12 @@
+2007-03-21  Richard Sandiford  <richard@codesourcery.com>
+
+       * rtl.h (constant_pool_reference_p): Delete.
+       (find_constant_src): Declare.
+       * rtlanal.c (find_constant_src): New function.
+       * simplify-rtx.c (constant_pool_reference_p): Delete.
+       * config/i386/i386.md: Use find_constant_src instead of
+       constant_pool_reference_p/avoid_constant_pool_reference pairs.
+
 2007-03-21  Richard Sandiford  <richard@codesourcery.com>
 
        * doc/invoke.texi (-fpie, -fPIE): Document __pie__ and __PIE__.
index bdf8bef16dd8e21c8f6004617b41e225de4afd92..df1bacfc41b0e94b3fff96187b99f162424cbcfa 100644 (file)
        (match_operand:SF 1 "memory_operand" ""))]
   "reload_completed
    && MEM_P (operands[1])
-   && constant_pool_reference_p (operands[1])"
+   && (operands[2] = find_constant_src (insn))"
   [(set (match_dup 0)
-       (match_dup 1))]
-  "operands[1] = avoid_constant_pool_reference (operands[1]);")
+       (match_dup 2))])
 
 
 ;; %%% Kill this when call knows how to work this out.
    && (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))]
+   && (operands[2] = find_constant_src (insn))"
+  [(set (match_dup 0) (match_dup 2))]
 {
-  rtx c = avoid_constant_pool_reference (operands[1]);
+  rtx c = operands[2];
   rtx r = operands[0];
 
   if (GET_CODE (r) == SUBREG)
     }
   else if (MMX_REG_P (r))
     FAIL;
-
-  operands[1] = c;
 })
 
 (define_split
    && (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))]
+   && (operands[2] = find_constant_src (insn))"
+  [(set (match_dup 0) (match_dup 2))]
 {
-  rtx c = avoid_constant_pool_reference (SET_SRC (PATTERN (curr_insn)));
+  rtx c = operands[2];
   rtx r = operands[0];
 
   if (GET_CODE (r) == SUBREG)
     }
   else if (MMX_REG_P (r))
     FAIL;
-
-  operands[1] = c;
 })
 
 (define_insn "swapxf"
index 5b0f8f48d2751d4cf411e5d04a1aa4ff62d842ea..12f69e815b7010625588c6ad52b1bbf457841fd7 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1641,7 +1641,6 @@ extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode,
 extern rtx simplify_replace_rtx (rtx, rtx, rtx);
 extern rtx simplify_rtx (rtx);
 extern rtx avoid_constant_pool_reference (rtx);
-extern bool constant_pool_reference_p (rtx x);
 extern bool mode_signbit_p (enum machine_mode, rtx);
 
 /* In regclass.c  */
@@ -1703,6 +1702,7 @@ extern int dead_or_set_regno_p (rtx, unsigned int);
 extern rtx find_reg_note (rtx, enum reg_note, rtx);
 extern rtx find_regno_note (rtx, enum reg_note, unsigned int);
 extern rtx find_reg_equal_equiv_note (rtx);
+extern rtx find_constant_src (rtx);
 extern int find_reg_fusage (rtx, enum rtx_code, rtx);
 extern int find_regno_fusage (rtx, enum rtx_code, unsigned int);
 extern int pure_call_p (rtx);
index cf9fd1d65af381f1fec829011ca11c0256a6842b..ce7018b5987a9c4bc78d617897af3beafac6802b 100644 (file)
@@ -1750,6 +1750,30 @@ find_reg_equal_equiv_note (rtx insn)
   return NULL;
 }
 
+/* Check whether INSN is a single_set whose source is known to be
+   equivalent to a constant.  Return that constant if so, otherwise
+   return null.  */
+
+rtx
+find_constant_src (rtx insn)
+{
+  rtx note, set, x;
+
+  set = single_set (insn);
+  if (set)
+    {
+      x = avoid_constant_pool_reference (SET_SRC (set));
+      if (CONSTANT_P (x))
+       return x;
+    }
+
+  note = find_reg_equal_equiv_note (insn);
+  if (note && CONSTANT_P (XEXP (note, 0)))
+    return XEXP (note, 0);
+
+  return NULL_RTX;
+}
+
 /* Return true if DATUM, or any overlap of DATUM, of kind CODE is found
    in the CALL_INSN_FUNCTION_USAGE information of INSN.  */
 
index 4251df520c8ab9e90fb8f94c2e1f68d9855d5b9a..e4af34d7adf73cf505c2ba480f7b868a6227bb5a 100644 (file)
@@ -202,14 +202,6 @@ avoid_constant_pool_reference (rtx x)
 
   return x;
 }
-
-/* Return true if X is a MEM referencing the constant pool.  */
-
-bool
-constant_pool_reference_p (rtx x)
-{
-  return avoid_constant_pool_reference (x) != x;
-}
 \f
 /* Make a unary operation by first seeing if it folds and otherwise making
    the specified operation.  */