GCC Middle and Back End API Reference
fold-const-call.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "realmpfr.h"
#include "tree.h"
#include "stor-layout.h"
#include "options.h"
#include "fold-const.h"
#include "fold-const-call.h"
#include "case-cfn-macros.h"
#include "tm.h"
#include "builtins.h"
#include "gimple-expr.h"
#include "tree-vector-builder.h"
Include dependency graph for fold-const-call.cc:

Functions

static bool integer_cst_p (tree t)
 
static bool real_cst_p (tree t)
 
static bool complex_cst_p (tree t)
 
static bool size_t_cst_p (tree t, unsigned HOST_WIDE_INT *size_out)
 
tree build_cmp_result (tree type, int res)
 
static bool do_mpfr_ckconv (real_value *result, mpfr_srcptr m, bool inexact, const real_format *format)
 
static bool do_mpfr_arg1 (real_value *result, int(*func)(mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), const real_value *arg, const real_format *format)
 
static bool do_mpfr_sincos (real_value *result_sin, real_value *result_cos, const real_value *arg, const real_format *format)
 
static bool do_mpfr_arg2 (real_value *result, int(*func)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), const real_value *arg0, const real_value *arg1, const real_format *format)
 
static bool do_mpfr_arg2 (real_value *result, int(*func)(mpfr_ptr, long, mpfr_srcptr, mpfr_rnd_t), const wide_int_ref &arg0, const real_value *arg1, const real_format *format)
 
static bool do_mpfr_arg3 (real_value *result, int(*func)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), const real_value *arg0, const real_value *arg1, const real_value *arg2, const real_format *format)
 
static bool do_mpc_ckconv (real_value *result_real, real_value *result_imag, mpc_srcptr m, bool inexact, const real_format *format)
 
static bool do_mpc_arg1 (real_value *result_real, real_value *result_imag, int(*func)(mpc_ptr, mpc_srcptr, mpc_rnd_t), const real_value *arg_real, const real_value *arg_imag, const real_format *format)
 
static bool do_mpc_arg2 (real_value *result_real, real_value *result_imag, int(*func)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t), const real_value *arg0_real, const real_value *arg0_imag, const real_value *arg1_real, const real_value *arg1_imag, const real_format *format)
 
static bool fold_const_logb (real_value *result, const real_value *arg, const real_format *format)
 
static bool fold_const_significand (real_value *result, const real_value *arg, const real_format *format)
 
static bool fold_const_conversion (wide_int *result, void(*fn)(real_value *, format_helper, const real_value *), const real_value *arg, unsigned int precision, const real_format *format)
 
static bool fold_const_pow (real_value *result, const real_value *arg0, const real_value *arg1, const real_format *format)
 
static bool fold_const_nextafter (real_value *result, const real_value *arg0, const real_value *arg1, const real_format *format)
 
static bool fold_const_builtin_load_exponent (real_value *result, const real_value *arg0, const wide_int_ref &arg1, const real_format *format)
 
static tree fold_const_builtin_nan (tree type, tree arg, bool quiet)
 
static tree fold_const_reduction (tree type, tree arg, tree_code code)
 
static tree fold_const_vec_convert (tree ret_type, tree arg)
 
static tree fold_while_ult (tree type, poly_uint64 arg0, poly_uint64 arg1)
 
static bool fold_const_call_ss (real_value *result, combined_fn fn, const real_value *arg, const real_format *format)
 
static bool fold_const_call_ss (wide_int *result, combined_fn fn, const real_value *arg, unsigned int precision, const real_format *format)
 
static bool fold_const_call_ss (wide_int *result, combined_fn fn, const wide_int_ref &arg, unsigned int precision, tree arg_type)
 
static bool fold_const_call_cs (real_value *result_real, real_value *result_imag, combined_fn fn, const real_value *arg, const real_format *format)
 
static bool fold_const_call_sc (real_value *result, combined_fn fn, const real_value *arg_real, const real_value *arg_imag, const real_format *format)
 
static bool fold_const_call_cc (real_value *result_real, real_value *result_imag, combined_fn fn, const real_value *arg_real, const real_value *arg_imag, const real_format *format)
 
static tree fold_const_call_1 (combined_fn fn, tree type, tree arg)
 
tree fold_const_call (combined_fn fn, tree type, tree arg)
 
static tree fold_const_fold_left (tree type, tree arg0, tree arg1, tree_code code)
 
