GCC Middle and Back End API Reference
real.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  real_value
 
struct  real_format
 
class  format_helper
 

Macros

#define SIGNIFICAND_BITS   (128 + HOST_BITS_PER_LONG)
 
#define EXP_BITS   (32 - 6)
 
#define MAX_EXP   ((1 << (EXP_BITS - 1)) - 1)
 
#define SIGSZ   (SIGNIFICAND_BITS / HOST_BITS_PER_LONG)
 
#define SIG_MSB   ((unsigned long)1 << (HOST_BITS_PER_LONG - 1))
 
#define REAL_EXP(REAL)
 
#define SET_REAL_EXP(REAL, EXP)
 
#define REAL_VALUE_TYPE   struct real_value
 
#define REAL_VALUE_TYPE_SIZE   (SIGNIFICAND_BITS + 32)
 
#define REAL_WIDTH
 
#define REAL_MODE_FORMAT(MODE)
 
#define FLOAT_MODE_FORMAT(MODE)
 
#define MODE_COMPOSITE_P(MODE)
 
#define MODE_HAS_NANS(MODE)
 
#define MODE_HAS_INFINITIES(MODE)
 
#define MODE_HAS_SIGNED_ZEROS(MODE)
 
#define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE)
 
#define REAL_VALUE_ISINF(x)
 
#define REAL_VALUE_ISNAN(x)
 
#define REAL_VALUE_ISSIGNALING_NAN(x)
 
#define REAL_VALUE_NEGATIVE(x)
 
#define REAL_VALUE_MINUS_ZERO(x)
 
#define REAL_VALUE_TO_TARGET_LONG_DOUBLE(IN, OUT)
 
#define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT)
 
#define REAL_VALUE_TO_TARGET_SINGLE(IN, OUT)
 
#define REAL_VALUE_TO_TARGET_DECIMAL128(IN, OUT)
 
#define REAL_VALUE_TO_TARGET_DECIMAL64(IN, OUT)
 
#define REAL_VALUE_TO_TARGET_DECIMAL32(IN, OUT)
 
#define REAL_VALUE_ATOF(s, m)
 
#define CONST_DOUBLE_ATOF(s, m)
 
#define REAL_VALUE_FIX(r)
 
#define REAL_VALUE_UNSIGNED_FIX(r)
 
#define dconst_e()
 
#define dconst_third()
 
#define dconst_quarter()
 
#define dconst_sixth()
 
#define dconst_ninth()
 
#define dconst_sqrt2()
 
#define dconst_pi()
 

Enumerations

enum  real_value_class { rvc_zero , rvc_normal , rvc_inf , rvc_nan }
 

Functions

bool HONOR_NANS (machine_mode)
 
bool HONOR_NANS (const_tree)
 
bool HONOR_NANS (const_rtx)
 
bool HONOR_SNANS (machine_mode)
 
bool HONOR_SNANS (const_tree)
 
bool HONOR_SNANS (const_rtx)
 
bool HONOR_INFINITIES (machine_mode)
 
bool HONOR_INFINITIES (const_tree)
 
bool HONOR_INFINITIES (const_rtx)
 
bool HONOR_SIGNED_ZEROS (machine_mode)
 
bool HONOR_SIGNED_ZEROS (const_tree)
 
bool HONOR_SIGNED_ZEROS (const_rtx)
 
bool HONOR_SIGN_DEPENDENT_ROUNDING (machine_mode)
 
bool HONOR_SIGN_DEPENDENT_ROUNDING (const_tree)
 
bool HONOR_SIGN_DEPENDENT_ROUNDING (const_rtx)
 
