#include "config.h"#include "system.h"#include "coretypes.h"#include "tm.h"#include "tree.h"#include "toplev.h"#include "real.h"#include "tm_p.h"#include "dfp.h"#include "decimal128.h"#include "decimal64.h"#include "decimal32.h"#include "decNumber.h"

Go to the source code of this file.
Functions/Subroutines | |
| static uint32_t | dfp_byte_swap (uint32_t in) |
| static void | decimal_from_decnumber (REAL_VALUE_TYPE *r, decNumber *dn, decContext *context) |
| void | decimal_real_from_string (REAL_VALUE_TYPE *r, const char *s) |
| static void | decimal_to_decnumber (const REAL_VALUE_TYPE *r, decNumber *dn) |
| void | encode_decimal32 (const struct real_format *fmt ATTRIBUTE_UNUSED, long *buf, const REAL_VALUE_TYPE *r) |
| void | decode_decimal32 (const struct real_format *fmt ATTRIBUTE_UNUSED, REAL_VALUE_TYPE *r, const long *buf) |
| void | encode_decimal64 (const struct real_format *fmt ATTRIBUTE_UNUSED, long *buf, const REAL_VALUE_TYPE *r) |
| void | decode_decimal64 (const struct real_format *fmt ATTRIBUTE_UNUSED, REAL_VALUE_TYPE *r, const long *buf) |
| void | encode_decimal128 (const struct real_format *fmt ATTRIBUTE_UNUSED, long *buf, const REAL_VALUE_TYPE *r) |
| void | decode_decimal128 (const struct real_format *fmt ATTRIBUTE_UNUSED, REAL_VALUE_TYPE *r, const long *buf) |
| static void | decimal_to_binary (REAL_VALUE_TYPE *to, const REAL_VALUE_TYPE *from, enum machine_mode mode) |
| static void | decimal_from_binary (REAL_VALUE_TYPE *to, const REAL_VALUE_TYPE *from) |
| int | decimal_do_compare (const REAL_VALUE_TYPE *a, const REAL_VALUE_TYPE *b, int nan_result) |
| void | decimal_round_for_format (const struct real_format *fmt, REAL_VALUE_TYPE *r) |
| void | decimal_real_convert (REAL_VALUE_TYPE *r, enum machine_mode mode, const REAL_VALUE_TYPE *a) |
| void | decimal_real_to_decimal (char *str, const REAL_VALUE_TYPE *r_orig, size_t buf_size, size_t digits ATTRIBUTE_UNUSED, int crop_trailing_zeros ATTRIBUTE_UNUSED) |
| static bool | decimal_do_add (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *op0, const REAL_VALUE_TYPE *op1, int subtract_p) |
| static bool | decimal_do_multiply (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *op0, const REAL_VALUE_TYPE *op1) |
| static bool | decimal_do_divide (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *op0, const REAL_VALUE_TYPE *op1) |
| void | decimal_do_fix_trunc (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *a) |
| HOST_WIDE_INT | decimal_real_to_integer (const REAL_VALUE_TYPE *r) |
| void | decimal_real_to_integer2 (HOST_WIDE_INT *plow, HOST_WIDE_INT *phigh, const REAL_VALUE_TYPE *r) |
| bool | decimal_real_arithmetic (REAL_VALUE_TYPE *r, enum tree_code code, const REAL_VALUE_TYPE *op0, const REAL_VALUE_TYPE *op1) |
| void | decimal_real_maxval (REAL_VALUE_TYPE *r, int sign, enum machine_mode mode) |
| static bool decimal_do_add | ( | REAL_VALUE_TYPE * | r, | |
| const REAL_VALUE_TYPE * | op0, | |||
| const REAL_VALUE_TYPE * | op1, | |||
| int | subtract_p | |||
| ) | [static] |
Definition at line 463 of file dfp.c.
References DEC_Inexact, DEC_INIT_DECIMAL128, decContextDefault(), decimal_from_decnumber(), decimal_to_decnumber(), decNumberAdd(), and decNumberSubtract().
Referenced by decimal_real_arithmetic().
| int decimal_do_compare | ( | const REAL_VALUE_TYPE * | a, | |
| const REAL_VALUE_TYPE * | b, | |||
| int | nan_result | |||
| ) |
Definition at line 341 of file dfp.c.
References a1, DEC_INIT_DECIMAL128, decContextDefault(), decimal128ToNumber(), decimal_from_binary(), decNumberCompare(), decNumberIsNaN, decNumberIsNegative, decNumberIsZero, and REAL_VALUE_TYPE.
Referenced by do_compare().
| static bool decimal_do_divide | ( | REAL_VALUE_TYPE * | r, | |
| const REAL_VALUE_TYPE * | op0, | |||
| const REAL_VALUE_TYPE * | op1 | |||
| ) | [static] |
Definition at line 512 of file dfp.c.
References DEC_Inexact, DEC_INIT_DECIMAL128, decContextDefault(), decimal_from_decnumber(), decimal_to_decnumber(), and decNumberDivide().
Referenced by decimal_real_arithmetic().
| void decimal_do_fix_trunc | ( | REAL_VALUE_TYPE * | r, | |
| const REAL_VALUE_TYPE * | a | |||
| ) |
Definition at line 535 of file dfp.c.
References DEC_INIT_DECIMAL128, DEC_ROUND_DOWN, decContextDefault(), decimal128ToNumber(), decimal_from_decnumber(), and decNumberToIntegralValue().
Referenced by decimal_real_arithmetic(), and do_fix_trunc().
| static bool decimal_do_multiply | ( | REAL_VALUE_TYPE * | r, | |
| const REAL_VALUE_TYPE * | op0, | |||
| const REAL_VALUE_TYPE * | op1 | |||
| ) | [static] |
Definition at line 490 of file dfp.c.
References DEC_Inexact, DEC_INIT_DECIMAL128, decContextDefault(), decimal_from_decnumber(), decimal_to_decnumber(), and decNumberMultiply().
Referenced by decimal_real_arithmetic().
| static void decimal_from_binary | ( | REAL_VALUE_TYPE * | to, | |
| const REAL_VALUE_TYPE * | from | |||
| ) | [static] |
Definition at line 327 of file dfp.c.
References decimal_real_from_string(), and real_to_decimal().
Referenced by decimal_do_compare(), decimal_real_arithmetic(), and decimal_real_convert().
| static void decimal_from_decnumber | ( | REAL_VALUE_TYPE * | r, | |
| decNumber * | dn, | |||
| decContext * | context | |||
| ) | [static] |
Definition at line 63 of file dfp.c.
References DEC_INIT_DECIMAL128, DEC_Overflow, decContextDefault(), decimal128FromNumber(), decNumberIsInfinite, decNumberIsNaN, decNumberIsNegative, decNumberIsZero, memset, REAL_VALUE_TYPE, rvc_inf, rvc_nan, rvc_normal, rvc_zero, decContext::status, and decContext::traps.
Referenced by decimal_do_add(), decimal_do_divide(), decimal_do_fix_trunc(), decimal_do_multiply(), decimal_real_from_string(), decimal_round_for_format(), decode_decimal128(), decode_decimal32(), and decode_decimal64().
| bool decimal_real_arithmetic | ( | REAL_VALUE_TYPE * | r, | |
| enum tree_code | code, | |||
| const REAL_VALUE_TYPE * | op0, | |||
| const REAL_VALUE_TYPE * | op1 | |||
| ) |
Definition at line 607 of file dfp.c.
References a, b, decimal128::bytes, decimal_do_add(), decimal_do_divide(), decimal_do_fix_trunc(), decimal_do_multiply(), decimal_from_binary(), gcc_unreachable, real_compare(), REAL_VALUE_TYPE, and rvc_nan.
Referenced by real_arithmetic().
| void decimal_real_convert | ( | REAL_VALUE_TYPE * | r, | |
| enum machine_mode | mode, | |||
| const REAL_VALUE_TYPE * | a | |||
| ) |
Definition at line 429 of file dfp.c.
References real_format::b, decimal_from_binary(), decimal_to_binary(), and REAL_MODE_FORMAT.
Referenced by real_convert(), and round_for_format().
| void decimal_real_from_string | ( | REAL_VALUE_TYPE * | r, | |
| const char * | s | |||
| ) |
Definition at line 92 of file dfp.c.
References DEC_INIT_DECIMAL128, decContextDefault(), decimal_from_decnumber(), and decNumberFromString().
Referenced by decimal_from_binary(), decimal_real_maxval(), and real_from_string3().
| void decimal_real_maxval | ( | REAL_VALUE_TYPE * | r, | |
| int | sign, | |||
| enum machine_mode | mode | |||
| ) |
Definition at line 694 of file dfp.c.
References decimal_real_from_string(), gcc_unreachable, and max.
Referenced by real_maxval().
| void decimal_real_to_decimal | ( | char * | str, | |
| const REAL_VALUE_TYPE * | r_orig, | |||
| size_t | buf_size, | |||
| size_t digits | ATTRIBUTE_UNUSED, | |||
| int crop_trailing_zeros | ATTRIBUTE_UNUSED | |||
| ) |
Definition at line 449 of file dfp.c.
References decimal128ToString(), and gcc_assert.
Referenced by real_to_decimal().
| HOST_WIDE_INT decimal_real_to_integer | ( | const REAL_VALUE_TYPE * | r | ) |
Definition at line 552 of file dfp.c.
References DEC_INIT_DECIMAL128, DEC_ROUND_DOWN, decContextDefault(), decimal128ToNumber(), decNumberRescale(), decNumberToIntegralValue(), decNumberToString(), decNumberZero(), real_from_string(), real_to_integer(), and REAL_VALUE_TYPE.
Referenced by real_to_integer().
| void decimal_real_to_integer2 | ( | HOST_WIDE_INT * | plow, | |
| HOST_WIDE_INT * | phigh, | |||
| const REAL_VALUE_TYPE * | r | |||
| ) |
Definition at line 578 of file dfp.c.
References DEC_INIT_DECIMAL128, DEC_ROUND_DOWN, decContextDefault(), decimal128ToNumber(), decNumberRescale(), decNumberToIntegralValue(), decNumberToString(), decNumberZero(), real_from_string(), real_to_integer2(), and REAL_VALUE_TYPE.
Referenced by real_to_integer2().
| void decimal_round_for_format | ( | const struct real_format * | fmt, | |
| REAL_VALUE_TYPE * | r | |||
| ) |
Definition at line 383 of file dfp.c.
References DEC_INIT_DECIMAL128, DEC_INIT_DECIMAL32, DEC_INIT_DECIMAL64, decContextDefault(), decimal128ToNumber(), decimal32FromNumber(), decimal32ToNumber(), decimal64FromNumber(), decimal64ToNumber(), decimal_double_format, decimal_from_decnumber(), decimal_quad_format, decimal_single_format, gcc_unreachable, and rvc_normal.
Referenced by round_for_format().
| static void decimal_to_binary | ( | REAL_VALUE_TYPE * | to, | |
| const REAL_VALUE_TYPE * | from, | |||
| enum machine_mode | mode | |||
| ) | [static] |
Definition at line 311 of file dfp.c.
References decimal128ToString(), and real_from_string3().
Referenced by decimal_real_convert().
Definition at line 110 of file dfp.c.
References decNumber::bits, DEC_INIT_DECIMAL128, decContextDefault(), decimal128ToNumber(), DECNEG, decNumberFromString(), decNumberIsNegative, decNumberZero(), gcc_assert, gcc_unreachable, rvc_inf, rvc_nan, rvc_normal, and rvc_zero.
Referenced by decimal_do_add(), decimal_do_divide(), decimal_do_multiply(), encode_decimal128(), encode_decimal32(), and encode_decimal64().
| void decode_decimal128 | ( | const struct real_format *fmt | ATTRIBUTE_UNUSED, | |
| REAL_VALUE_TYPE * | r, | |||
| const long * | buf | |||
| ) |
Definition at line 278 of file dfp.c.
References decimal128::bytes, DEC_INIT_DECIMAL128, decContextDefault(), decimal128ToNumber(), decimal_from_decnumber(), dfp_byte_swap(), and FLOAT_WORDS_BIG_ENDIAN.
Referenced by decode_decimal_quad().
| void decode_decimal32 | ( | const struct real_format *fmt | ATTRIBUTE_UNUSED, | |
| REAL_VALUE_TYPE * | r, | |||
| const long * | buf | |||
| ) |
Definition at line 168 of file dfp.c.
References decimal32::bytes, DEC_INIT_DECIMAL128, decContextDefault(), decimal32ToNumber(), decimal_from_decnumber(), dfp_byte_swap(), and FLOAT_WORDS_BIG_ENDIAN.
Referenced by decode_decimal_single().
| void decode_decimal64 | ( | const struct real_format *fmt | ATTRIBUTE_UNUSED, | |
| REAL_VALUE_TYPE * | r, | |||
| const long * | buf | |||
| ) |
Definition at line 218 of file dfp.c.
References decimal64::bytes, DEC_INIT_DECIMAL128, decContextDefault(), decimal64ToNumber(), decimal_from_decnumber(), dfp_byte_swap(), and FLOAT_WORDS_BIG_ENDIAN.
Referenced by decode_decimal_double().
Definition at line 40 of file dfp.c.
Referenced by decode_decimal128(), decode_decimal32(), decode_decimal64(), encode_decimal128(), encode_decimal32(), and encode_decimal64().
| void encode_decimal128 | ( | const struct real_format *fmt | ATTRIBUTE_UNUSED, | |
| long * | buf, | |||
| const REAL_VALUE_TYPE * | r | |||
| ) |
Definition at line 246 of file dfp.c.
References decimal128::bytes, DEC_INIT_DECIMAL128, decContextDefault(), decimal128FromNumber(), decimal_to_decnumber(), dfp_byte_swap(), and FLOAT_WORDS_BIG_ENDIAN.
Referenced by encode_decimal_quad().
| void encode_decimal32 | ( | const struct real_format *fmt | ATTRIBUTE_UNUSED, | |
| long * | buf, | |||
| const REAL_VALUE_TYPE * | r | |||
| ) |
Definition at line 146 of file dfp.c.
References decimal32::bytes, DEC_INIT_DECIMAL128, decContextDefault(), decimal32FromNumber(), decimal_to_decnumber(), dfp_byte_swap(), and FLOAT_WORDS_BIG_ENDIAN.
Referenced by encode_decimal_single().
| void encode_decimal64 | ( | const struct real_format *fmt | ATTRIBUTE_UNUSED, | |
| long * | buf, | |||
| const REAL_VALUE_TYPE * | r | |||
| ) |
Definition at line 190 of file dfp.c.
References decimal64::bytes, DEC_INIT_DECIMAL128, decContextDefault(), decimal64FromNumber(), decimal_to_decnumber(), dfp_byte_swap(), and FLOAT_WORDS_BIG_ENDIAN.
Referenced by encode_decimal_double().
1.5.6