aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c80
1 files changed, 1 insertions, 79 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 55cbfc6..5596e0c 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -102,10 +102,8 @@ static rtx simplify_plus_minus PARAMS ((enum rtx_code,
enum machine_mode, rtx,
rtx, int));
static void check_fold_consts PARAMS ((PTR));
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
static void simplify_unary_real PARAMS ((PTR));
static void simplify_binary_real PARAMS ((PTR));
-#endif
static void simplify_binary_is2orm1 PARAMS ((PTR));
@@ -339,7 +337,6 @@ simplify_replace_rtx (x, old, new)
return x;
}
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
/* Subroutine of simplify_unary_operation, called via do_float_handler.
Handles simplification of unary ops on floating point values. */
struct simplify_unary_real_args
@@ -398,7 +395,6 @@ simplify_unary_real (p)
args->result = CONST_DOUBLE_FROM_REAL_VALUE (d, args->mode);
}
}
-#endif
/* Try to simplify a unary operation CODE whose output mode is to be
MODE with input operand OP whose mode was originally OP_MODE.
@@ -417,8 +413,6 @@ simplify_unary_operation (code, mode, op, op_mode)
check the wrong mode (input vs. output) for a conversion operation,
such as FIX. At some point, this should be simplified. */
-#if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC)
-
if (code == FLOAT && GET_MODE (trueop) == VOIDmode
&& (GET_CODE (trueop) == CONST_DOUBLE || GET_CODE (trueop) == CONST_INT))
{
@@ -430,25 +424,7 @@ simplify_unary_operation (code, mode, op, op_mode)
else
lv = CONST_DOUBLE_LOW (trueop), hv = CONST_DOUBLE_HIGH (trueop);
-#ifdef REAL_ARITHMETIC
REAL_VALUE_FROM_INT (d, lv, hv, mode);
-#else
- if (hv < 0)
- {
- d = (double) (~ hv);
- d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))
- * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)));
- d += (double) (unsigned HOST_WIDE_INT) (~ lv);
- d = (- d - 1.0);
- }
- else
- {
- d = (double) hv;
- d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))
- * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)));
- d += (double) (unsigned HOST_WIDE_INT) lv;
- }
-#endif /* REAL_ARITHMETIC */
d = real_value_truncate (mode, d);
return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
}
@@ -476,19 +452,10 @@ simplify_unary_operation (code, mode, op, op_mode)
else
hv = 0, lv &= GET_MODE_MASK (op_mode);
-#ifdef REAL_ARITHMETIC
REAL_VALUE_FROM_UNSIGNED_INT (d, lv, hv, mode);
-#else
-
- d = (double) (unsigned HOST_WIDE_INT) hv;
- d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))
- * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)));
- d += (double) (unsigned HOST_WIDE_INT) lv;
-#endif /* REAL_ARITHMETIC */
d = real_value_truncate (mode, d);
return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
}
-#endif
if (GET_CODE (trueop) == CONST_INT
&& width <= HOST_BITS_PER_WIDE_INT && width > 0)
@@ -664,7 +631,6 @@ simplify_unary_operation (code, mode, op, op_mode)
return immed_double_const (lv, hv, mode);
}
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
else if (GET_CODE (trueop) == CONST_DOUBLE
&& GET_MODE_CLASS (mode) == MODE_FLOAT)
{
@@ -696,7 +662,7 @@ simplify_unary_operation (code, mode, op, op_mode)
return 0;
}
-#endif
+
/* This was formerly used only for non-IEEE float.
eggert@twinsun.com says it is safe for IEEE also. */
else
@@ -770,7 +736,6 @@ simplify_unary_operation (code, mode, op, op_mode)
}
}
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
/* Subroutine of simplify_binary_operation, called via do_float_handler.
Handles simplification of binary ops on floating point values. */
struct simplify_binary_real_args
@@ -794,7 +759,6 @@ simplify_binary_real (p)
f0 = real_value_truncate (args->mode, f0);
f1 = real_value_truncate (args->mode, f1);
-#ifdef REAL_ARITHMETIC
#ifndef REAL_INFINITY
if (args->code == DIV && REAL_VALUES_EQUAL (f1, dconst0))
{
@@ -803,40 +767,10 @@ simplify_binary_real (p)
}
#endif
REAL_ARITHMETIC (value, rtx_to_tree_code (args->code), f0, f1);
-#else
- switch (args->code)
- {
- case PLUS:
- value = f0 + f1;
- break;
- case MINUS:
- value = f0 - f1;
- break;
- case MULT:
- value = f0 * f1;
- break;
- case DIV:
-#ifndef REAL_INFINITY
- if (f1 == 0)
- return 0;
-#endif
- value = f0 / f1;
- break;
- case SMIN:
- value = MIN (f0, f1);
- break;
- case SMAX:
- value = MAX (f0, f1);
- break;
- default:
- abort ();
- }
-#endif
value = real_value_truncate (args->mode, value);
args->result = CONST_DOUBLE_FROM_REAL_VALUE (value, args->mode);
}
-#endif
/* Another subroutine called via do_float_handler. This one tests
the floating point value given against 2. and -1. */
@@ -894,7 +828,6 @@ simplify_binary_operation (code, mode, op0, op1)
tem = trueop0, trueop0 = trueop1, trueop1 = tem;
}
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
if (GET_MODE_CLASS (mode) == MODE_FLOAT
&& GET_CODE (trueop0) == CONST_DOUBLE
&& GET_CODE (trueop1) == CONST_DOUBLE
@@ -910,7 +843,6 @@ simplify_binary_operation (code, mode, op0, op1)
return args.result;
return 0;
}
-#endif /* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
/* We can fold some multi-word operations. */
if (GET_MODE_CLASS (mode) == MODE_INT
@@ -1432,7 +1364,6 @@ simplify_binary_operation (code, mode, op0, op1)
&& ! side_effects_p (op1))
return op0;
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
/* Change division by a constant into multiplication. Only do
this with -funsafe-math-optimizations. */
else if (GET_CODE (trueop1) == CONST_DOUBLE
@@ -1445,18 +1376,11 @@ simplify_binary_operation (code, mode, op0, op1)
if (! REAL_VALUES_EQUAL (d, dconst0))
{
-#if defined (REAL_ARITHMETIC)
REAL_ARITHMETIC (d, rtx_to_tree_code (DIV), dconst1, d);
return gen_rtx_MULT (mode, op0,
CONST_DOUBLE_FROM_REAL_VALUE (d, mode));
-#else
- return
- gen_rtx_MULT (mode, op0,
- CONST_DOUBLE_FROM_REAL_VALUE (1./d, mode));
-#endif
}
}
-#endif
break;
case UMOD:
@@ -2102,7 +2026,6 @@ simplify_relational_operation (code, mode, op0, op1)
/* If the operands are floating-point constants, see if we can fold
the result. */
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
else if (GET_CODE (trueop0) == CONST_DOUBLE
&& GET_CODE (trueop1) == CONST_DOUBLE
&& GET_MODE_CLASS (GET_MODE (trueop0)) == MODE_FLOAT)
@@ -2145,7 +2068,6 @@ simplify_relational_operation (code, mode, op0, op1)
op0lt = op0ltu = args.op0lt;
op1lt = op1ltu = args.op1lt;
}
-#endif /* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
/* Otherwise, see if the operands are both integers. */
else if ((GET_MODE_CLASS (mode) == MODE_INT || mode == VOIDmode)