bool real_arithmetic (REAL_VALUE_TYPE *, int, const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
 
bool real_compare (int, const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
 
bool real_isinf (const REAL_VALUE_TYPE *)
 
bool real_isinf (const REAL_VALUE_TYPE *, bool sign)
 
bool real_isnan (const REAL_VALUE_TYPE *)
 
bool real_issignaling_nan (const REAL_VALUE_TYPE *)
 
bool real_isdenormal (const REAL_VALUE_TYPE *r, machine_mode mode)
 
bool real_isfinite (const REAL_VALUE_TYPE *)
 
bool real_isneg (const REAL_VALUE_TYPE *)
 
bool real_isnegzero (const REAL_VALUE_TYPE *)
 
bool real_iszero (const REAL_VALUE_TYPE *)
 
bool real_iszero (const REAL_VALUE_TYPE *, bool sign)
 
bool real_identical (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
 
bool real_equal (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
 
bool real_less (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
 
void real_convert (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *)
 
bool exact_real_truncate (format_helper, const REAL_VALUE_TYPE *)
 
void real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int)
 
void real_to_decimal_for_mode (char *, const REAL_VALUE_TYPE *, size_t, size_t, int, machine_mode)
 
void real_to_hexadecimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int)
 
HOST_WIDE_INT real_to_integer (const REAL_VALUE_TYPE *)
 
int real_from_string (REAL_VALUE_TYPE *, const char *)
 
void real_from_string3 (REAL_VALUE_TYPE *, const char *, format_helper)
 
long real_to_target (long *, const REAL_VALUE_TYPE *, format_helper)
 
void real_from_target (REAL_VALUE_TYPE *, const long *, format_helper)
 
void real_inf (REAL_VALUE_TYPE *, bool sign=false)
 
bool real_nan (REAL_VALUE_TYPE *, const char *, int, format_helper)
 
void real_maxval (REAL_VALUE_TYPE *, int, machine_mode)
 
void real_2expN (REAL_VALUE_TYPE *, int, format_helper)
 
unsigned int real_hash (const REAL_VALUE_TYPE *)
 
REAL_VALUE_TYPE real_value_truncate (format_helper, REAL_VALUE_TYPE)
 
REAL_VALUE_TYPE real_value_negate (const REAL_VALUE_TYPE *)
 
REAL_VALUE_TYPE real_value_abs (const REAL_VALUE_TYPE *)
 
int significand_size (format_helper)
 
REAL_VALUE_TYPE real_from_string2 (const char *, format_helper)
 
int real_exponent (const REAL_VALUE_TYPE *)
 
void real_ldexp (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int)
 
const REAL_VALUE_TYPEdconst_e_ptr (void)
 
const REAL_VALUE_TYPEdconst_pi_ptr (void)
 
const REAL_VALUE_TYPEdconst_third_ptr (void)
 
const REAL_VALUE_TYPEdconst_quarter_ptr (void)
 
const REAL_VALUE_TYPEdconst_sixth_ptr (void)
 
const REAL_VALUE_TYPEdconst_ninth_ptr (void)
 
const REAL_VALUE_TYPEdconst_sqrt2_ptr (void)
 
REAL_VALUE_TYPE real_value_from_int_cst (const_tree, const_tree)
 
rtx const_double_from_real_value (REAL_VALUE_TYPE, machine_mode)
 
bool exact_real_inverse (format_helper, REAL_VALUE_TYPE *)
 
bool real_can_shorten_arithmetic (machine_mode, machine_mode)
 
tree build_real (tree, REAL_VALUE_TYPE)
 
tree build_real_truncate (tree, REAL_VALUE_TYPE)
 
bool real_powi (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *, HOST_WIDE_INT)
 
void real_trunc (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *)
 
void real_floor (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *)
 
void real_ceil (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *)
 
void real_round (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *)
 
void real_roundeven (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *)
 
void real_copysign (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
 
bool real_isinteger (const REAL_VALUE_TYPE *, format_helper)
 
bool real_isinteger (const REAL_VALUE_TYPE *, HOST_WIDE_INT *)
 
bool real_nextafter (REAL_VALUE_TYPE *, format_helper, const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
 
void get_max_float (const struct real_format *, char *, size_t, bool)
 
wide_int real_to_integer (const REAL_VALUE_TYPE *, bool *, int)
 
void real_from_integer (REAL_VALUE_TYPE *, format_helper, const wide_int_ref &, signop)
 
void build_sinatan_real (REAL_VALUE_TYPE *, tree)
 

Variables

char test_real_width [sizeof(REAL_VALUE_TYPE)<=REAL_WIDTH *sizeof(HOST_WIDE_INT) ? 1 :-1]
 
const struct real_formatreal_format_for_mode [NUM_MODE_FLOAT+NUM_MODE_DECIMAL_FLOAT]
 
const struct real_format ieee_single_format
 
const struct real_format mips_single_format
 
const struct real_format motorola_single_format
 
const struct real_format spu_single_format
 
const struct real_format ieee_double_format
 
const struct real_format mips_double_format
 
const struct real_format motorola_double_format
 
const struct real_format ieee_extended_motorola_format
 
const struct real_format ieee_extended_intel_96_format
 
const struct real_format ieee_extended_intel_96_round_53_format
 
const struct real_format ieee_extended_intel_128_format
 
const struct real_format ibm_extended_format
 
const struct real_format mips_extended_format
 
const struct real_format ieee_quad_format
 
const struct real_format mips_quad_format
 
const struct real_format vax_f_format
 
const struct real_format vax_d_format
 
const struct real_format vax_g_format
 
const struct real_format real_internal_format
 
const struct real_format decimal_single_format
 
const struct real_format decimal_double_format
 
const struct real_format decimal_quad_format
 
const struct real_format ieee_half_format
 
const struct real_format arm_half_format
 
const struct real_format arm_bfloat_half_format
 
REAL_VALUE_TYPE dconst0
 
REAL_VALUE_TYPE dconst1
 
REAL_VALUE_TYPE dconst2
 
REAL_VALUE_TYPE dconstm0
 
REAL_VALUE_TYPE dconstm1
 
REAL_VALUE_TYPE dconsthalf
 
REAL_VALUE_TYPE dconstinf
 
REAL_VALUE_TYPE dconstninf
 

Macro Definition Documentation

◆ CONST_DOUBLE_ATOF

#define CONST_DOUBLE_ATOF ( s,
m )
Value:
REAL_VALUE_TYPE real_from_string2(const char *, format_helper)
Definition real.cc:2195
rtx const_double_from_real_value(REAL_VALUE_TYPE, machine_mode)
Definition emit-rtl.cc:573

◆ dconst_e

#define dconst_e ( )
Value:
const REAL_VALUE_TYPE * dconst_e_ptr(void)
Definition real.cc:2465

◆ dconst_ninth

#define dconst_ninth ( )
Value:
const REAL_VALUE_TYPE * dconst_ninth_ptr(void)

◆ dconst_pi

#define dconst_pi ( )
Value:
const REAL_VALUE_TYPE * dconst_pi_ptr(void)
Definition real.cc:2485

Referenced by cfn_sincos::fold_range().

◆ dconst_quarter

#define dconst_quarter ( )
Value:
const REAL_VALUE_TYPE * dconst_quarter_ptr(void)

◆ dconst_sixth

#define dconst_sixth ( )
Value:
const REAL_VALUE_TYPE * dconst_sixth_ptr(void)

◆ dconst_sqrt2

#define dconst_sqrt2 ( )
Value:
const REAL_VALUE_TYPE * dconst_sqrt2_ptr(void)
Definition real.cc:2524

Referenced by gimple_expand_builtin_cabs().

◆ dconst_third

#define dconst_third ( )
Value:
const REAL_VALUE_TYPE * dconst_third_ptr(void)

Referenced by gimple_expand_builtin_pow().

◆ EXP_BITS

#define EXP_BITS   (32 - 6)

◆ FLOAT_MODE_FORMAT

#define FLOAT_MODE_FORMAT ( MODE)
Value:
T as_a(U *p)
Definition is-a.h:253
#define GET_MODE_INNER(MODE)
Definition machmode.h:740
#define REAL_MODE_FORMAT(MODE)
Definition real.h:183

Referenced by float_widen_lhs_range().

◆ MAX_EXP

#define MAX_EXP   ((1 << (EXP_BITS - 1)) - 1)

◆ MODE_COMPOSITE_P

#define MODE_COMPOSITE_P ( MODE)
Value:
(FLOAT_MODE_P (MODE) \
&& FLOAT_MODE_FORMAT (MODE)->pnan < FLOAT_MODE_FORMAT (MODE)->p)
#define FLOAT_MODE_P(MODE)
Definition machmode.h:116
#define FLOAT_MODE_FORMAT(MODE)
Definition real.h:191
The following macro determines whether the floating point format is
composite, i.e. may contain non-consecutive mantissa bits, in which
case compile-time FP overflow may not model run-time overflow.   

Referenced by build_gt(), build_lt(), const_binop(), expand_builtin_issignaling(), float_widen_lhs_range(), fold_builtin_classify(), fold_builtin_interclass_mathfn(), frange_arithmetic(), frange_mpfr_arg1(), frange_nextafter(), frange::internal_singleton_p(), long_double_as_float128(), real_can_shorten_arithmetic(), simplify_const_binary_operation(), and simplify_context::simplify_gen_subreg().

◆ MODE_HAS_INFINITIES

◆ MODE_HAS_NANS

#define MODE_HAS_NANS ( MODE)
Value:
(FLOAT_MODE_P (MODE) && FLOAT_MODE_FORMAT (MODE)->has_nans)
Accessor macros for format properties.   

Referenced by const_binop(), fold_convert_const_real_from_real(), and HONOR_NANS().

◆ MODE_HAS_SIGN_DEPENDENT_ROUNDING

#define MODE_HAS_SIGN_DEPENDENT_ROUNDING ( MODE)
Value:
(FLOAT_MODE_P (MODE) \
&& FLOAT_MODE_FORMAT (MODE)->has_sign_dependent_rounding)

Referenced by HONOR_SIGN_DEPENDENT_ROUNDING().

◆ MODE_HAS_SIGNED_ZEROS

#define MODE_HAS_SIGNED_ZEROS ( MODE)
Value:
(FLOAT_MODE_P (MODE) && FLOAT_MODE_FORMAT (MODE)->has_signed_zero)

Referenced by HONOR_SIGNED_ZEROS(), insert_var_expansion_initialization(), and frange::set().

◆ REAL_EXP

◆ REAL_MODE_FORMAT

#define REAL_MODE_FORMAT ( MODE)

◆ REAL_VALUE_ATOF

#define REAL_VALUE_ATOF ( s,
m )
Value:

◆ REAL_VALUE_FIX

#define REAL_VALUE_FIX ( r)
Value:
poly_int< N, C > r
Definition poly-int.h:774
HOST_WIDE_INT real_to_integer(const REAL_VALUE_TYPE *)
Definition real.cc:1422

◆ REAL_VALUE_ISINF

#define REAL_VALUE_ISINF ( x)
Value:
real_isinf (&(x))
bool real_isinf(const REAL_VALUE_TYPE *)
Definition real.cc:1242
======================================================================  
Crap.   
Determine whether a floating-point value X is infinite.   

Referenced by const_binop(), dump_generic_node(), fold_convert_const_real_from_real(), print_real_cst(), simplify_const_binary_operation(), and simplify_const_unary_operation().

◆ REAL_VALUE_ISNAN

#define REAL_VALUE_ISNAN ( x)
Value:
real_isnan (&(x))
bool real_isnan(const REAL_VALUE_TYPE *)
Definition real.cc:1258
Determine whether a floating-point value X is a NaN.   

Referenced by const_binop(), dump_generic_node(), fold_convert_const_int_from_real(), fold_convert_const_real_from_real(), print_real_cst(), simplify_const_relational_operation(), simplify_const_unary_operation(), and valid_lattice_transition().

◆ REAL_VALUE_ISSIGNALING_NAN

#define REAL_VALUE_ISSIGNALING_NAN ( x)

◆ REAL_VALUE_MINUS_ZERO

#define REAL_VALUE_MINUS_ZERO ( x)
Value:
bool real_isnegzero(const REAL_VALUE_TYPE *)
Definition real.cc:1304
Determine whether a floating-point value X is minus zero.   

Referenced by fold_real_zero_addition_p(), initializer_zerop(), and tree_expr_maybe_real_minus_zero_p().

◆ REAL_VALUE_NEGATIVE

◆ REAL_VALUE_TO_TARGET_DECIMAL128

#define REAL_VALUE_TO_TARGET_DECIMAL128 ( IN,
OUT )
Value:
static const char * require(int t)
Definition gengtype-parse.cc:157
opt_scalar_float_mode decimal_float_mode_for_size(unsigned int size)
Definition machmode.h:902
long real_to_target(long *, const REAL_VALUE_TYPE *, format_helper)
Definition real.cc:2879
Real values to IEEE 754 decimal floats.   
IN is a REAL_VALUE_TYPE.  OUT is an array of longs.   

◆ REAL_VALUE_TO_TARGET_DECIMAL32

#define REAL_VALUE_TO_TARGET_DECIMAL32 ( IN,
OUT )
Value:
((OUT) = real_to_target (NULL, &(IN), \
#define NULL
Definition system.h:50
IN is a REAL_VALUE_TYPE.  OUT is a long.   

◆ REAL_VALUE_TO_TARGET_DECIMAL64

#define REAL_VALUE_TO_TARGET_DECIMAL64 ( IN,
OUT )
Value:

◆ REAL_VALUE_TO_TARGET_DOUBLE

#define REAL_VALUE_TO_TARGET_DOUBLE ( IN,
OUT )
Value:
opt_scalar_float_mode float_mode_for_size(poly_uint64 size)
Definition machmode.h:894

Referenced by split_double().

◆ REAL_VALUE_TO_TARGET_LONG_DOUBLE

#define REAL_VALUE_TO_TARGET_LONG_DOUBLE ( IN,
OUT )
Value:
real_to_target (OUT, &(IN), \
#define TYPE_PRECISION(NODE)
Definition tree.h:2254
#define long_double_type_node
Definition tree.h:4463
IN is a REAL_VALUE_TYPE.  OUT is an array of longs.   

◆ REAL_VALUE_TO_TARGET_SINGLE

#define REAL_VALUE_TO_TARGET_SINGLE ( IN,
OUT )
Value:
((OUT) = real_to_target (NULL, &(IN), float_mode_for_size (32).require ()))
IN is a REAL_VALUE_TYPE.  OUT is a long.   