static bool fold_const_call_sss (real_value *result, combined_fn fn, const real_value *arg0, const real_value *arg1, const real_format *format)
 
static bool fold_const_call_sss (real_value *result, combined_fn fn, const real_value *arg0, const wide_int_ref &arg1, const real_format *format)
 
static bool fold_const_call_sss (real_value *result, combined_fn fn, const wide_int_ref &arg0, const real_value *arg1, const real_format *format)
 
static bool fold_const_call_sss (wide_int *result, combined_fn fn, const wide_int_ref &arg0, const wide_int_ref &arg1, unsigned int precision, tree arg_type)
 
static bool fold_const_call_ccc (real_value *result_real, real_value *result_imag, combined_fn fn, const real_value *arg0_real, const real_value *arg0_imag, const real_value *arg1_real, const real_value *arg1_imag, const real_format *format)
 
static tree fold_const_call_1 (combined_fn fn, tree type, tree arg0, tree arg1)
 
tree fold_const_call (combined_fn fn, tree type, tree arg0, tree arg1)
 
static bool fold_const_call_ssss (real_value *result, combined_fn fn, const real_value *arg0, const real_value *arg1, const real_value *arg2, const real_format *format)
 
static tree fold_const_call_1 (combined_fn fn, tree type, tree arg0, tree arg1, tree arg2)
 
tree fold_const_call (combined_fn fn, tree type, tree arg0, tree arg1, tree arg2)
 

Function Documentation

◆ build_cmp_result()

tree build_cmp_result ( tree type,
int res )
RES is the result of a comparison in which < 0 means "less", 0 means
"equal" and > 0 means "more".  Canonicalize it to -1, 0 or 1 and
return it in type TYPE.   

References build_int_cst(), and ggc_alloc().

Referenced by fold_const_call(), fold_const_call(), and gimple_fold_builtin_string_compare().

◆ complex_cst_p()

static bool complex_cst_p ( tree t)
inlinestatic

References ggc_alloc(), and TREE_CODE.

Referenced by fold_const_call_1(), and fold_const_call_1().

◆ do_mpc_arg1()

static bool do_mpc_arg1 ( real_value * result_real,
real_value * result_imag,
int(*)(mpc_ptr, mpc_srcptr, mpc_rnd_t) func,
const real_value * arg_real,
const real_value * arg_imag,
const real_format * format )
static
Try to evaluate:

   RESULT = f (ARG)

in format FORMAT, given that FUNC is the mpc implementation of f.
Return true on success.  Both RESULT and ARG are represented as
real and imaginary pairs.   

References real_format::b, do_mpc_ckconv(), ggc_alloc(), mpfr_from_real(), real_format::p, real_isfinite(), and real_format::round_towards_zero.

Referenced by fold_const_call_cc().

◆ do_mpc_arg2()

static bool do_mpc_arg2 ( real_value * result_real,
real_value * result_imag,
int(*)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t) func,
const real_value * arg0_real,
const real_value * arg0_imag,
const real_value * arg1_real,
const real_value * arg1_imag,
const real_format * format )
static
Try to evaluate:

   RESULT = f (ARG0, ARG1)

in format FORMAT, given that FUNC is the mpc implementation of f.
Return true on success.  RESULT, ARG0 and ARG1 are represented as
real and imaginary pairs.   

References do_mpc_ckconv(), ggc_alloc(), mpfr_from_real(), real_format::p, real_isfinite(), and real_format::round_towards_zero.

Referenced by fold_const_call_ccc().

◆ do_mpc_ckconv()

static bool do_mpc_ckconv ( real_value * result_real,
real_value * result_imag,
mpc_srcptr m,
bool inexact,
const real_format * format )
static
M is the result of trying to constant-fold an expression (starting
with clear MPFR flags) and INEXACT says whether the result in M is
exact or inexact.  Return true if M can be used as a constant-folded
result in which the real and imaginary parts have format FORMAT.
Store those parts in *RESULT_REAL and *RESULT_IMAG if so.   

References ggc_alloc(), real_convert(), real_from_mpfr(), real_identical(), real_isfinite(), REAL_VALUE_TYPE, and rvc_zero.

Referenced by do_mpc_arg1(), and do_mpc_arg2().

◆ do_mpfr_arg1()

static bool do_mpfr_arg1 ( real_value * result,
int(*)(mpfr_ptr, mpfr_srcptr, mpfr_rnd_t) func,
const real_value * arg,
const real_format * format )
static
Try to evaluate:

   *RESULT = f (*ARG)

