- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
- real_2expN (&max_value, GET_MODE_IBIT (mode));
- real_2expN (&epsilon_value, -GET_MODE_FBIT (mode));
+ real_2expN (&max_value, GET_MODE_IBIT (mode), mode);
+ real_2expN (&epsilon_value, -GET_MODE_FBIT (mode), mode);
|| (temp == FIXED_MAX_EPS && ALL_ACCUM_MODE_P (f->mode)))
warning (OPT_Woverflow,
"large fixed-point constant implicitly truncated to fixed-point type");
|| (temp == FIXED_MAX_EPS && ALL_ACCUM_MODE_P (f->mode)))
warning (OPT_Woverflow,
"large fixed-point constant implicitly truncated to fixed-point type");
real_arithmetic (&fixed_value, MULT_EXPR, &real_value, &base_value);
real_to_integer2 ((HOST_WIDE_INT *)&f->data.low, &f->data.high,
&fixed_value);
real_arithmetic (&fixed_value, MULT_EXPR, &real_value, &base_value);
real_to_integer2 ((HOST_WIDE_INT *)&f->data.low, &f->data.high,
&fixed_value);
real_from_integer (&real_value, VOIDmode, f_orig->data.low, f_orig->data.high,
UNSIGNED_FIXED_POINT_MODE_P (f_orig->mode));
real_arithmetic (&fixed_value, RDIV_EXPR, &real_value, &base_value);
real_from_integer (&real_value, VOIDmode, f_orig->data.low, f_orig->data.high,
UNSIGNED_FIXED_POINT_MODE_P (f_orig->mode));
real_arithmetic (&fixed_value, RDIV_EXPR, &real_value, &base_value);
- double_int temp = subtract_p ? double_int_neg (b->data) : b->data;
- bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode);
- int i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode);
+ bool unsigned_p;
+ double_int temp;
+ int i_f_bits;
+
+ /* This was a conditional expression but it triggered a bug in
+ Sun C 5.5. */
+ if (subtract_p)
+ temp = double_int_neg (b->data);
+ else
+ temp = b->data;
+
+ unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode);
+ i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode);
f->mode = a->mode;
f->data = double_int_add (a->data, temp);
if (unsigned_p) /* Unsigned type. */
f->mode = a->mode;
f->data = double_int_add (a->data, temp);
if (unsigned_p) /* Unsigned type. */
- r = double_int_add (r, double_int_neg (b->data));
- /* We need to add neg(a) to r, if b < 0. */
+ r = double_int_sub (r, b->data);
+ /* We need to subtract a from r, if b < 0. */
&quo_s.low, &quo_s.high, 0);
/* Try to calculate (mod - pos_b). */
&quo_s.low, &quo_s.high, 0);
/* Try to calculate (mod - pos_b). */
fixed_compare (int icode, const FIXED_VALUE_TYPE *op0,
const FIXED_VALUE_TYPE *op1)
{
fixed_compare (int icode, const FIXED_VALUE_TYPE *op0,
const FIXED_VALUE_TYPE *op1)
{
real_arithmetic (&fixed_value, MULT_EXPR, &real_value, &base_value);
real_to_integer2 ((HOST_WIDE_INT *)&f->data.low, &f->data.high, &fixed_value);
temp = check_real_for_fixed_mode (&real_value, mode);
real_arithmetic (&fixed_value, MULT_EXPR, &real_value, &base_value);
real_to_integer2 ((HOST_WIDE_INT *)&f->data.low, &f->data.high, &fixed_value);
temp = check_real_for_fixed_mode (&real_value, mode);
real_from_integer (&fixed_value, VOIDmode, f->data.low, f->data.high,
UNSIGNED_FIXED_POINT_MODE_P (f->mode));
real_arithmetic (&real_value, RDIV_EXPR, &fixed_value, &base_value);
real_from_integer (&fixed_value, VOIDmode, f->data.low, f->data.high,
UNSIGNED_FIXED_POINT_MODE_P (f->mode));
real_arithmetic (&real_value, RDIV_EXPR, &fixed_value, &base_value);