aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-03-21 09:10:08 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-03-21 09:10:08 +0000
commit2a450639801b638f5b28d00b1ba0b560d8a2c271 (patch)
treedcedf9b4a8071779c736674a2898f51cb3a47948
parentfe24cc36d56fe9bf973480d4fe97b2cbc652b69b (diff)
downloadgcc-2a450639801b638f5b28d00b1ba0b560d8a2c271.zip
gcc-2a450639801b638f5b28d00b1ba0b560d8a2c271.tar.gz
gcc-2a450639801b638f5b28d00b1ba0b560d8a2c271.tar.bz2
rtl.h (constant_pool_reference_p): Delete.
gcc/ * 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. From-SVN: r123106
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/i386.md21
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/rtlanal.c24
-rw-r--r--gcc/simplify-rtx.c8
5 files changed, 42 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c2bcf89..f6edacf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
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__.
* c-cppbuiltin.c (c_cpp_builtins): Define them.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index bdf8bef..df1bacf 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2331,10 +2331,9 @@
(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.
@@ -3078,10 +3077,10 @@
&& (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)
@@ -3099,8 +3098,6 @@
}
else if (MMX_REG_P (r))
FAIL;
-
- operands[1] = c;
})
(define_split
@@ -3111,10 +3108,10 @@
&& (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)
@@ -3132,8 +3129,6 @@
}
else if (MMX_REG_P (r))
FAIL;
-
- operands[1] = c;
})
(define_insn "swapxf"
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 5b0f8f4..12f69e8 100644
--- 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);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index cf9fd1d..ce7018b 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -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. */
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 4251df5..e4af34d 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -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;
-}
/* Make a unary operation by first seeing if it folds and otherwise making
the specified operation. */