in format FORMAT, given that FUNC is the MPFR implementation of f.
Return true on success.   

References real_format::b, do_mpfr_ckconv(), ggc_alloc(), mpfr_from_real(), real_format::p, real_isfinite(), and real_format::round_towards_zero.

Referenced by fold_const_call_ss().

◆ do_mpfr_arg2() [1/2]

static bool do_mpfr_arg2 ( real_value * result,
int(*)(mpfr_ptr, long, mpfr_srcptr, mpfr_rnd_t) func,
const wide_int_ref & arg0,
const real_value * arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = f (ARG0, *ARG1)

in format FORMAT, given that FUNC is the MPFR implementation of f.
Return true on success.   

References real_format::b, do_mpfr_ckconv(), ggc_alloc(), mpfr_from_real(), real_format::p, real_isfinite(), and real_format::round_towards_zero.

◆ do_mpfr_arg2() [2/2]

static bool do_mpfr_arg2 ( real_value * result,
int(*)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t) func,
const real_value * arg0,
const real_value * arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = f (*ARG0, *ARG1)

in format FORMAT, given that FUNC is the MPFR implementation of f.
Return true on success.   

References real_format::b, do_mpfr_ckconv(), ggc_alloc(), mpfr_from_real(), NULL, real_format::p, real_isfinite(), and real_format::round_towards_zero.

Referenced by fold_const_call_sc(), fold_const_call_sss(), fold_const_call_sss(), and fold_const_pow().

◆ do_mpfr_arg3()

static bool do_mpfr_arg3 ( real_value * result,
int(*)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t) func,
const real_value * arg0,
const real_value * arg1,
const real_value * arg2,
const real_format * format )
static
Try to evaluate:

   *RESULT = f (*ARG0, *ARG1, *ARG2)

in format FORMAT, given that FUNC is the MPFR implementation of f.
Return true on success.   

References real_format::b, do_mpfr_ckconv(), ggc_alloc(), mpfr_from_real(), NULL, real_format::p, real_isfinite(), and real_format::round_towards_zero.

Referenced by fold_const_call_ssss().

◆ do_mpfr_ckconv()

static bool do_mpfr_ckconv ( real_value * result,
mpfr_srcptr m,
bool inexact,
const real_format * format )
static
M is the result of trying to constant-fold an expression (starting
with clear MPFR flags) and INEXACT says whether the result in M is
exact or inexact.  Return true if M can be used as a constant-folded
result in format FORMAT, storing the value in *RESULT if so.   

References ggc_alloc(), real_convert(), real_from_mpfr(), real_identical(), real_isfinite(), REAL_VALUE_TYPE, and rvc_zero.

Referenced by do_mpfr_arg1(), do_mpfr_arg2(), do_mpfr_arg2(), do_mpfr_arg3(), and do_mpfr_sincos().

◆ do_mpfr_sincos()

static bool do_mpfr_sincos ( real_value * result_sin,
real_value * result_cos,
const real_value * arg,
const real_format * format )
static
Try to evaluate:

   *RESULT_SIN = sin (*ARG);
   *RESULT_COS = cos (*ARG);

for format FORMAT.  Return true on success.   

References real_format::b, do_mpfr_ckconv(), ggc_alloc(), mpfr_from_real(), NULL, real_format::p, real_isfinite(), and real_format::round_towards_zero.

Referenced by fold_const_call_cs().

◆ fold_const_builtin_load_exponent()