◆ REAL_VALUE_TYPE

#define REAL_VALUE_TYPE   struct real_value
Various headers condition prototypes on #ifdef REAL_VALUE_TYPE, so it
needs to be a macro.  We do need to continue to have a structure tag
so that other headers can forward declare it.   

Referenced by acceptable_pow_call(), build_complex_inf(), build_ge(), build_gt(), build_le(), build_lt(), build_real(), build_real_from_wide(), build_sinatan_real(), canonicalize_condition(), check_pow(), check_real_for_fixed_mode(), compress_float_constant(), const_binop(), dconst_e_ptr(), dconst_pi_ptr(), dconst_sqrt2_ptr(), decimal_do_compare(), decimal_from_decnumber(), decimal_integer_string(), decimal_real_arithmetic(), decimal_real_to_integer(), decimal_real_to_integer(), decode_ibm_extended(), decrement_power(), div_significands(), do_add(), do_divide(), do_mpc_arg2(), do_mpc_ckconv(), do_mpc_ckconv(), do_mpfr_ckconv(), do_mpfr_ckconv(), do_mpfr_lgamma_r(), do_mpfr_remquo(), do_multiply(), dump_generic_node(), encode_ibm_extended(), encode_ieee_quad(), exact_inverse(), exact_real_inverse(), exact_real_truncate(), expand_fix(), expand_float(), expand_pow_as_sqrts(), find_comparison_args(), fixed_convert_from_real(), fixed_from_string(), fixed_to_decimal(), float_widen_lhs_range(), fold_builtin_fpclassify(), fold_builtin_frexp(), fold_builtin_interclass_mathfn(), fold_builtin_modf(), fold_const_builtin_load_exponent(), fold_const_builtin_nan(), fold_const_call_1(), fold_const_call_1(), fold_const_call_1(), fold_const_pow(), fold_convert_const_int_from_real(), fold_convert_const_real_from_fixed(), fold_convert_const_real_from_real(), cfn_constant_float_p::fold_range(), cfn_sincos::fold_range(), cfn_sqrt::fold_range(), operator_abs::fold_range(), operator_negate::fold_range(), fold_relational_const(), frange_arithmetic(), frange_drop_inf(), frange_drop_infs(), frange_drop_ninf(), frange_mpfr_arg1(), frange_nextafter(), frange_val_is_max(), frange_val_is_min(), gen_conditions_for_pow_cst_base(), range_query::get_tree_range(), gimple_expand_builtin_pow(), hash_tree(), init_emit_once(), frange::internal_singleton_p(), native_decode_rtx(), native_interpret_real(), omp_reduction_init_op(), cfn_sincos::op1_range(), cfn_sqrt::op1_range(), foperator_div::op1_range(), operator_equal::op1_range(), operator_mult::op1_range(), operator_not_equal::op1_range(), foperator_div::op2_range(), pack_ts_real_cst_value_fields(), print_real_cst(), real_ceil(), real_convert_from_fixed(), real_digit(), real_floor(), real_from_string2(), real_isinteger(), real_isinteger(), real_max_representable(), real_min_representable(), real_nan(), real_nextafter(), real_powi(), real_to_decimal_for_mode(), real_to_target(), real_value_abs(), real_value_from_int_cst(), real_value_negate(), real_value_truncate(), relational_result(), representable_as_half_series_p(), round_for_format(), foperator_div::rv_fold(), operator_minus::rv_fold(), operator_mult::rv_fold(), operator_plus::rv_fold(), frange::set(), simplify_context::simplify_binary_operation_1(), simplify_const_binary_operation(), simplify_const_relational_operation(), simplify_const_unary_operation(), streamer_read_value_range(), strip_float_extensions(), ten_to_mptwo(), ten_to_ptwo(), times_pten(), tree_call_nonnegative_warnv_p(), ubsan_instrument_float_cast(), unpack_ts_real_cst_value_fields(), vect_build_all_ones_mask(), and vect_build_zero_merge_argument().

