GCC Middle and Back End API Reference
fixed-value.h File Reference

Go to the source code of this file.

Data Structures

struct  fixed_value

Macros

#define FIXED_VALUE_TYPE   struct fixed_value
#define MAX_FCONST0
#define MAX_FCONST1
#define FCONST0(mode)   fconst0[mode - QQmode]
#define FCONST1(mode)   fconst1[mode - HAmode]
#define CONST_FIXED_FROM_FIXED_VALUE(r, m)   const_fixed_from_fixed_value (r, m)
#define FIXED_VALUES_IDENTICAL(x, y)   fixed_identical (&(x), &(y))
#define FIXED_VALUE_NEGATIVE(x)   fixed_isneg (&(x))

Functions

rtx const_fixed_from_fixed_value (FIXED_VALUE_TYPE, enum machine_mode)
FIXED_VALUE_TYPE fixed_from_double_int (double_int, enum machine_mode)
static rtx const_fixed_from_double_int (double_int payload, enum machine_mode mode)
void fixed_from_string (FIXED_VALUE_TYPE *, const char *, enum machine_mode)
tree build_fixed (tree, FIXED_VALUE_TYPE)
bool fixed_convert (FIXED_VALUE_TYPE *, enum machine_mode, const FIXED_VALUE_TYPE *, bool)
bool fixed_convert_from_int (FIXED_VALUE_TYPE *, enum machine_mode, double_int, bool, bool)
bool fixed_convert_from_real (FIXED_VALUE_TYPE *, enum machine_mode, const REAL_VALUE_TYPE *, bool)
void real_convert_from_fixed (REAL_VALUE_TYPE *, enum machine_mode, const FIXED_VALUE_TYPE *)
bool fixed_identical (const FIXED_VALUE_TYPE *, const FIXED_VALUE_TYPE *)
unsigned int fixed_hash (const FIXED_VALUE_TYPE *)
void fixed_to_decimal (char *str, const FIXED_VALUE_TYPE *, size_t)
bool fixed_arithmetic (FIXED_VALUE_TYPE *, int, const FIXED_VALUE_TYPE *, const FIXED_VALUE_TYPE *, bool)
bool fixed_compare (int, const FIXED_VALUE_TYPE *, const FIXED_VALUE_TYPE *)
bool fixed_isneg (const FIXED_VALUE_TYPE *)

Variables

FIXED_VALUE_TYPE fconst0 [MAX_FCONST0]
FIXED_VALUE_TYPE fconst1 [MAX_FCONST1]

Macro Definition Documentation

#define CONST_FIXED_FROM_FIXED_VALUE (   r,
 
)    const_fixed_from_fixed_value (r, m)
Return a CONST_FIXED with value R and mode M.   

Referenced by const_vector_from_tree(), expand_expr_real_1(), init_emit_once(), and simplify_immed_subreg().

#define FCONST0 (   mode)    fconst0[mode - QQmode]
Macros to access fconst0 and fconst1 via machine modes.   

Referenced by build_zero_cst(), convert_to_fixed(), and init_emit_once().

#define FCONST1 (   mode)    fconst1[mode - HAmode]
#define FIXED_VALUE_NEGATIVE (   x)    fixed_isneg (&(x))
Determine whether a fixed-point value X is negative.   

Referenced by tree_single_nonnegative_warnv_p().

#define FIXED_VALUES_IDENTICAL (   x,
 
)    fixed_identical (&(x), &(y))
#define MAX_FCONST0
Value:
18 /* For storing 18 fixed-point zeros per
fract, ufract, accum, and uaccum modes . @endverbatim */
#define MAX_FCONST1
Value:
8 /* For storing 8 fixed-point ones per accum
and uaccum modes. @endverbatim */

Function Documentation

static rtx const_fixed_from_double_int ( double_int  payload,
enum machine_mode  mode 
)
inlinestatic
Return a CONST_FIXED from a bit payload and machine mode MODE.
   The bits in PAYLOAD are sign-extended/zero-extended according to MODE.   

References const_fixed_from_fixed_value(), and fixed_from_double_int().