static bool fold_const_builtin_load_exponent ( real_value * result,
const real_value * arg0,
const wide_int_ref & arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = ldexp (*ARG0, ARG1)

in format FORMAT.  Return true on success.   

References real_format::emax, real_format::emin, wi::ges_p(), ggc_alloc(), wi::les_p(), real_equal(), real_isinf(), real_ldexp(), REAL_VALUE_ISSIGNALING_NAN, real_value_truncate(), and REAL_VALUE_TYPE.

Referenced by fold_const_call_sss().

◆ fold_const_builtin_nan()

static tree fold_const_builtin_nan ( tree type,
tree arg,
bool quiet )
static
Fold a call to __builtin_nan or __builtin_nans with argument ARG and
return type TYPE.  QUIET is true if a quiet rather than signalling
NaN is required.   

References build_real(), c_getstr(), ggc_alloc(), NULL_TREE, real_nan(), REAL_VALUE_TYPE, and TYPE_MODE.

Referenced by fold_const_call().

◆ fold_const_call() [1/3]

◆ fold_const_call() [2/3]

tree fold_const_call ( combined_fn fn,
tree type,
tree arg0,
tree arg1 )
Try to fold FN (ARG0, ARG1) to a constant.  Return the constant on success,
otherwise return null.  TYPE is the type of the return value.   

References arith_overflowed_p(), build_cmp_result(), build_complex(), build_int_cst(), c_getstr(), drop_tree_overflow(), fold_build_pointer_plus_hwi, fold_const_call_1(), fold_const_fold_left(), fold_convert, ggc_alloc(), int_const_binop(), integer_cst_p(), NULL, NULL_TREE, r, target_char_cst_p(), TREE_CODE, TREE_OVERFLOW, TREE_TYPE, and type().

◆ fold_const_call() [3/3]

tree fold_const_call ( combined_fn fn,
tree type,
tree arg0,
tree arg1,
tree arg2 )

◆ fold_const_call_1() [1/3]

◆ fold_const_call_1() [2/3]

◆ fold_const_call_1() [3/3]

static tree fold_const_call_1 ( combined_fn fn,
tree type,
tree arg0,
tree arg1,
tree arg2 )
static
Subroutine of fold_const_call, with the same interface.  Handle cases
where the arguments and result are numerical.   

References build_real(), fold_const_call_ssss(), gcc_checking_assert, ggc_alloc(), NULL_TREE, real_cst_p(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, SCALAR_FLOAT_MODE_P, TREE_REAL_CST_PTR, TREE_TYPE, and TYPE_MODE.

◆ fold_const_call_cc()

static bool fold_const_call_cc ( real_value * result_real,
real_value * result_imag,
combined_fn fn,
const real_value * arg_real,
const real_value * arg_imag,
const real_format * format )
static
Try to evaluate:

   RESULT = fn (ARG)

where FORMAT is the format of the real and imaginary parts of RESULT
(RESULT_REAL and RESULT_IMAG) and of ARG (ARG_REAL and ARG_IMAG).
Return true on success.   

References dconst0, dconstinf, do_mpc_arg1(), ggc_alloc(), and real_isinf().

Referenced by fold_const_call_1().

◆ fold_const_call_ccc()

static bool fold_const_call_ccc ( real_value * result_real,
real_value * result_imag,
combined_fn fn,
const real_value * arg0_real,
const real_value * arg0_imag,
const real_value * arg1_real,
const real_value * arg1_imag,
const real_format * format )
static
Try to evaluate:

   RESULT = fn (ARG0, ARG1)

where FORMAT is the format of the real and imaginary parts of RESULT
(RESULT_REAL and RESULT_IMAG), of ARG0 (ARG0_REAL and ARG0_IMAG)
and of ARG1 (ARG1_REAL and ARG1_IMAG).  Return true on success.   

References do_mpc_arg2(), and ggc_alloc().

Referenced by fold_const_call_1().

◆ fold_const_call_cs()

static bool fold_const_call_cs ( real_value * result_real,
real_value * result_imag,
combined_fn fn,
const real_value * arg,
const real_format * format )
static
Try to evaluate:

   RESULT = FN (*ARG)

where FORMAT is the format of ARG and of the real and imaginary parts
of RESULT, passed as RESULT_REAL and RESULT_IMAG respectively.  Return
true on success.   

References do_mpfr_sincos(), and ggc_alloc().

Referenced by fold_const_call_1().

◆ fold_const_call_sc()

static bool fold_const_call_sc ( real_value * result,
combined_fn fn,
const real_value * arg_real,
const real_value * arg_imag,
const real_format * format )
static
Try to evaluate:

   *RESULT = fn (ARG)

where FORMAT is the format of RESULT and of the real and imaginary parts
of ARG, passed as ARG_REAL and ARG_IMAG respectively.  Return true on
success.   

References do_mpfr_arg2(), and ggc_alloc().

Referenced by fold_const_call_1().

◆ fold_const_call_ss() [1/3]

static bool fold_const_call_ss ( real_value * result,
combined_fn fn,
const real_value * arg,
const real_format * format )
static

◆ fold_const_call_ss() [2/3]

static bool fold_const_call_ss ( wide_int * result,
combined_fn fn,
const real_value * arg,
unsigned int precision,
const real_format * format )
static
Try to evaluate:

   *RESULT = FN (*ARG)

where FORMAT is the format of ARG and PRECISION is the number of
significant bits in the result.  Return true on success.   

References real_format::b, real_value::cl, fold_const_conversion(), ggc_alloc(), wi::one(), real_ceil(), REAL_EXP, real_floor(), real_isfinite(), real_isinf(), real_isnan(), real_isneg(), real_issignaling_nan(), real_round(), rvc_normal, wi::shwi(), real_value::sign, and wi::zero().

◆ fold_const_call_ss() [3/3]

static bool fold_const_call_ss ( wide_int * result,
combined_fn fn,
const wide_int_ref & arg,
unsigned int precision,
tree arg_type )
static
Try to evaluate:

   *RESULT = FN (ARG)

where ARG_TYPE is the type of ARG and PRECISION is the number of bits
in the result.  Return true on success.   

References arg_type, wi::bswap(), wi::clrsb(), wi::clz(), CLZ_DEFINED_VALUE_AT_ZERO, wi::ctz(), CTZ_DEFINED_VALUE_AT_ZERO, wi::ffs(), wide_int_storage::from(), ggc_alloc(), wi::ne_p(), wi::parity(), wi::popcount(), SCALAR_INT_TYPE_MODE, wi::shwi(), TREE_CODE, TYPE_PRECISION, and TYPE_SIGN.

◆ fold_const_call_sss() [1/4]

static bool fold_const_call_sss ( real_value * result,
combined_fn fn,
const real_value * arg0,
const real_value * arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = FN (*ARG0, *ARG1)

in format FORMAT.  Return true on success.   

References do_mpfr_arg2(), fold_const_nextafter(), fold_const_pow(), ggc_alloc(), and real_copysign().

Referenced by fold_const_call_1().

◆ fold_const_call_sss() [2/4]

static bool fold_const_call_sss ( real_value * result,
combined_fn fn,
const real_value * arg0,
const wide_int_ref & arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = FN (*ARG0, ARG1)

where FORMAT is the format of *RESULT and *ARG0.  Return true on
success.   

References real_format::b, fold_const_builtin_load_exponent(), ggc_alloc(), real_powi(), and REAL_VALUE_ISSIGNALING_NAN.

◆ fold_const_call_sss() [3/4]

static bool fold_const_call_sss ( real_value * result,
combined_fn fn,
const wide_int_ref & arg0,
const real_value * arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = FN (ARG0, *ARG1)

where FORMAT is the format of *RESULT and *ARG1.  Return true on
success.   

References dconst0, do_mpfr_arg2(), ggc_alloc(), and real_compare().

◆ fold_const_call_sss() [4/4]

static bool fold_const_call_sss ( wide_int * result,
combined_fn fn,
const wide_int_ref & arg0,
const wide_int_ref & arg1,
unsigned int precision,
tree arg_type )
static
Try to evaluate:

   *RESULT = FN (ARG0, ARG1)

where ARG_TYPE is the type of ARG0 and PRECISION is the number of bits in
the result.  Return true on success.   

References wi::clz(), wi::ctz(), ggc_alloc(), wi::ne_p(), and wi::shwi().

◆ fold_const_call_ssss()

static bool fold_const_call_ssss ( real_value * result,
combined_fn fn,
const real_value * arg0,
const real_value * arg1,
const real_value * arg2,
const real_format * format )
static
Try to evaluate:

   *RESULT = FN (*ARG0, *ARG1, *ARG2)

in format FORMAT.  Return true on success.   

References do_mpfr_arg3(), ggc_alloc(), and real_value_negate().

Referenced by fold_const_call_1().

◆ fold_const_conversion()

static bool fold_const_conversion ( wide_int * result,
void(*)(real_value *, format_helper, const real_value *) fn,
const real_value * arg,
unsigned int precision,
const real_format * format )
static
Try to evaluate:

   *RESULT = f (*ARG)

where FORMAT is the format of *ARG and PRECISION is the number of
significant bits in the result.  Return true on success.   

References ggc_alloc(), real_isfinite(), and real_to_integer().

Referenced by fold_const_call_ss().

◆ fold_const_fold_left()

static tree fold_const_fold_left ( tree type,
tree arg0,
tree arg1,
tree_code code )
static
Fold a call to IFN_FOLD_LEFT_<CODE> (ARG0, ARG1), returning a value
of type TYPE.   

References const_binop(), CONSTANT_CLASS_P, ggc_alloc(), i, NULL_TREE, TREE_CODE, VECTOR_CST_ELT, and VECTOR_CST_NELTS.

Referenced by fold_const_call().

◆ fold_const_logb()

static bool fold_const_logb ( real_value * result,
const real_value * arg,
const real_format * format )
static
Try to evaluate:

   *RESULT = logb (*ARG)

in format FORMAT.  Return true on success.   

References real_format::b, real_value::cl, REAL_EXP, real_from_integer(), rvc_inf, rvc_nan, rvc_normal, rvc_zero, real_value::sign, and SIGNED.

Referenced by fold_const_call_ss().

◆ fold_const_nextafter()

static bool fold_const_nextafter ( real_value * result,
const real_value * arg0,
const real_value * arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = nextafter (*ARG0, *ARG1)

or

   *RESULT = nexttoward (*ARG0, *ARG1)

in format FORMAT.  Return true on success.   

References real_format::b, real_value::cl, ggc_alloc(), real_format::has_denorm, real_format::has_inf, real_format::p, real_format::pnan, real_convert(), real_nextafter(), REAL_VALUE_ISSIGNALING_NAN, and rvc_zero.

Referenced by fold_const_call_sss().

◆ fold_const_pow()

static bool fold_const_pow ( real_value * result,
const real_value * arg0,
const real_value * arg1,
const real_format * format )
static
Try to evaluate:

   *RESULT = pow (*ARG0, *ARG1)

in format FORMAT.  Return true on success.   

References dconst0, do_mpfr_arg2(), ggc_alloc(), real_equal(), real_from_integer(), real_identical(), real_powi(), real_to_integer(), REAL_VALUE_ISSIGNALING_NAN, REAL_VALUE_TYPE, and SIGNED.

Referenced by fold_const_call_sss().

◆ fold_const_reduction()

static tree fold_const_reduction ( tree type,
tree arg,
tree_code code )
static
Fold a call to IFN_REDUC_<CODE> (ARG), returning a value of type TYPE.   

References const_binop(), CONSTANT_CLASS_P, ggc_alloc(), i, NULL_TREE, TREE_CODE, VECTOR_CST_ELT, and VECTOR_CST_NELTS.

Referenced by fold_const_call().

◆ fold_const_significand()

static bool fold_const_significand ( real_value * result,
const real_value * arg,
const real_format * format )
static
Try to evaluate:

   *RESULT = significand (*ARG)

in format FORMAT.  Return true on success.   

References real_format::b, real_value::cl, rvc_inf, rvc_nan, rvc_normal, rvc_zero, and SET_REAL_EXP.

Referenced by fold_const_call_ss().

◆ fold_const_vec_convert()

◆ fold_while_ult()

static tree fold_while_ult ( tree type,
poly_uint64 arg0,
poly_uint64 arg1 )
static
Try to evaluate:

   IFN_WHILE_ULT (ARG0, ARG1, (TYPE) { ... })

Return the value on success and null on failure.   

References build_all_ones_cst(), build_minus_one_cst(), build_vector_a_then_b(), build_zero_cst(), ggc_alloc(), known_ge, known_le, maybe_ge, NULL_TREE, TREE_TYPE, and TYPE_VECTOR_SUBPARTS().

Referenced by fold_const_call().

◆ integer_cst_p()

static bool integer_cst_p ( tree t)
inlinestatic
Constant folding for calls to built-in and internal functions.
   Copyright (C) 1988-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Functions that test for certain constant types, abstracting away the
decision about whether to check for overflow.   

References ggc_alloc(), TREE_CODE, and TREE_OVERFLOW.

Referenced by fold_const_call(), fold_const_call(), fold_const_call_1(), fold_const_call_1(), and size_t_cst_p().

◆ real_cst_p()

static bool real_cst_p ( tree t)
inlinestatic

◆ size_t_cst_p()

static bool size_t_cst_p ( tree t,
unsigned HOST_WIDE_INT * size_out )
inlinestatic
Return true if ARG is a size_type_node constant.
Store it in *SIZE_OUT if so.   

References ggc_alloc(), integer_cst_p(), size_type_node, tree_fits_uhwi_p(), tree_to_uhwi(), TREE_TYPE, and types_compatible_p().

Referenced by fold_const_call().