aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-06-27 21:19:42 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-06-27 21:19:42 -0400
commit3ad2180a02e9351700c8d46402d420f040c3d616 (patch)
treef7c52a4a03ca4a3f863fa287153d2e651c1119f4
parentae1ae48cdb444b210600c4b59d3a0524aee8a784 (diff)
downloadgcc-3ad2180a02e9351700c8d46402d420f040c3d616.zip
gcc-3ad2180a02e9351700c8d46402d420f040c3d616.tar.gz
gcc-3ad2180a02e9351700c8d46402d420f040c3d616.tar.bz2
(subst, apply_distributive_law): Use INTEGRAL_MODE_P and FLOAT_MODE_P.
(reversible_comparison_p): Likewise. Can reverse if MODE_COMPLEX_INT or MODE_PARTIAL_INT. From-SVN: r4779
-rw-r--r--gcc/combine.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 01fea6b..d6c1ef8 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2945,7 +2945,7 @@ subst (x, from, to, in_dest, unique_copy)
|| code == MULT || code == AND || code == IOR || code == XOR
|| code == DIV || code == UDIV
|| code == SMAX || code == SMIN || code == UMAX || code == UMIN)
- && GET_MODE_CLASS (mode) == MODE_INT)
+ && INTEGRAL_MODE_P (mode))
{
if (GET_CODE (XEXP (x, 0)) == code)
{
@@ -3235,7 +3235,7 @@ subst (x, from, to, in_dest, unique_copy)
/* (neg (minus X Y)) can become (minus Y X). */
if (GET_CODE (XEXP (x, 0)) == MINUS
- && (GET_MODE_CLASS (mode) != MODE_FLOAT
+ && (! FLOAT_MODE_P (mode)
/* x-y != -(y-x) with IEEE floating point. */
|| TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT))
{
@@ -3330,7 +3330,7 @@ subst (x, from, to, in_dest, unique_copy)
/* In IEEE floating point, x-0 is not the same as x. */
if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- || GET_MODE_CLASS (GET_MODE (XEXP (x, 0))) == MODE_INT)
+ || ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0))))
&& XEXP (x, 1) == CONST0_RTX (GET_MODE (XEXP (x, 0))))
return XEXP (x, 0);
break;
@@ -3703,7 +3703,7 @@ subst (x, from, to, in_dest, unique_copy)
/* Look for MIN or MAX. */
- if (GET_MODE_CLASS (mode) == MODE_INT
+ if (! FLOAT_MODE_P (mode)
&& GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<'
&& rtx_equal_p (XEXP (XEXP (x, 0), 0), XEXP (x, 1))
&& rtx_equal_p (XEXP (XEXP (x, 0), 1), XEXP (x, 2))
@@ -5773,7 +5773,7 @@ apply_distributive_law (x)
/* Distributivity is not true for floating point.
It can change the value. So don't do it.
-- rms and moshier@world.std.com. */
- if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
+ if (FLOAT_MODE_P (GET_MODE (x)))
return x;
/* The outer operation can only be one of the following: */
@@ -8923,12 +8923,14 @@ reversible_comparison_p (x)
switch (GET_MODE_CLASS (GET_MODE (XEXP (x, 0))))
{
case MODE_INT:
+ case MODE_PARTIAL_INT:
+ case MODE_COMPLEX_INT:
return 1;
case MODE_CC:
x = get_last_value (XEXP (x, 0));
return (x && GET_CODE (x) == COMPARE
- && GET_MODE_CLASS (GET_MODE (XEXP (x, 0))) == MODE_INT);
+ && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0))));
}
return 0;