aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRoger Sayle <sayle@gcc.gnu.org>2004-10-09 19:27:55 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-10-09 19:27:55 +0000
commitfc7ca5fd397370a7c606e631b399e43b22397ef9 (patch)
tree96aa90127b4a4b4bb4eebac21fbf671df91a35bb /gcc/simplify-rtx.c
parent35ed0a936a8269de89d1bc62ff63fb725a919b16 (diff)
downloadgcc-fc7ca5fd397370a7c606e631b399e43b22397ef9.zip
gcc-fc7ca5fd397370a7c606e631b399e43b22397ef9.tar.gz
gcc-fc7ca5fd397370a7c606e631b399e43b22397ef9.tar.bz2
[multiple changes]
2004-10-09 Roger Sayle <roger@eyesopen.com> PR rtl-optimization/17853 * simplify-rtx.c (simplify_relational_operation): Correct comment. Reorganize handling of comparison operations with floating point results (always return 0.0 even without FLOAT_STORE_FLAG_VALUE). Likewise, introduce support for comparison operations with vector result types, introducing a new VECTOR_STORE_FLAG_VALUE target macro. * doc/rtl.texi: Document new VECTOR_STORE_FLAG_VALUE target macro. * doc/tm.texi: Likewise. 2004-10-09 Stuart Hastings <stuart@apple.com> Roger Sayle <roger@eyesopen.com> PR rtl-optimization/17853 * gcc.dg/i386-mmx-5.c: New testcase. From-SVN: r88826
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index eec2a58..7236bbf 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2679,7 +2679,7 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
/* Like simplify_binary_operation except used for relational operators.
MODE is the mode of the result. If MODE is VOIDmode, both operands must
- also be VOIDmode.
+ not also be VOIDmode.
CMP_MODE specifies in which mode the comparison is done in, so it is
the mode of the operands. If CMP_MODE is VOIDmode, it is taken from
@@ -2699,19 +2699,45 @@ simplify_relational_operation (enum rtx_code code, enum machine_mode mode,
tem = simplify_const_relational_operation (code, cmp_mode, op0, op1);
if (tem)
{
-#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
if (tem == const0_rtx)
return CONST0_RTX (mode);
- else if (GET_MODE_CLASS (mode) == MODE_FLOAT)
- {
- REAL_VALUE_TYPE val;
- val = FLOAT_STORE_FLAG_VALUE (mode);
- return CONST_DOUBLE_FROM_REAL_VALUE (val, mode);
- }
+#ifdef FLOAT_STORE_FLAG_VALUE
+ {
+ REAL_VALUE_TYPE val;
+ val = FLOAT_STORE_FLAG_VALUE (mode);
+ return CONST_DOUBLE_FROM_REAL_VALUE (val, mode);
+ }
+#else
+ return NULL_RTX;
+#endif
}
+ if (VECTOR_MODE_P (mode))
+ {
+ if (tem == const0_rtx)
+ return CONST0_RTX (mode);
+#ifdef VECTOR_STORE_FLAG_VALUE
+ {
+ int i, units;
+ rtvec c;
+
+ rtx val = VECTOR_STORE_FLAG_VALUE (mode);
+ if (val == NULL_RTX)
+ return NULL_RTX;
+ if (val == const1_rtx)
+ return CONST1_RTX (mode);
+
+ units = GET_MODE_NUNITS (mode);
+ v = rtvec_alloc (units);
+ for (i = 0; i < units; i++)
+ RTVEC_ELT (v, i) = val;
+ return gen_rtx_raw_CONST_VECTOR (mode, v);
+ }
+#else
+ return NULL_RTX;
#endif
+ }
return tem;
}