+2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
+
+ * doc/tm.texi.in (REAL_ARITHMETIC): Delete.
+ * doc/tm.texi: Regenerate.
+ * real.h (REAL_ARITHMETIC): Delete.
+ * config/i386/i386.c (ix86_expand_lround, ix86_expand_round)
+ (ix86_expand_round_sse4): Use real_arithmetic instead of
+ REAL_ARITHMETIC.
+ * config/i386/sse.md (round<mode>2): Likewise.
+ * rtl.h (rtx_to_tree_code): Likewise (in comment).
+ * explow.c (rtx_to_tree_code): Likewise (in comment).
+ * match.pd: Likewise.
+ * simplify-rtx.c (simplify_binary_operation_1): Likewise.
+ * tree-ssa-math-opts.c (representable_as_half_series_p): Likewise.
+ (expand_pow_as_sqrts): Likewise.
+ * tree-pretty-print.c (dump_generic_node): Remove code that
+ was conditional on REAL_ARITHMETIC being undefined.
+
2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
* doc/tm.texi.in (REAL_VALUES_LESS): Delete.
+2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc-interface/trans.c (convert_with_check): Use real_arithmetic
+ instead of REAL_ARITHMETIC.
+
2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
* gcc-interface/trans.c (convert_with_check): Use real_less instead
/* Compute the exact value calc_type'Pred (0.5) at compile time. */
fmt = REAL_MODE_FORMAT (TYPE_MODE (calc_type));
real_2expN (&half_minus_pred_half, -(fmt->p) - 1, TYPE_MODE (calc_type));
- REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf,
- half_minus_pred_half);
+ real_arithmetic (&pred_half, MINUS_EXPR, &dconsthalf,
+ &half_minus_pred_half);
gnu_pred_half = build_real (calc_type, pred_half);
/* If the input is strictly negative, subtract this value
/* load nextafter (0.5, 0.0) */
fmt = REAL_MODE_FORMAT (mode);
real_2expN (&half_minus_pred_half, -(fmt->p) - 1, mode);
- REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
+ real_arithmetic (&pred_half, MINUS_EXPR, &dconsthalf, &half_minus_pred_half);
/* adj = copysign (0.5, op1) */
adj = force_reg (mode, const_double_from_real_value (pred_half, mode));
/* load nextafter (0.5, 0.0) */
fmt = REAL_MODE_FORMAT (mode);
real_2expN (&half_minus_pred_half, -(fmt->p) - 1, mode);
- REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
+ real_arithmetic (&pred_half, MINUS_EXPR, &dconsthalf, &half_minus_pred_half);
/* xa = xa + 0.5 */
half = force_reg (mode, const_double_from_real_value (pred_half, mode));
/* load nextafter (0.5, 0.0) */
fmt = REAL_MODE_FORMAT (mode);
real_2expN (&half_minus_pred_half, -(fmt->p) - 1, mode);
- REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
+ real_arithmetic (&pred_half, MINUS_EXPR, &dconsthalf, &half_minus_pred_half);
half = const_double_from_real_value (pred_half, mode);
/* e1 = copysign (0.5, op1) */
/* load nextafter (0.5, 0.0) */
fmt = REAL_MODE_FORMAT (scalar_mode);
real_2expN (&half_minus_pred_half, -(fmt->p) - 1, scalar_mode);
- REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
+ real_arithmetic (&pred_half, MINUS_EXPR, &dconsthalf, &half_minus_pred_half);
half = const_double_from_real_value (pred_half, scalar_mode);
vec_half = ix86_build_const_vector (<MODE>mode, true, half);
Determines whether @var{x} represents a ``NaN'' (not-a-number).
@end deftypefn
-@deftypefn Macro void REAL_ARITHMETIC (REAL_VALUE_TYPE @var{output}, enum tree_code @var{code}, REAL_VALUE_TYPE @var{x}, REAL_VALUE_TYPE @var{y})
-Calculates an arithmetic operation on the two floating point values
-@var{x} and @var{y}, storing the result in @var{output} (which must be a
-variable).
-
-The operation to be performed is specified by @var{code}. Only the
-following codes are supported: @code{PLUS_EXPR}, @code{MINUS_EXPR},
-@code{MULT_EXPR}, @code{RDIV_EXPR}, @code{MAX_EXPR}, @code{MIN_EXPR}.
-
-If @code{REAL_ARITHMETIC} is asked to evaluate division by zero and the
-target's floating point format cannot represent infinity, it will call
-@code{abort}. Callers should check for this situation first, using
-@code{MODE_HAS_INFINITIES}. @xref{Storage Layout}.
-@end deftypefn
-
@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_NEGATE (REAL_VALUE_TYPE @var{x})
Returns the negative of the floating point value @var{x}.
@end deftypefn
Determines whether @var{x} represents a ``NaN'' (not-a-number).
@end deftypefn
-@deftypefn Macro void REAL_ARITHMETIC (REAL_VALUE_TYPE @var{output}, enum tree_code @var{code}, REAL_VALUE_TYPE @var{x}, REAL_VALUE_TYPE @var{y})
-Calculates an arithmetic operation on the two floating point values
-@var{x} and @var{y}, storing the result in @var{output} (which must be a
-variable).
-
-The operation to be performed is specified by @var{code}. Only the
-following codes are supported: @code{PLUS_EXPR}, @code{MINUS_EXPR},
-@code{MULT_EXPR}, @code{RDIV_EXPR}, @code{MAX_EXPR}, @code{MIN_EXPR}.
-
-If @code{REAL_ARITHMETIC} is asked to evaluate division by zero and the
-target's floating point format cannot represent infinity, it will call
-@code{abort}. Callers should check for this situation first, using
-@code{MODE_HAS_INFINITIES}. @xref{Storage Layout}.
-@end deftypefn
-
@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_NEGATE (REAL_VALUE_TYPE @var{x})
Returns the negative of the floating point value @var{x}.
@end deftypefn
}
/* Look up the tree code for a given rtx code
- to provide the arithmetic operation for REAL_ARITHMETIC.
+ to provide the arithmetic operation for real_arithmetic.
The function returns an int because the caller may not know
what `enum tree_code' means. */
(with
{
REAL_VALUE_TYPE c2;
- REAL_ARITHMETIC (c2, MULT_EXPR,
- TREE_REAL_CST (@1), TREE_REAL_CST (@1));
+ real_arithmetic (&c2, MULT_EXPR,
+ &TREE_REAL_CST (@1), &TREE_REAL_CST (@1));
real_convert (&c2, TYPE_MODE (TREE_TYPE (@0)), &c2);
}
(if (REAL_VALUE_ISINF (c2))
(with
{
REAL_VALUE_TYPE c2;
- REAL_ARITHMETIC (c2, MULT_EXPR,
- TREE_REAL_CST (@1), TREE_REAL_CST (@1));
+ real_arithmetic (&c2, MULT_EXPR,
+ &TREE_REAL_CST (@1), &TREE_REAL_CST (@1));
real_convert (&c2, TYPE_MODE (TREE_TYPE (@0)), &c2);
}
(if (REAL_VALUE_ISINF (c2))
/* ====================================================================== */
/* Crap. */
-#define REAL_ARITHMETIC(value, code, d1, d2) \
- real_arithmetic (&(value), code, &(d1), &(d2))
-
/* Determine whether a floating-point value X is infinite. */
#define REAL_VALUE_ISINF(x) real_isinf (&(x))
extern int cse_not_expected;
/* Translates rtx code to tree code, for those codes needed by
- REAL_ARITHMETIC. The function returns an int because the caller may not
+ real_arithmetic. The function returns an int because the caller may not
know what `enum tree_code' means. */
extern int rtx_to_tree_code (enum rtx_code);
if (flag_reciprocal_math
&& !real_equal (&d, &dconst0))
{
- REAL_ARITHMETIC (d, RDIV_EXPR, dconst1, d);
+ real_arithmetic (&d, RDIV_EXPR, &dconst1, &d);
tem = CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
return simplify_gen_binary (MULT, mode, op0, tem);
}
if (TREE_OVERFLOW (node))
pp_string (pp, " overflow");
-#if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC)
d = TREE_REAL_CST (node);
if (REAL_VALUE_ISINF (d))
pp_string (pp, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf");
real_to_decimal (string, &d, sizeof (string), 0, 1);
pp_string (pp, string);
}
-#else
- {
- HOST_WIDE_INT i;
- unsigned char *p = (unsigned char *) &TREE_REAL_CST (node);
- pp_string (pp, "0x");
- for (i = 0; i < sizeof TREE_REAL_CST (node); i++)
- output_formatted_integer (pp, "%02x", *p++);
- }
-#endif
break;
}
REAL_VALUE_TYPE res;
/* If something inexact happened bail out now. */
- if (REAL_ARITHMETIC (res, MINUS_EXPR, remainder, factor))
+ if (real_arithmetic (&res, MINUS_EXPR, &remainder, &factor))
return false;
/* We have hit zero. The number is representable as a sum
else
info->factors[i] = false;
- REAL_ARITHMETIC (factor, MULT_EXPR, factor, dconsthalf);
+ real_arithmetic (&factor, MULT_EXPR, &factor, &dconsthalf);
}
return false;
}
REAL_VALUE_TYPE frac_part;
real_floor (&whole_part, mode, &exp);
- REAL_ARITHMETIC (frac_part, MINUS_EXPR, exp, whole_part);
+ real_arithmetic (&frac_part, MINUS_EXPR, &exp, &whole_part);
REAL_VALUE_TYPE ceil_whole = dconst0;
if (neg_exp)
{
real_ceil (&ceil_whole, mode, &exp);
- REAL_ARITHMETIC (ceil_fract, MINUS_EXPR, ceil_whole, exp);
+ real_arithmetic (&ceil_fract, MINUS_EXPR, &ceil_whole, &exp);
}
if (!representable_as_half_series_p (frac_part, max_depth, &synth_info))