diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-07-16 19:34:50 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-07-16 19:34:50 +0000 |
commit | d41ba56fc46ed9cf8c2b4a3dbf74c01eb001887f (patch) | |
tree | 6fec9a7da738bbe40bc3e850d549dd27e19739f5 /gcc | |
parent | 264d65c1b53f893bdb421fd18b7d86792f3a38aa (diff) | |
download | gcc-d41ba56fc46ed9cf8c2b4a3dbf74c01eb001887f.zip gcc-d41ba56fc46ed9cf8c2b4a3dbf74c01eb001887f.tar.gz gcc-d41ba56fc46ed9cf8c2b4a3dbf74c01eb001887f.tar.bz2 |
simplify-rtx.c (simplify_replace_rtx): Convert constant comparisons to MODE_FLOAT constants if...
* simplify-rtx.c (simplify_replace_rtx): Convert constant comparisons
to MODE_FLOAT constants if FLOAT_STORE_FLAG_VALUE is defined.
(simplify_rtx): Likewise. Simplify (lo_sum (high X) X) as X.
From-SVN: r69475
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/simplify-rtx.c | 58 |
2 files changed, 52 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4cfcc0c..ba9356f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-07-16 Roger Sayle <roger@eyesopen.com> + + * simplify-rtx.c (simplify_replace_rtx): Convert constant comparisons + to MODE_FLOAT constants if FLOAT_STORE_FLAG_VALUE is defined. + (simplify_rtx): Likewise. Simplify (lo_sum (high X) X) as X. + 2003-07-16 Andrew Pinski <pinskia@physics.uc.edu> * doc/install.texi (--without-headers): New. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 27fe4f3..3b85767 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -269,15 +269,24 @@ simplify_replace_rtx (rtx x, rtx old, rtx new) : GET_MODE (XEXP (x, 1))); rtx op0 = simplify_replace_rtx (XEXP (x, 0), old, new); rtx op1 = simplify_replace_rtx (XEXP (x, 1), old, new); - - return - simplify_gen_relational (code, mode, - (op_mode != VOIDmode - ? op_mode - : GET_MODE (op0) != VOIDmode - ? GET_MODE (op0) - : GET_MODE (op1)), - op0, op1); + rtx temp = simplify_gen_relational (code, mode, + (op_mode != VOIDmode + ? op_mode + : GET_MODE (op0) != VOIDmode + ? GET_MODE (op0) + : GET_MODE (op1)), + op0, op1); +#ifdef FLOAT_STORE_FLAG_VALUE + if (GET_MODE_CLASS (mode) == MODE_FLOAT) + { + if (temp == const0_rtx) + temp = CONST0_RTX (mode); + else if (temp == const_true_rtx) + temp = CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE (mode), + mode); + } +#endif + return temp; } case '3': @@ -3030,6 +3039,7 @@ simplify_rtx (rtx x) { enum rtx_code code = GET_CODE (x); enum machine_mode mode = GET_MODE (x); + rtx temp; switch (GET_RTX_CLASS (code)) { @@ -3058,12 +3068,24 @@ simplify_rtx (rtx x) XEXP (x, 2)); case '<': - return simplify_relational_operation (code, + temp = simplify_relational_operation (code, ((GET_MODE (XEXP (x, 0)) != VOIDmode) ? GET_MODE (XEXP (x, 0)) : GET_MODE (XEXP (x, 1))), XEXP (x, 0), XEXP (x, 1)); +#ifdef FLOAT_STORE_FLAG_VALUE + if (temp != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT) + { + if (temp == const0_rtx) + temp = CONST0_RTX (mode); + else + temp = CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE (mode), + mode); + } +#endif + return temp; + case 'x': if (code == SUBREG) return simplify_gen_subreg (mode, SUBREG_REG (x), @@ -3074,8 +3096,20 @@ simplify_rtx (rtx x) if (CONSTANT_P (XEXP (x, 0))) return const1_rtx; } - return NULL; + break; + + case 'o': + if (code == LO_SUM) + { + /* Convert (lo_sum (high FOO) FOO) to FOO. */ + if (GET_CODE (XEXP (x, 0)) == HIGH + && rtx_equal_p (XEXP (XEXP (x, 0), 0), XEXP (x, 1))) + return XEXP (x, 1); + } + break; + default: - return NULL; + break; } + return NULL; } |