◆ REAL_VALUE_TYPE_SIZE

#define REAL_VALUE_TYPE_SIZE   (SIGNIFICAND_BITS + 32)
We store a REAL_VALUE_TYPE into an rtx, and we do this by putting it in
consecutive "w" slots.  Moreover, we've got to compute the number of "w"
slots at preprocessor time, which means we can't use sizeof.  Guess.   

◆ REAL_VALUE_UNSIGNED_FIX

#define REAL_VALUE_UNSIGNED_FIX ( r)
Value:
??? Not quite right.   

◆ REAL_WIDTH

#define REAL_WIDTH
Value:
+ (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up @endverbatim */
#define HOST_BITS_PER_WIDE_INT
Definition hwint.h:53
#define REAL_VALUE_TYPE_SIZE
Definition real.h:74

◆ SET_REAL_EXP

◆ SIG_MSB

◆ SIGNIFICAND_BITS

◆ SIGSZ

Enumeration Type Documentation

◆ real_value_class

Definitions of floating-point access for GNU compiler.
Copyright (C) 1989-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/>.   
An expanded form of the represented number.   
Enumerate the special cases of numbers that we encounter.   
Enumerator
rvc_zero 
rvc_normal 
rvc_inf 
rvc_nan 

Function Documentation

◆ build_real()

tree build_real ( tree type,
REAL_VALUE_TYPE d )
extern
In tree.cc: wrap up a REAL_VALUE_TYPE in a tree node.   
Return a new REAL_CST node whose type is TYPE and value is D.   

References dconst0, dconst1, dconst2, dconsthalf, dconstm1, DECIMAL_FLOAT_MODE_P, decimal_real_from_string(), real_format::emin, gcc_unreachable, make_node(), real_format::p, REAL_MODE_FORMAT, REAL_VALUE_TYPE, rvc_normal, rvc_zero, TREE_OVERFLOW, TREE_REAL_CST_PTR, TREE_TYPE, type(), and TYPE_MODE.

Referenced by scev_dfs::add_to_evolution(), scev_dfs::add_to_evolution_1(), build_complex_inf(), build_minus_one_cst(), build_one_cst(), build_real_from_int_cst(), build_real_from_wide(), build_real_truncate(), build_zero_cst(), chrec_fold_multiply_poly_poly(), chrec_fold_plus_1(), chrec_fold_plus_poly_poly(), const_binop(), decrement_power(), do_mpc_ckconv(), do_mpfr_ckconv(), exact_inverse(), expand_builtin_cexpi(), expand_builtin_signbit(), expand_omp_for_init_vars(), expand_pow_as_sqrts(), fold_abs_const(), fold_builtin_fpclassify(), fold_builtin_frexp(), fold_builtin_inf(), fold_builtin_interclass_mathfn(), fold_builtin_modf(), fold_const_builtin_nan(), fold_const_call_1(), fold_const_call_1(), fold_const_call_1(), fold_convert_const_real_from_fixed(), fold_convert_const_real_from_real(), fold_negate_const(), get_component_ssa_name(), gimple_expand_builtin_pow(), frange::lbound(), make_tree(), native_interpret_real(), neutral_op_for_reduction(), omp_reduction_init_op(), powi_as_mults(), frange::singleton_p(), frange::ubound(), ubsan_instrument_float_cast(), vect_build_all_ones_mask(), and vect_build_zero_merge_argument().

◆ build_real_truncate()

tree build_real_truncate ( tree type,
REAL_VALUE_TYPE d )
extern
Likewise, but first truncate the value to the type.   
Like build_real, but first truncate D to the type.   

References build_real(), real_value_truncate(), and TYPE_MODE.

Referenced by gimple_expand_builtin_cabs(), and strip_float_extensions().

◆ build_sinatan_real()

void build_sinatan_real ( REAL_VALUE_TYPE * r,
tree type )
extern
Fills r with the largest value such that 1 + r*r won't overflow.
This is used in both sin (atan (x)) and cos (atan(x)) optimizations.  

References dconst1, mpfr_from_real(), NULL, r, real_from_mpfr(), real_maxval(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, and TYPE_MODE.

◆ const_double_from_real_value()

rtx const_double_from_real_value ( REAL_VALUE_TYPE value,
machine_mode mode )
extern

◆ dconst_e_ptr()

const REAL_VALUE_TYPE * dconst_e_ptr ( void )
extern
Function to return the real value special constant 'e'.   
Returns the special REAL_VALUE_TYPE corresponding to 'e'.   

References NULL_TREE, real_from_mpfr(), REAL_VALUE_TYPE, rvc_zero, and SIGNIFICAND_BITS.

◆ dconst_ninth_ptr()

const REAL_VALUE_TYPE * dconst_ninth_ptr ( void )
extern

◆ dconst_pi_ptr()

const REAL_VALUE_TYPE * dconst_pi_ptr ( void )
extern
Function to return the real value special constant 'pi'.   
Returns the special REAL_VALUE_TYPE corresponding to 'pi'.   

References NULL_TREE, real_from_mpfr(), REAL_VALUE_TYPE, rvc_zero, and SIGNIFICAND_BITS.

◆ dconst_quarter_ptr()

const REAL_VALUE_TYPE * dconst_quarter_ptr ( void )
extern

◆ dconst_sixth_ptr()

const REAL_VALUE_TYPE * dconst_sixth_ptr ( void )
extern

◆ dconst_sqrt2_ptr()

const REAL_VALUE_TYPE * dconst_sqrt2_ptr ( void )
extern
Returns the special REAL_VALUE_TYPE corresponding to sqrt(2).   

References REAL_VALUE_TYPE, and rvc_zero.

◆ dconst_third_ptr()

const REAL_VALUE_TYPE * dconst_third_ptr ( void )
extern
Returns a cached REAL_VALUE_TYPE corresponding to 1/n, for various n.   

◆ exact_real_inverse()

bool exact_real_inverse ( format_helper fmt,
REAL_VALUE_TYPE * r )
extern
Replace R by 1/R in the given format, if the result is exact.   
Try to change R into its exact multiplicative inverse in format FMT.
Return true if successful.   

References do_divide(), i, r, real_convert(), real_digit(), REAL_VALUE_TYPE, rvc_normal, SIG_MSB, and SIGSZ.

Referenced by exact_inverse().

◆ exact_real_truncate()

bool exact_real_truncate ( format_helper fmt,
const REAL_VALUE_TYPE * a )
extern
Return true if truncating to NEW is exact.   
Return true if truncating to FMT is exact.   

References a, real_format::emin, real_convert(), REAL_EXP, real_identical(), and REAL_VALUE_TYPE.

Referenced by compress_float_constant(), fold_convert_const_real_from_real(), simplify_const_unary_operation(), and strip_float_extensions().

◆ get_max_float()

void get_max_float ( const struct real_format * fmt,
char * buf,
size_t len,
bool norm_max )
extern
Write into BUF the maximum representable finite floating-point
number, (1 - b**-p) * b**emax for a given FP format FMT as a hex
float string.  BUF must be large enough to contain the result.   
Write into BUF the maximum representable finite floating-point
number, (1 - b**-p) * b**emax for a given FP format FMT as a hex
float string.  LEN is the size of BUF, and the buffer must be large
enough to contain the resulting string.  If NORM_MAX, instead write
the maximum representable finite normalized floating-point number,
defined to be such that all choices of digits for that exponent are
representable in the format (this only makes a difference for IBM
long double).   

References real_format::emax, gcc_assert, i, real_format::p, and real_format::pnan.

Referenced by fold_builtin_interclass_mathfn(), and real_max_representable().

◆ HONOR_INFINITIES() [1/3]

bool HONOR_INFINITIES ( const_rtx x)
extern

References GET_MODE, and HONOR_INFINITIES().

◆ HONOR_INFINITIES() [2/3]

bool HONOR_INFINITIES ( const_tree t)
extern

◆ HONOR_INFINITIES() [3/3]

bool HONOR_INFINITIES ( machine_mode m)
extern
As for HONOR_NANS, but true if the mode can represent infinity and
the treatment of infinite values is important.   

References MODE_HAS_INFINITIES.

Referenced by frange_val_max(), frange_val_min(), HONOR_INFINITIES(), HONOR_INFINITIES(), omp_reduction_init_op(), frange::set(), tree_expr_finite_p(), tree_expr_infinite_p(), and tree_expr_maybe_infinite_p().

◆ HONOR_NANS() [1/3]

bool HONOR_NANS ( const_rtx x)
extern

References GET_MODE, and HONOR_NANS().

◆ HONOR_NANS() [2/3]

bool HONOR_NANS ( const_tree t)
extern

References element_mode(), and HONOR_NANS().

◆ HONOR_NANS() [3/3]

bool HONOR_NANS ( machine_mode m)
extern
Declare functions in real.cc.   
True if the given mode has a NaN representation and the treatment of
NaN operands is important.  Certain optimizations, such as folding
x * 0 into 0, are not correct for NaN operands, and are normally
disabled for modes with NaNs.  The user can ask for them to be
done anyway using the -funsafe-math-optimizations switch.   
True if mode M has a NaN representation and
the treatment of NaN operands is important.   

References MODE_HAS_NANS.

Referenced by ipa_predicate::add_clause(), bitwise_inverted_equal_p(), build_gt(), build_lt(), combine_comparisons(), cond_stmts_equal_p(), convert_mode_scalar(), do_compare_rtx_and_jump(), eliminate_using_constants(), emit_store_flag(), emit_store_flag_force(), expand_builtin_issignaling(), expand_complex_multiplication(), fold_binary_loc(), fold_cond_expr_with_comparison(), fold_ternary_loc(), fold_truth_not_expr(), gen_one_condition(), frange_storage::get_frange(), gimple_bitwise_inverted_equal_p(), gimple_equal_p(), gimple_expand_builtin_pow(), gimple_simplify_phiopt(), HONOR_NANS(), HONOR_NANS(), HONOR_SNANS(), ifcombine_ifandif(), frange::internal_singleton_p(), inverse_conditions_p(), may_trap_p_1(), merge_truthop_with_opposite_arm(), minmax_from_comparison(), minmax_replacement(), noce_try_minmax(), noce_try_move(), frange::normalize_kind(), optimize_spaceship(), parloops_is_simple_reduction(), parse_predicate(), process_bb(), fold_using_range::relation_fold_and_or(), reversed_comparison_code_parts(), frange::set(), set_cond_stmt_execution_predicate(), frange::set_nan(), frange::set_varying(), avail_exprs_stack::simplify_binary_operation(), simplify_context::simplify_binary_operation_1(), simplify_const_binary_operation(), simplify_const_relational_operation(), simplify_if_then_else(), simplify_context::simplify_ternary_operation(), spaceship_replacement(), split_comparison(), tree_expr_finite_p(), tree_expr_maybe_nan_p(), tree_expr_nan_p(), ubsan_instrument_float_cast(), frange::update_nan(), valid_lattice_transition(), vect_build_slp_tree_1(), vectorizable_condition(), and frange::verify_range().

◆ HONOR_SIGN_DEPENDENT_ROUNDING() [1/3]

bool HONOR_SIGN_DEPENDENT_ROUNDING ( const_rtx x)
extern

◆ HONOR_SIGN_DEPENDENT_ROUNDING() [2/3]

bool HONOR_SIGN_DEPENDENT_ROUNDING ( const_tree t)
extern

◆ HONOR_SIGN_DEPENDENT_ROUNDING() [3/3]

◆ HONOR_SIGNED_ZEROS() [1/3]

bool HONOR_SIGNED_ZEROS ( const_rtx x)
extern

References GET_MODE, and HONOR_SIGNED_ZEROS().

◆ HONOR_SIGNED_ZEROS() [2/3]

bool HONOR_SIGNED_ZEROS ( const_tree t)
extern

◆ HONOR_SIGNED_ZEROS() [3/3]

◆ HONOR_SNANS() [1/3]

bool HONOR_SNANS ( const_rtx x)
extern

References GET_MODE, and HONOR_SNANS().

◆ HONOR_SNANS() [2/3]

bool HONOR_SNANS ( const_tree t)
extern

References element_mode(), and HONOR_SNANS().

◆ HONOR_SNANS() [3/3]

◆ real_2expN()

◆ real_arithmetic()

◆ real_can_shorten_arithmetic()

bool real_can_shorten_arithmetic ( machine_mode imode,
machine_mode tmode )
Return true if arithmetic on values in IMODE that were promoted
from values in TMODE is equivalent to direct arithmetic on values
in TMODE.   

References real_format::b, real_format::emax, real_format::emin, real_format::has_inf, real_format::has_nans, real_format::has_sign_dependent_rounding, real_format::has_signed_zero, MODE_COMPOSITE_P, real_format::p, REAL_MODE_FORMAT, and real_format::round_towards_zero.

◆ real_ceil()

void real_ceil ( REAL_VALUE_TYPE * r,
format_helper fmt,
const REAL_VALUE_TYPE * x )
extern
Round X to the smallest integer not less then argument, i.e. round
up, placing the result in R in format FMT.   

References dconst1, do_add(), do_fix_trunc(), r, real_convert(), real_identical(), and REAL_VALUE_TYPE.

Referenced by expand_pow_as_sqrts(), fold_const_call_ss(), and fold_const_call_ss().

◆ real_compare()

◆ real_convert()

◆ real_copysign()

void real_copysign ( REAL_VALUE_TYPE * r,
const REAL_VALUE_TYPE * x )
extern
Set the sign of R to the sign of X.   

References r.

Referenced by fold_const_call_sss(), and simplify_const_binary_operation().

◆ real_equal()

◆ real_exponent()

int real_exponent ( const REAL_VALUE_TYPE * r)
extern
??? These were added for Paranoia support.   
Return floor log2(R).   
Return floor log2(R).   

References gcc_unreachable, r, REAL_EXP, rvc_inf, rvc_nan, rvc_normal, and rvc_zero.

◆ real_floor()

void real_floor ( REAL_VALUE_TYPE * r,
format_helper fmt,
const REAL_VALUE_TYPE * x )
extern
Round X to the largest integer not greater in value, i.e. round
down, placing the result in R in format FMT.   

References dconstm1, do_add(), do_fix_trunc(), r, real_convert(), real_identical(), and REAL_VALUE_TYPE.

Referenced by expand_pow_as_sqrts(), fold_const_call_ss(), and fold_const_call_ss().

◆ real_from_integer()

◆ real_from_string()

int real_from_string ( REAL_VALUE_TYPE * r,
const char * str )
extern
Initialize R from a decimal or hexadecimal string.  Return -1 if
the value underflows, +1 if overflows, and 0 otherwise.   
Initialize R from a decimal or hexadecimal string.  The string is
assumed to have been syntax checked already.  Return -1 if the
value underflows, +1 if overflows, and 0 otherwise.  

References cmp_significand_0(), exp(), gcc_assert, get_canonical_qnan(), get_canonical_snan(), get_inf(), get_zero(), HOST_BITS_PER_LONG, MAX_EXP, normalize(), NULL, NULL_TREE, r, real_from_mpfr(), rvc_normal, SET_REAL_EXP, SIGNIFICAND_BITS, and startswith().

Referenced by check_real_for_fixed_mode(), decimal_real_to_integer(), decimal_real_to_integer(), fixed_from_string(), fold_builtin_fpclassify(), fold_builtin_interclass_mathfn(), real_from_mpfr(), real_from_string2(), real_from_string3(), real_max_representable(), and real_to_decimal_for_mode().

◆ real_from_string2()

REAL_VALUE_TYPE real_from_string2 ( const char * s,
format_helper fmt )
extern
Legacy.  Similar, but return the result directly.   

References r, real_convert(), real_from_string(), and REAL_VALUE_TYPE.

◆ real_from_string3()

void real_from_string3 ( REAL_VALUE_TYPE * r,
const char * s,
format_helper fmt )
extern
Wrapper to allow different internal representation for decimal floats.  
Initialize R from string S and desired format FMT.  

References format_helper::decimal_p(), decimal_real_from_string(), r, real_convert(), and real_from_string().

Referenced by decimal_to_binary().

◆ real_from_target()

void real_from_target ( REAL_VALUE_TYPE * r,
const long * buf,
format_helper fmt )
extern
Read R from the given target format.  Read the words of the result
in target word order in BUF.  There are always 32 bits in each
long, no matter the size of the host long.   

References real_format::decode, and r.

Referenced by native_decode_rtx(), native_interpret_real(), simplify_const_binary_operation(), simplify_const_unary_operation(), vect_build_all_ones_mask(), and vect_build_zero_merge_argument().

◆ real_hash()

unsigned int real_hash ( const REAL_VALUE_TYPE * r)
extern
Return a hash value for the given real value.   
??? The "unsigned int" return value is intended to be hashval_t,
but I didn't want to pull hashtab.h into real.h.   

References gcc_unreachable, HOST_BITS_PER_LONG, i, r, REAL_EXP, rvc_inf, rvc_nan, rvc_normal, rvc_zero, and SIGSZ.

Referenced by const_hash_1(), const_rtx_hash_1(), cselib_hash_rtx(), const_double_hasher::hash(), operand_compare::hash_operand(), and hash_rtx().

◆ real_identical()

◆ real_inf()

void real_inf ( REAL_VALUE_TYPE * r,
bool sign )
extern
Fills R with Inf with SIGN.   

References get_inf(), and r.

Referenced by init_emit_once(), and foperator_div::rv_fold().

◆ real_isdenormal()

bool real_isdenormal ( const REAL_VALUE_TYPE * r,
machine_mode mode )
inline
Determine whether floating-point value R is a denormal.  This
function is only valid for normalized values.   

References r, REAL_EXP, REAL_MODE_FORMAT, and rvc_normal.

◆ real_isfinite()

◆ real_isinf() [1/2]

◆ real_isinf() [2/2]

bool real_isinf ( const REAL_VALUE_TYPE * r,
bool sign )
extern
Determine whether a floating-point value X is infinite with SIGN.   

References r, and real_isinf().

◆ real_isinteger() [1/2]

bool real_isinteger ( const REAL_VALUE_TYPE * c,
format_helper fmt )
extern
Check whether the real constant value given is an integer.   
Check whether the real constant value given is an integer.
Returns false for signaling NaN.   

References real_identical(), real_trunc(), and REAL_VALUE_TYPE.

Referenced by do_mpfr_lgamma_r(), integer_valued_real_single_p(), and optimize_pow_to_exp().

◆ real_isinteger() [2/2]

bool real_isinteger ( const REAL_VALUE_TYPE * c,
HOST_WIDE_INT * int_out )
extern
Check whether C is an integer that fits in a HOST_WIDE_INT,
storing it in *INT_OUT if so.   

References real_from_integer(), real_identical(), real_to_integer(), REAL_VALUE_TYPE, and SIGNED.

◆ real_isnan()

◆ real_isneg()

◆ real_isnegzero()

bool real_isnegzero ( const REAL_VALUE_TYPE * r)
extern
Determine whether a floating-point value X is minus zero.   

References r, and rvc_zero.

Referenced by find_range().

◆ real_issignaling_nan()

bool real_issignaling_nan ( const REAL_VALUE_TYPE * r)
extern
Determine whether a floating-point value X is a signaling NaN.   

References r, and real_isnan().

Referenced by fold_const_call_ss(), tree_expr_maybe_signaling_nan_p(), and tree_expr_signaling_nan_p().

◆ real_iszero() [1/2]

◆ real_iszero() [2/2]

bool real_iszero ( const REAL_VALUE_TYPE * r,
bool sign )
extern
Determine whether a floating-point value X is zero with SIGN.   

References r, and real_iszero().

◆ real_ldexp()

void real_ldexp ( REAL_VALUE_TYPE * r,
const REAL_VALUE_TYPE * op0,
int exp )
extern
R = A * 2**EXP.   
R = OP0 * 2**EXP.   

References exp(), gcc_unreachable, get_inf(), get_zero(), MAX_EXP, r, REAL_EXP, rvc_inf, rvc_nan, rvc_normal, rvc_zero, and SET_REAL_EXP.

Referenced by fold_const_builtin_load_exponent().

◆ real_less()

◆ real_maxval()

void real_maxval ( REAL_VALUE_TYPE * r,
int sign,
machine_mode mode )
extern
Fills R with the largest finite value representable in mode MODE.
If SIGN is nonzero, R is set to the most negative finite value.   

References real_format::b, clear_significand_below(), clear_significand_bit(), decimal_real_maxval(), real_format::emax, gcc_assert, real_format::p, real_format::pnan, r, REAL_MODE_FORMAT, rvc_normal, SET_REAL_EXP, SIGNIFICAND_BITS, and SIGSZ.

Referenced by build_sinatan_real(), and omp_reduction_init_op().

◆ real_nan()

bool real_nan ( REAL_VALUE_TYPE * r,
const char * str,
int quiet,
format_helper fmt )
extern
Fills R with a NaN whose significand is described by STR.  If QUIET,
we force a QNaN, else we force an SNaN.  The string, if not empty,
is parsed as a number and placed in the significand.  Return true
if the string was successfully parsed.   

References add_significands(), gcc_unreachable, get_canonical_qnan(), get_canonical_snan(), get_zero(), lshift_significand(), lshift_significand_1(), real_format::pnan, r, REAL_VALUE_TYPE, rvc_nan, SIGNIFICAND_BITS, and SIGSZ.

Referenced by fold_const_builtin_nan(), and real_from_mpfr().

◆ real_nextafter()

bool real_nextafter ( REAL_VALUE_TYPE * r,
format_helper fmt,
const REAL_VALUE_TYPE * x,
const REAL_VALUE_TYPE * y )
extern

◆ real_powi()

bool real_powi ( REAL_VALUE_TYPE * r,
format_helper fmt,
const REAL_VALUE_TYPE * x,
HOST_WIDE_INT n )
extern
Calculate R as X raised to the integer exponent N in format FMT.   
Calculate X raised to the integer exponent N in format FMT and store
the result in R.  Return true if the result may be inexact due to
loss of precision.  The algorithm is the classic "left-to-right binary
method" described in section 4.6.3 of Donald Knuth's "Seminumerical
Algorithms", "The Art of Computer Programming", Volume 2.   

References dconst1, do_divide(), do_multiply(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_1U, i, r, real_convert(), and REAL_VALUE_TYPE.

Referenced by fold_const_call_sss(), and fold_const_pow().

◆ real_round()

void real_round ( REAL_VALUE_TYPE * r,
format_helper fmt,
const REAL_VALUE_TYPE * x )
extern
Round X to the nearest integer, but round halfway cases away from
zero.   

References dconsthalf, do_add(), do_fix_trunc(), r, and real_convert().

Referenced by fold_const_call_ss(), fold_const_call_ss(), gimple_expand_builtin_pow(), and real_roundeven().

◆ real_roundeven()

void real_roundeven ( REAL_VALUE_TYPE * r,
format_helper fmt,
const REAL_VALUE_TYPE * x )
extern
Round X to nearest integer, rounding halfway cases towards even.   

References clear_significand_below(), dconsthalf, dconstm1, do_add(), is_even(), is_halfway_below(), r, real_convert(), REAL_EXP, real_round(), and SIGNIFICAND_BITS.

Referenced by fold_const_call_ss().

◆ real_to_decimal()

void real_to_decimal ( char * str,
const REAL_VALUE_TYPE * r_orig,
size_t buf_size,
size_t digits,
int crop_trailing_zeros )
extern
Render R as a decimal floating point constant.   
Likewise, except always uses round-to-nearest.   

References real_to_decimal_for_mode().

Referenced by decimal_from_binary(), decimal_to_binary(), dump_generic_node(), dump_real(), expand_pow_as_sqrts(), fixed_to_decimal(), print_real_cst(), rtx_writer::print_rtx(), and print_value().

◆ real_to_decimal_for_mode()

void real_to_decimal_for_mode ( char * str,
const REAL_VALUE_TYPE * r_orig,
size_t buf_size,
size_t digits,
int crop_trailing_zeros,
machine_mode mode )
extern

◆ real_to_hexadecimal()

void real_to_hexadecimal ( char * str,
const REAL_VALUE_TYPE * r,
size_t buf_size,
size_t digits,
int crop_trailing_zeros )
extern
Render R as a hexadecimal floating point constant.   
Render R as a hexadecimal floating point constant.  Emit DIGITS
significant digits in the result, bounded by BUF_SIZE.  If DIGITS is 0,
choose the maximum for the representation.  If CROP_TRAILING_ZEROS,
strip trailing zeros.   

References exp(), gcc_assert, gcc_unreachable, HOST_BITS_PER_LONG, i, real_format::p, r, REAL_EXP, rvc_inf, rvc_nan, rvc_normal, rvc_zero, SIGNIFICAND_BITS, and SIGSZ.

Referenced by debug(), mpfr_from_real(), vrange_printer::print_real_value(), and rtx_writer::print_rtx().

◆ real_to_integer() [1/2]

◆ real_to_integer() [2/2]

wide_int real_to_integer ( const REAL_VALUE_TYPE * r,
bool * fail,
int precision )
extern
real related routines.   
Likewise, but producing a wide-int of PRECISION.  If the value cannot
be represented in precision, *FAIL is set to TRUE.   

References decimal_real_to_integer(), exp(), wide_int_storage::from(), wide_int_storage::from_array(), gcc_assert, gcc_unreachable, HOST_BITS_PER_LONG, HOST_BITS_PER_WIDE_INT, i, wi::lrshift(), r, REAL_EXP, rvc_inf, rvc_nan, rvc_normal, rvc_zero, wi::set_bit_in_zero(), SIGSZ, UNLIKELY, UNSIGNED, WIDE_INT_MAX_INL_ELTS, and wi::zero().

◆ real_to_target()

long real_to_target ( long * buf,
const REAL_VALUE_TYPE * r_orig,
format_helper fmt )
extern
Write R to the given target format.  Place the words of the result
in target word order in BUF.  There are always 32 bits in each
long, no matter the size of the host long.

Legacy: return word 0 for implementing REAL_VALUE_TO_TARGET_SINGLE.   

References real_format::encode, r, REAL_VALUE_TYPE, and round_for_format().

Referenced by assemble_real(), insert_float(), native_encode_real(), native_encode_rtx(), simplify_const_binary_operation(), and simplify_const_unary_operation().

◆ real_trunc()

void real_trunc ( REAL_VALUE_TYPE * r,
format_helper fmt,
const REAL_VALUE_TYPE * x )
extern
Standard round to integer value functions.   
Round X to the nearest integer not larger in absolute value, i.e.
towards zero, placing the result in R in format FMT.   

References do_fix_trunc(), r, and real_convert().

Referenced by fold_builtin_modf(), fold_const_call_ss(), fold_convert_const_int_from_real(), and real_isinteger().

◆ real_value_abs()

◆ real_value_from_int_cst()

REAL_VALUE_TYPE real_value_from_int_cst ( const_tree type,
const_tree i )
Function to return a real value (not a tree node)
from a given integer constant.   
Return a new REAL_CST node whose type is TYPE
and whose value is the integer value of the INTEGER_CST node I.   

References i, real_from_integer(), REAL_VALUE_TYPE, wi::to_wide(), TREE_TYPE, TYPE_MODE, and TYPE_SIGN.

Referenced by build_real_from_int_cst(), and fold_convert_const_int_from_real().

◆ real_value_negate()

◆ real_value_truncate()

REAL_VALUE_TYPE real_value_truncate ( format_helper fmt,
REAL_VALUE_TYPE a )
extern
Legacy.  Likewise, except return the struct directly.   

References a, r, real_convert(), and REAL_VALUE_TYPE.

Referenced by build_real_truncate(), fold_const_builtin_load_exponent(), gimple_expand_builtin_pow(), and simplify_const_unary_operation().

◆ significand_size()

int significand_size ( format_helper fmt)
extern
Return the number of bits of the largest binary value that the
significand of FMT will hold.   
??? Legacy.  Should get access to real_format directly.   

References real_format::b, NULL, and real_format::p.

Referenced by format_helper::can_represent_integral_type_p(), exact_int_to_float_conversion_p(), and expand_float().

Variable Documentation

◆ arm_bfloat_half_format

const struct real_format arm_bfloat_half_format
extern
ARM Bfloat half-precision format.  This format resembles a truncated
(16-bit) version of the 32-bit IEEE 754 single-precision floating-point
format.   

Referenced by build_common_tree_nodes(), convert_mode_scalar(), expand_fix(), and gen_trunc_conv_libfunc().

◆ arm_half_format

const struct real_format arm_half_format
extern
ARM's alternative half-precision format, similar to IEEE but with
no reserved exponent value for NaNs and infinities; rather, it just
extends the range of exponents by one.   

◆ dconst0

◆ dconst1

◆ dconst2

◆ dconsthalf

◆ dconstinf

◆ dconstm0

◆ dconstm1

◆ dconstninf

◆ decimal_double_format

const struct real_format decimal_double_format
extern
Double precision decimal floating point (IEEE 754).  

Referenced by decimal_round_for_format().

◆ decimal_quad_format

const struct real_format decimal_quad_format
extern
Quad precision decimal floating point (IEEE 754).  

Referenced by decimal_round_for_format().

◆ decimal_single_format

const struct real_format decimal_single_format
extern
Single precision decimal floating point (IEEE 754).  

Referenced by decimal_round_for_format().

◆ ibm_extended_format

const struct real_format ibm_extended_format
extern

◆ ieee_double_format

◆ ieee_extended_intel_128_format

const struct real_format ieee_extended_intel_128_format
extern

◆ ieee_extended_intel_96_format

const struct real_format ieee_extended_intel_96_format
extern

◆ ieee_extended_intel_96_round_53_format

const struct real_format ieee_extended_intel_96_round_53_format
extern
The following caters to i386 systems that set the rounding precision
to 53 bits instead of 64, e.g. FreeBSD.   

Referenced by check_target_format().

◆ ieee_extended_motorola_format

const struct real_format ieee_extended_motorola_format
extern

◆ ieee_half_format

const struct real_format ieee_half_format
extern
Half-precision format, as specified in IEEE 754R.   

Referenced by convert_mode_scalar(), and gen_trunc_conv_libfunc().

◆ ieee_quad_format

◆ ieee_single_format

const struct real_format ieee_single_format
extern
Target formats defined in real.cc.   

Referenced by check_target_format(), convert_mode_scalar(), expand_fix(), and glibc_linux_libm_function_max_error().

◆ mips_double_format

◆ mips_extended_format

const struct real_format mips_extended_format
extern

◆ mips_quad_format

const struct real_format mips_quad_format
extern

◆ mips_single_format

const struct real_format mips_single_format
extern

◆ motorola_double_format

const struct real_format motorola_double_format
extern

◆ motorola_single_format

const struct real_format motorola_single_format
extern

◆ real_format_for_mode

const struct real_format* real_format_for_mode[NUM_MODE_FLOAT+NUM_MODE_DECIMAL_FLOAT]
extern
The target format used for each floating point mode.
Float modes are followed by decimal float modes, with entries for
float modes indexed by (MODE - first float mode), and entries for
decimal float modes indexed by (MODE - first decimal float mode) +
the number of float modes.   

◆ real_internal_format

const struct real_format real_internal_format
extern

◆ spu_single_format

const struct real_format spu_single_format
extern
SPU Single Precision (Extended-Range Mode) format is the same as IEEE
single precision with the following differences:
  - Infinities are not supported.  Instead MAX_FLOAT or MIN_FLOAT
    are generated.
  - NaNs are not supported.
  - The range of non-zero numbers in binary is
    (001)[1.]000...000 to (255)[1.]111...111.
  - Denormals can be represented, but are treated as +0.0 when
    used as an operand and are never generated as a result.
  - -0.0 can be represented, but a zero result is always +0.0.
  - the only supported rounding mode is trunction (towards zero).   

◆ test_real_width

char test_real_width[sizeof(REAL_VALUE_TYPE)<=REAL_WIDTH *sizeof(HOST_WIDE_INT) ? 1 :-1]
extern
Verify the guess.   

◆ vax_d_format

const struct real_format vax_d_format
extern

◆ vax_f_format

const struct real_format vax_f_format
extern

◆ vax_g_format

const struct real_format vax_g_format
extern