rtx const_fixed_from_fixed_value ( FIXED_VALUE_TYPE  ,
enum  machine_mode 
)
bool fixed_arithmetic ( FIXED_VALUE_TYPE f,
int  icode,
const FIXED_VALUE_TYPE op0,
const FIXED_VALUE_TYPE op1,
bool  sat_p 
)
Binary or unary arithmetic on tree_code.   
Perform the binary or unary operation described by CODE.
   Note that OP0 and OP1 must have the same mode for binary operators.
   For a unary operation, leave OP1 NULL.
   Return true, if !SAT_P and overflow.   

References do_fixed_add(), do_fixed_divide(), do_fixed_multiply(), do_fixed_neg(), and do_fixed_shift().

Referenced by const_binop(), and fold_negate_const().

bool fixed_compare ( int  icode,
const FIXED_VALUE_TYPE op0,
const FIXED_VALUE_TYPE op1 
)
Compare fixed-point values by tree_code.   
Compare fixed-point values by tree_code.
   Note that OP0 and OP1 must have the same mode.   

Referenced by fold_relational_const().

bool fixed_convert ( FIXED_VALUE_TYPE f,
enum machine_mode  mode,
const FIXED_VALUE_TYPE a,
bool  sat_p 
)
Extend or truncate to a new mode.   
Extend or truncate to a new mode.
   If SAT_P, saturate the result to the max or the min.
   Return true, if !SAT_P and overflow.   

References fixed_saturate1(), fixed_saturate2(), double_int::high, double_int::llshift(), double_int::lshift(), and double_int::sext().

Referenced by fold_convert_const_fixed_from_fixed().

bool fixed_convert_from_int ( FIXED_VALUE_TYPE f,
enum machine_mode  mode,
double_int  a,
bool  unsigned_p,
bool  sat_p 
)
Convert to a fixed-point mode from an integer.   
Convert to a new fixed-point mode from an integer.
   If UNSIGNED_P, this integer is unsigned.
   If SAT_P, saturate the result to the max or the min.
   Return true, if !SAT_P and overflow.   

References fixed_saturate2(), double_int::high, double_int::llshift(), double_int::low, and double_int::sext().

Referenced by fold_convert_const_fixed_from_int().

bool fixed_convert_from_real ( FIXED_VALUE_TYPE f,
enum machine_mode  mode,
const REAL_VALUE_TYPE *  a,
bool  sat_p 
)
Convert to a fixed-point mode from a real.   
Convert to a new fixed-point mode from a real.
   If SAT_P, saturate the result to the max or the min.
   Return true, if !SAT_P and overflow.   

References check_real_for_fixed_mode(), FIXED_GT_MAX_EPS, FIXED_MAX_EPS, FIXED_UNDERFLOW, HOST_WIDE_INT, real_2expN(), real_arithmetic(), and real_to_integer2().

Referenced by fold_convert_const_fixed_from_real().

FIXED_VALUE_TYPE fixed_from_double_int ( double_int  ,
enum  machine_mode 
)
Construct a FIXED_VALUE from a bit payload and machine mode MODE.
   The bits in PAYLOAD are sign-extended/zero-extended according to MODE.   
void fixed_from_string ( FIXED_VALUE_TYPE ,
const char *  ,
enum  machine_mode 
)
Initialize from a decimal or hexadecimal string.   
unsigned int fixed_hash ( const FIXED_VALUE_TYPE )
Calculate a hash value.   
bool fixed_identical ( const FIXED_VALUE_TYPE ,
const FIXED_VALUE_TYPE  
)
Compare two fixed-point objects for bitwise identity.   
bool fixed_isneg ( const FIXED_VALUE_TYPE )
Determine whether a fixed-point value X is negative.   
void fixed_to_decimal ( char *  str,
const FIXED_VALUE_TYPE f_orig,
size_t  buf_size 
)
Render F as a decimal floating point constant.   

References real_2expN(), real_arithmetic(), real_from_integer(), and real_to_decimal().

Referenced by dump_fixed(), dump_generic_node(), print_node(), print_node_brief(), and print_value().

void real_convert_from_fixed ( REAL_VALUE_TYPE *  r,
enum machine_mode  mode,
const FIXED_VALUE_TYPE f 
)
Convert to a real mode from a fixed-point.   
Convert to a new real mode from a fixed-point.   

References real_2expN(), real_arithmetic(), real_convert(), and real_from_integer().

Referenced by fold_convert_const_real_from_fixed().


Variable Documentation

Constant fixed-point values 0 and 1.   
Record fixed-point constant 0 and 1.