GCC Middle and Back End API Reference
dfp.h File Reference

Go to the source code of this file.

Functions

void encode_decimal32 (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *)
void encode_decimal64 (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *)
void decode_decimal128 (const struct real_format *, REAL_VALUE_TYPE *, const long *)
void decode_decimal32 (const struct real_format *, REAL_VALUE_TYPE *, const long *)
void decode_decimal64 (const struct real_format *, REAL_VALUE_TYPE *, const long *)
void encode_decimal128 (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *)
int decimal_do_compare (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int)
void decimal_real_from_string (REAL_VALUE_TYPE *, const char *)
void decimal_round_for_format (const struct real_format *, REAL_VALUE_TYPE *)
void decimal_real_convert (REAL_VALUE_TYPE *, enum machine_mode, const REAL_VALUE_TYPE *)
void decimal_real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int)
void decimal_do_fix_trunc (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)
void decimal_real_maxval (REAL_VALUE_TYPE *, int, enum machine_mode)
void decimal_real_to_integer2 (HOST_WIDE_INT *, HOST_WIDE_INT *, const REAL_VALUE_TYPE *)
HOST_WIDE_INT decimal_real_to_integer (const REAL_VALUE_TYPE *)
bool decimal_real_arithmetic (REAL_VALUE_TYPE *, enum tree_code, const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *)

Function Documentation

int decimal_do_compare ( const REAL_VALUE_TYPE *  a,
const REAL_VALUE_TYPE *  b,
int  nan_result 
)
   Arithmetic and conversion functions.  
   Helper function to real.c:do_compare() to handle decimal internal
   representation including when one of the operands is still in the
   binary internal representation.  
     If either operand is non-decimal, create temporary versions.  
     Convert into decNumber form for comparison operation.  
     Finally, do the comparison.  
     Return the comparison result.  
void decimal_do_fix_trunc ( REAL_VALUE_TYPE *  ,
const REAL_VALUE_TYPE *   
)
bool decimal_real_arithmetic ( REAL_VALUE_TYPE *  r,
enum tree_code  code,
const REAL_VALUE_TYPE *  op0,
const REAL_VALUE_TYPE *  op1 
)
   Perform the decimal floating point operation described by CODE.
   For a unary operation, OP1 will be NULL.  This function returns
   true if the result may be inexact due to loss of precision.  
     If either operand is non-decimal, create temporaries.  
           Flip sign bit.  
           Keep sign field in sync.  
           Clear sign bit.  
           Keep sign field in sync.  
void decimal_real_convert ( REAL_VALUE_TYPE *  r,
enum machine_mode  mode,
const REAL_VALUE_TYPE *  a 
)
   Extend or truncate to a new mode.  Handles conversions between
   binary and decimal types.  

Referenced by real_nan().

void decimal_real_from_string ( REAL_VALUE_TYPE *  ,
const char *   
)
void decimal_real_maxval ( REAL_VALUE_TYPE *  ,
int  ,
enum  machine_mode 
)
void decimal_real_to_decimal ( char *  str,
const REAL_VALUE_TYPE *  r_orig,
size_t  buf_size,
size_t  digits,
int  crop_trailing_zeros 
)
   Render R_ORIG as a decimal 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.  Currently, not honoring
   DIGITS or CROP_TRAILING_ZEROS.  
     decimal128ToString requires space for at least 24 characters;
     Require two more for suffix.  
HOST_WIDE_INT decimal_real_to_integer ( const REAL_VALUE_TYPE *  )
void decimal_real_to_integer2 ( HOST_WIDE_INT plow,
HOST_WIDE_INT phigh,
const REAL_VALUE_TYPE *  r 
)
   Likewise, but to an integer pair, HI+LOW.  
     Convert to REAL_VALUE_TYPE and call appropriate conversion
     function.  

References decimal_from_binary().

Referenced by real_can_shorten_arithmetic().

void decimal_round_for_format ( const struct real_format ,
REAL_VALUE_TYPE *   
)
void decode_decimal128 ( const struct real_format fmt,
REAL_VALUE_TYPE *  r,
const long *  buf 
)
   Decode an IEEE 754 decimal128 type into a real.  
void decode_decimal32 ( const struct real_format fmt,
REAL_VALUE_TYPE *  r,
const long *  buf 
)
   Decode 32/64/128-bit IEEE 754 encoded values into REAL_VALUE_TYPEs.  
   Decode an IEEE 754 decimal32 type into a real.  
void decode_decimal64 ( const struct real_format fmt,
REAL_VALUE_TYPE *  r,
const long *  buf 
)
   Decode an IEEE 754 decimal64 type into a real.  

References memcpy().

void encode_decimal128 ( const struct real_format fmt,
long *  buf,
const REAL_VALUE_TYPE *  r 
)
   Encode a real into an IEEE 754 decimal128 type.  

References memcpy().

void encode_decimal32 ( const struct real_format fmt,
long *  buf,
const REAL_VALUE_TYPE *  r 
)
   Encode REAL_VALUE_TYPEs into 32/64/128-bit IEEE 754 encoded values.  
   Encode a real into an IEEE 754 decimal32 type.  
void encode_decimal64 ( const struct real_format fmt,
long *  buf,
const REAL_VALUE_TYPE *  r 
)
   Encode a real into an IEEE 754 decimal64 type.  

Referenced by decode_vax_d().