This patch replaces all uses of CONST_DOUBLE_FROM_REAL_VALUE
with the already-existing const_double_from_real_value.
Bootstrapped & regression-tested on x86_64-linux-gnu. Also tested by
building one target per CPU directory and checking that there were
no new warnings and no changes in testsuite output at -O2.
gcc/
* real.h (CONST_DOUBLE_ATOF): Use const_double_from_real_value
instead of CONST_DOUBLE_FROM_REAL_VALUE.
(CONST_DOUBLE_FROM_REAL_VALUE): Delete.
* config/c6x/c6x.md (divsf3, divdf3): Use const_double_from_real_value
instead of CONST_DOUBLE_FROM_REAL_VALUE.
* config/epiphany/epiphany.md (fixuns_truncsfsi2): Likewise.
* config/i386/i386.c (standard_80387_constant_rtx): Likewise.
(ix86_expand_builtin, ix86_emit_i387_log1p, ix86_emit_i387_round)
(ix86_emit_swsqrtsf): Likewise.
* config/ia64/ia64.c (ia64_expand_builtin): Likewise.
* config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2)
(fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise.
* config/pa/pa.c (pa_expand_builtin): Likewise.
* config/rs6000/rs6000.c (rs6000_load_constant_and_splat): Likewise.
(rs6000_scale_v2df): Likewise.
* config/rs6000/rs6000.md (*cmptf_internal2): Likewise.
* config/s390/s390.md (fixuns_truncdddi2, fixuns_trunctddi2)
(fixuns_trunc<BFP:mode><GPR:mode>2): Likewise.
* config/s390/vx-builtins.md (vec_ctd_s64, vec_ctd_u64, vec_ctsl)
(vec_ctul): Likewise.
* config/sparc/sparc.c (sparc_emit_fixunsdi): Likewise.
* config/spu/spu.c (hwint_to_const_double, spu_float_const): Likewise.
* config/spu/spu.md (floatunsdisf2, floatunstisf2): Likewise.
* cse.c (fold_rtx): Likewise.
* emit-rtl.c (immed_double_const): Likewise (in comments).
(init_emit_once): Likewise.
* expr.c (compress_float_constant, expand_expr_real_1)
(const_vector_from_tree): Likewise.
* optabs.c (expand_float, expand_fix): Likewise.
* reg-stack.c (reg_to_stack): Likewise.
* simplify-rtx.c (avoid_constant_pool_reference): Likewise.
(simplify_const_unary_operation, simplify_binary_operation_1)
(simplify_const_binary_operation, simplify_relational_operation)
(simplify_immed_subreg): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228477
138bc75d-0d04-0410-961f-
82ee72b054a4
2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
+ * real.h (CONST_DOUBLE_ATOF): Use const_double_from_real_value
+ instead of CONST_DOUBLE_FROM_REAL_VALUE.
+ (CONST_DOUBLE_FROM_REAL_VALUE): Delete.
+ * config/c6x/c6x.md (divsf3, divdf3): Use const_double_from_real_value
+ instead of CONST_DOUBLE_FROM_REAL_VALUE.
+ * config/epiphany/epiphany.md (fixuns_truncsfsi2): Likewise.
+ * config/i386/i386.c (standard_80387_constant_rtx): Likewise.
+ (ix86_expand_builtin, ix86_emit_i387_log1p, ix86_emit_i387_round)
+ (ix86_emit_swsqrtsf): Likewise.
+ * config/ia64/ia64.c (ia64_expand_builtin): Likewise.
+ * config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2)
+ (fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise.
+ * config/pa/pa.c (pa_expand_builtin): Likewise.
+ * config/rs6000/rs6000.c (rs6000_load_constant_and_splat): Likewise.
+ (rs6000_scale_v2df): Likewise.
+ * config/rs6000/rs6000.md (*cmptf_internal2): Likewise.
+ * config/s390/s390.md (fixuns_truncdddi2, fixuns_trunctddi2)
+ (fixuns_trunc<BFP:mode><GPR:mode>2): Likewise.
+ * config/s390/vx-builtins.md (vec_ctd_s64, vec_ctd_u64, vec_ctsl)
+ (vec_ctul): Likewise.
+ * config/sparc/sparc.c (sparc_emit_fixunsdi): Likewise.
+ * config/spu/spu.c (hwint_to_const_double, spu_float_const): Likewise.
+ * config/spu/spu.md (floatunsdisf2, floatunstisf2): Likewise.
+ * cse.c (fold_rtx): Likewise.
+ * emit-rtl.c (immed_double_const): Likewise (in comments).
+ (init_emit_once): Likewise.
+ * expr.c (compress_float_constant, expand_expr_real_1)
+ (const_vector_from_tree): Likewise.
+ * optabs.c (expand_float, expand_fix): Likewise.
+ * reg-stack.c (reg_to_stack): Likewise.
+ * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
+ (simplify_const_unary_operation, simplify_binary_operation_1)
+ (simplify_const_binary_operation, simplify_relational_operation)
+ (simplify_immed_subreg): Likewise.
+
+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.
"TARGET_FP && flag_reciprocal_math"
{
operands[3] = force_reg (SFmode,
- CONST_DOUBLE_FROM_REAL_VALUE (dconst2, SFmode));
+ const_double_from_real_value (dconst2, SFmode));
operands[4] = gen_reg_rtx (SFmode);
operands[5] = gen_reg_rtx (SFmode);
operands[6] = gen_reg_rtx (SFmode);
"TARGET_FP && flag_reciprocal_math"
{
operands[3] = force_reg (DFmode,
- CONST_DOUBLE_FROM_REAL_VALUE (dconst2, DFmode));
+ const_double_from_real_value (dconst2, DFmode));
operands[4] = gen_reg_rtx (DFmode);
operands[5] = gen_reg_rtx (DFmode);
operands[6] = gen_reg_rtx (DFmode);
rtx cmp = gen_rtx_LT (VOIDmode, cc1, CONST0_RTX (SFmode));
real_2expN (&offset, 31, SFmode);
- limit = CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode);
+ limit = const_double_from_real_value (offset, SFmode);
limit = force_reg (SFmode, limit);
emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1]));
emit_insn (gen_subsf3_f (tmp, operands[1], limit));
gcc_unreachable ();
}
- return CONST_DOUBLE_FROM_REAL_VALUE (ext_80387_constants_table[i],
+ return const_double_from_real_value (ext_80387_constants_table[i],
XFmode);
}
rtx tmp;
real_inf (&inf);
- tmp = CONST_DOUBLE_FROM_REAL_VALUE (inf, mode);
+ tmp = const_double_from_real_value (inf, mode);
tmp = validize_mem (force_const_mem (mode, tmp));
emit_insn (gen_absxf2 (tmp, op1));
test = gen_rtx_GE (VOIDmode, tmp,
- CONST_DOUBLE_FROM_REAL_VALUE (
+ const_double_from_real_value (
REAL_VALUE_ATOF ("0.29289321881345247561810596348408353", XFmode),
XFmode));
emit_jump_insn (gen_cbranchxf4 (test, XEXP (test, 0), XEXP (test, 1), label1));
e2 = gen_reg_rtx (inmode);
res = gen_reg_rtx (outmode);
- half = CONST_DOUBLE_FROM_REAL_VALUE (dconsthalf, inmode);
+ half = const_double_from_real_value (dconsthalf, inmode);
/* round(a) = sgn(a) * floor(fabs(a) + 0.5) */
e3 = gen_reg_rtx (mode);
real_from_integer (&r, VOIDmode, -3, SIGNED);
- mthree = CONST_DOUBLE_FROM_REAL_VALUE (r, SFmode);
+ mthree = const_double_from_real_value (r, SFmode);
real_arithmetic (&r, NEGATE_EXPR, &dconsthalf, NULL);
- mhalf = CONST_DOUBLE_FROM_REAL_VALUE (r, SFmode);
+ mhalf = const_double_from_real_value (r, SFmode);
unspec = UNSPEC_RSQRT;
if (VECTOR_MODE_P (mode))
rtx tmp;
real_inf (&inf);
- tmp = CONST_DOUBLE_FROM_REAL_VALUE (inf, target_mode);
+ tmp = const_double_from_real_value (inf, target_mode);
tmp = validize_mem (force_const_mem (target_mode, tmp));
if (reg1) /* Turn off complaints about unreached code. */
{
- mips_emit_move (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, DFmode));
+ mips_emit_move (reg1, const_double_from_real_value (offset, DFmode));
do_pending_stack_adjust ();
test = gen_rtx_GE (VOIDmode, operands[1], reg1);
real_2expN (&offset, 63, DFmode);
- mips_emit_move (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, DFmode));
+ mips_emit_move (reg1, const_double_from_real_value (offset, DFmode));
do_pending_stack_adjust ();
test = gen_rtx_GE (VOIDmode, operands[1], reg1);
real_2expN (&offset, 31, SFmode);
- mips_emit_move (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode));
+ mips_emit_move (reg1, const_double_from_real_value (offset, SFmode));
do_pending_stack_adjust ();
test = gen_rtx_GE (VOIDmode, operands[1], reg1);
real_2expN (&offset, 63, SFmode);
- mips_emit_move (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode));
+ mips_emit_move (reg1, const_double_from_real_value (offset, SFmode));
do_pending_stack_adjust ();
test = gen_rtx_GE (VOIDmode, operands[1], reg1);
rtx tmp;
real_inf (&inf);
- tmp = CONST_DOUBLE_FROM_REAL_VALUE (inf, target_mode);
+ tmp = const_double_from_real_value (inf, target_mode);
tmp = validize_mem (force_const_mem (target_mode, tmp));
if (mode == SFmode || mode == DFmode)
{
- rtx d = CONST_DOUBLE_FROM_REAL_VALUE (dconst, mode);
+ rtx d = const_double_from_real_value (dconst, mode);
reg = force_reg (mode, d);
}
else if (mode == V4SFmode)
{
- rtx d = CONST_DOUBLE_FROM_REAL_VALUE (dconst, SFmode);
+ rtx d = const_double_from_real_value (dconst, SFmode);
rtvec v = gen_rtvec (4, d, d, d, d);
reg = gen_reg_rtx (mode);
rs6000_expand_vector_init (reg, gen_rtx_PARALLEL (mode, v));
}
else if (mode == V2DFmode)
{
- rtx d = CONST_DOUBLE_FROM_REAL_VALUE (dconst, DFmode);
+ rtx d = const_double_from_real_value (dconst, DFmode);
rtvec v = gen_rtvec (2, d, d);
reg = gen_reg_rtx (mode);
rs6000_expand_vector_init (reg, gen_rtx_PARALLEL (mode, v));
rtx elt;
rtx scale_vec = gen_reg_rtx (V2DFmode);
(void)real_powi (&r_pow, DFmode, &dconst2, hwi_scale);
- elt = CONST_DOUBLE_FROM_REAL_VALUE (r_pow, DFmode);
+ elt = const_double_from_real_value (r_pow, DFmode);
RTVEC_ELT (v, 0) = elt;
RTVEC_ELT (v, 1) = elt;
rs6000_expand_vector_init (scale_vec, gen_rtx_PARALLEL (V2DFmode, v));
operands[13] = gen_label_rtx ();
real_inf (&rv);
operands[14] = force_const_mem (DFmode,
- CONST_DOUBLE_FROM_REAL_VALUE (rv, DFmode));
+ const_double_from_real_value (rv, DFmode));
operands[15] = force_const_mem (DFmode,
- CONST_DOUBLE_FROM_REAL_VALUE (dconst0,
+ const_double_from_real_value (dconst0,
DFmode));
if (TARGET_TOC)
{
emit_insn (gen_extendddtd2 (temp, operands[1]));
temp = force_reg (TDmode, temp);
emit_cmp_and_jump_insns (temp,
- CONST_DOUBLE_FROM_REAL_VALUE (cmp, TDmode),
+ const_double_from_real_value (cmp, TDmode),
LT, NULL_RTX, VOIDmode, 0, label1);
emit_insn (gen_subtd3 (temp, temp,
- CONST_DOUBLE_FROM_REAL_VALUE (sub, TDmode)));
+ const_double_from_real_value (sub, TDmode)));
emit_insn (gen_fix_trunctddi2_dfp (operands[0], temp, GEN_INT (11)));
emit_jump (label2);
decimal_real_from_string (&sub, "18446744073709551616.0"); /* 2^64 */
emit_cmp_and_jump_insns (operands[1],
- CONST_DOUBLE_FROM_REAL_VALUE (cmp, TDmode),
+ const_double_from_real_value (cmp, TDmode),
LT, NULL_RTX, VOIDmode, 0, label1);
emit_insn (gen_subtd3 (temp, operands[1],
- CONST_DOUBLE_FROM_REAL_VALUE (sub, TDmode)));
+ const_double_from_real_value (sub, TDmode)));
emit_insn (gen_fix_trunctddi2_dfp (operands[0], temp, GEN_INT (11)));
emit_jump (label2);
real_2expN (&sub, <GPR:bitsize>, <BFP:MODE>mode);
emit_cmp_and_jump_insns (operands[1],
- CONST_DOUBLE_FROM_REAL_VALUE (cmp, <BFP:MODE>mode),
+ const_double_from_real_value (cmp, <BFP:MODE>mode),
LT, NULL_RTX, VOIDmode, 0, label1);
emit_insn (gen_sub<BFP:mode>3 (temp, operands[1],
- CONST_DOUBLE_FROM_REAL_VALUE (sub, <BFP:MODE>mode)));
+ const_double_from_real_value (sub, <BFP:MODE>mode)));
emit_insn (gen_fix_trunc<BFP:mode><GPR:mode>2_bfp (operands[0], temp,
GEN_INT (7)));
emit_jump (label2);
rtx c;
real_2expN (&f, -INTVAL (operands[2]), DFmode);
- c = CONST_DOUBLE_FROM_REAL_VALUE (f, DFmode);
+ c = const_double_from_real_value (f, DFmode);
operands[3] = gen_rtx_CONST_VECTOR (V2DFmode, gen_rtvec (2, c, c));
operands[3] = force_reg (V2DFmode, operands[3]);
rtx c;
real_2expN (&f, -INTVAL (operands[2]), DFmode);
- c = CONST_DOUBLE_FROM_REAL_VALUE (f, DFmode);
+ c = const_double_from_real_value (f, DFmode);
operands[3] = gen_rtx_CONST_VECTOR (V2DFmode, gen_rtvec (2, c, c));
operands[3] = force_reg (V2DFmode, operands[3]);
rtx c;
real_2expN (&f, INTVAL (operands[2]), DFmode);
- c = CONST_DOUBLE_FROM_REAL_VALUE (f, DFmode);
+ c = const_double_from_real_value (f, DFmode);
operands[3] = gen_rtx_CONST_VECTOR (V2DFmode, gen_rtvec (2, c, c));
operands[3] = force_reg (V2DFmode, operands[3]);
rtx c;
real_2expN (&f, INTVAL (operands[2]), DFmode);
- c = CONST_DOUBLE_FROM_REAL_VALUE (f, DFmode);
+ c = const_double_from_real_value (f, DFmode);
operands[3] = gen_rtx_CONST_VECTOR (V2DFmode, gen_rtvec (2, c, c));
operands[3] = force_reg (V2DFmode, operands[3]);
f0 = gen_reg_rtx (mode);
emit_move_insn (limit,
- CONST_DOUBLE_FROM_REAL_VALUE (
+ const_double_from_real_value (
REAL_VALUE_ATOF ("9223372036854775808.0", mode), mode));
emit_cmp_and_jump_insns (in, limit, GE, NULL_RTX, mode, 0, neglab);
tv[0] = v >> 32;
}
real_from_target (&rv, tv, mode);
- return CONST_DOUBLE_FROM_REAL_VALUE (rv, mode);
+ return const_double_from_real_value (rv, mode);
}
void
{
REAL_VALUE_TYPE value;
value = REAL_VALUE_ATOF (string, mode);
- return CONST_DOUBLE_FROM_REAL_VALUE (value, mode);
+ return const_double_from_real_value (value, mode);
}
int
emit_insn (gen_shlqby_ti (op3_ti, op2_ti, GEN_INT (4)));
emit_move_insn (operands[4],
- CONST_DOUBLE_FROM_REAL_VALUE (scale, SFmode));
+ const_double_from_real_value (scale, SFmode));
emit_insn (gen_fmasf4 (operands[0],
operands[2], operands[4], operands[3]));
DONE;
emit_insn (gen_shlqby_ti (op3_ti, op2_ti, GEN_INT (4)));
emit_move_insn (operands[4],
- CONST_DOUBLE_FROM_REAL_VALUE (scale, SFmode));
+ const_double_from_real_value (scale, SFmode));
emit_insn (gen_fmasf4 (operands[2],
operands[2], operands[4], operands[3]));
if (SCALAR_FLOAT_MODE_P (mode))
{
#ifdef FLOAT_STORE_FLAG_VALUE
- true_rtx = (CONST_DOUBLE_FROM_REAL_VALUE
+ true_rtx = (const_double_from_real_value
(FLOAT_STORE_FLAG_VALUE (mode), mode));
#else
true_rtx = NULL_RTX;
implied upper bits are copies of the high bit of i1. The value
itself is neither signed nor unsigned. Do not use this routine for
non-integer modes; convert to REAL_VALUE_TYPE and use
- CONST_DOUBLE_FROM_REAL_VALUE. */
+ const_double_from_real_value. */
rtx
immed_double_const (HOST_WIDE_INT i0, HOST_WIDE_INT i1, machine_mode mode)
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
const_tiny_rtx[i][(int) mode] =
- CONST_DOUBLE_FROM_REAL_VALUE (*r, mode);
+ const_double_from_real_value (*r, mode);
for (mode = GET_CLASS_NARROWEST_MODE (MODE_DECIMAL_FLOAT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
const_tiny_rtx[i][(int) mode] =
- CONST_DOUBLE_FROM_REAL_VALUE (*r, mode);
+ const_double_from_real_value (*r, mode);
const_tiny_rtx[i][(int) VOIDmode] = GEN_INT (i);
if (! exact_real_truncate (srcmode, &r))
continue;
- trunc_y = CONST_DOUBLE_FROM_REAL_VALUE (r, srcmode);
+ trunc_y = const_double_from_real_value (r, srcmode);
if (targetm.legitimate_constant_p (srcmode, trunc_y))
{
many insns, so we'd end up copying it to a register in any case.
Now, we do the copying in expand_binop, if appropriate. */
- return CONST_DOUBLE_FROM_REAL_VALUE (TREE_REAL_CST (exp),
+ return const_double_from_real_value (TREE_REAL_CST (exp),
TYPE_MODE (TREE_TYPE (exp)));
case FIXED_CST:
elt = VECTOR_CST_ELT (exp, i);
if (TREE_CODE (elt) == REAL_CST)
- RTVEC_ELT (v, i) = CONST_DOUBLE_FROM_REAL_VALUE (TREE_REAL_CST (elt),
+ RTVEC_ELT (v, i) = const_double_from_real_value (TREE_REAL_CST (elt),
inner);
else if (TREE_CODE (elt) == FIXED_CST)
RTVEC_ELT (v, i) = CONST_FIXED_FROM_FIXED_VALUE (TREE_FIXED_CST (elt),
real_2expN (&offset, GET_MODE_PRECISION (GET_MODE (from)), fmode);
temp = expand_binop (fmode, add_optab, target,
- CONST_DOUBLE_FROM_REAL_VALUE (offset, fmode),
+ const_double_from_real_value (offset, fmode),
target, 0, OPTAB_LIB_WIDEN);
if (temp != target)
emit_move_insn (target, temp);
bitsize = GET_MODE_PRECISION (GET_MODE (to));
real_2expN (&offset, bitsize - 1, fmode);
- limit = CONST_DOUBLE_FROM_REAL_VALUE (offset, fmode);
+ limit = const_double_from_real_value (offset, fmode);
lab1 = gen_label_rtx ();
lab2 = gen_label_rtx ();
real_from_string2 (s, m)
#define CONST_DOUBLE_ATOF(s, m) \
- CONST_DOUBLE_FROM_REAL_VALUE (real_from_string2 (s, m), m)
+ const_double_from_real_value (real_from_string2 (s, m), m)
#define REAL_VALUE_FIX(r) \
real_to_integer (&(r))
((to) = *CONST_DOUBLE_REAL_VALUE (from))
/* Return a CONST_DOUBLE with value R and mode M. */
-#define CONST_DOUBLE_FROM_REAL_VALUE(r, m) \
- const_double_from_real_value (r, m)
extern rtx const_double_from_real_value (REAL_VALUE_TYPE, machine_mode);
/* Replace R by 1/R in the given machine mode, if the result is exact. */
REAL_VALUE_TYPE r;
real_nan (&r, "", 1, SFmode);
- not_a_num = CONST_DOUBLE_FROM_REAL_VALUE (r, SFmode);
+ not_a_num = const_double_from_real_value (r, SFmode);
not_a_num = force_const_mem (SFmode, not_a_num);
}
REAL_VALUE_TYPE d;
REAL_VALUE_FROM_CONST_DOUBLE (d, c);
- return CONST_DOUBLE_FROM_REAL_VALUE (d, GET_MODE (x));
+ return const_double_from_real_value (d, GET_MODE (x));
}
return x;
real_from_integer (&d, mode, std::make_pair (op, op_mode), SIGNED);
d = real_value_truncate (mode, d);
- return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
+ return const_double_from_real_value (d, mode);
}
else if (code == UNSIGNED_FLOAT && CONST_SCALAR_INT_P (op))
{
real_from_integer (&d, mode, std::make_pair (op, op_mode), UNSIGNED);
d = real_value_truncate (mode, d);
- return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
+ return const_double_from_real_value (d, mode);
}
if (CONST_SCALAR_INT_P (op) && width > 0)
default:
gcc_unreachable ();
}
- return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
+ return const_double_from_real_value (d, mode);
}
else if (CONST_DOUBLE_AS_FLOAT_P (op)
&& SCALAR_FLOAT_MODE_P (GET_MODE (op))
&& !real_equal (&d, &dconst0))
{
real_arithmetic (&d, RDIV_EXPR, &dconst1, &d);
- tem = CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
+ tem = const_double_from_real_value (d, mode);
return simplify_gen_binary (MULT, mode, op0, tem);
}
}
}
}
real_from_target (&r, tmp0, mode);
- return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
+ return const_double_from_real_value (r, mode);
}
else
{
&& (inexact || !real_identical (&result, &value)))
return NULL_RTX;
- return CONST_DOUBLE_FROM_REAL_VALUE (result, mode);
+ return const_double_from_real_value (result, mode);
}
}
{
REAL_VALUE_TYPE val;
val = FLOAT_STORE_FLAG_VALUE (mode);
- return CONST_DOUBLE_FROM_REAL_VALUE (val, mode);
+ return const_double_from_real_value (val, mode);
}
#else
return NULL_RTX;
}
real_from_target (&r, tmp, outer_submode);
- elems[elem] = CONST_DOUBLE_FROM_REAL_VALUE (r, outer_submode);
+ elems[elem] = const_double_from_real_value (r, outer_submode);
}
break;