diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-21 16:10:36 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-21 16:10:36 +0000 |
commit | 1268285a29c29c7772fc29e3ab2e19fc4d264cc2 (patch) | |
tree | cf255ab7cc385de8be819f436b5513ec3c5357c2 /gcc/real.h | |
parent | 3160db1dc46f78ddbaa809d1904690ab8d22e51f (diff) | |
download | gcc-1268285a29c29c7772fc29e3ab2e19fc4d264cc2.tar.gz |
* real.c (struct real_format): Move to real.h.
(real_format_for_mode): Rename from fmt_for_mode; update all users;
initialize with ieee defaults.
(real_to_target_fmt, real_from_target_fmt): New.
(ieee_single_format, ieee_double_format, ieee_extended_motorola_format,
ieee_extended_intel_96_format, ieee_extended_intel_128_format,
ieee_quad_format, i370_single_format, i370_double_format,
c4x_single_format, c4x_extended_format): Rename from s/_format//.
(ieee_quad_format): Fix emin.
(format_for_size, init_real_once): Remove.
* real.h (struct real_format): Move from real.c.
(real_format_for_mode): Declare.
(real_to_target_fmt, real_from_target_fmt): Declare.
(ieee_single_format, ieee_double_format, ieee_extended_motorola_format,
ieee_extended_intel_96_format, ieee_extended_intel_128_format,
ieee_quad_format, vax_f_format, vax_d_format, vax_g_format,
i370_single_format, i370_double_format, c4x_single_format,
c4x_extended_format): Declare.
* toplev.c (do_compile): Don't call init_real_once.
* defaults.h (INTEL_EXTENDED_IEEE_FORMAT): Remove.
* doc/tm.texi (INTEL_EXTENDED_IEEE_FORMAT): Remove.
* config/alpha/alpha.h (TARGET_FLOAT_FORMAT): Define.
* config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): 64, if vax mode.
* config/alpha/alpha.c (override_options): Set real_format_for_mode
for VAX, if enabled.
* config/c4x/c4x.c (c4x_override_options): Set real_format_for_mode
for C4X.
* config/i370/i370.h (OVERRIDE_OPTIONS): New.
* config/i370/i370.c (override_options): New.
* config/i370/i370-protos.h: Update.
* config/i386/i386.c (override_options): Set real_format_for_mode
for Intel 80-bit extended.
* config/i386/i386.h (INTEL_EXTENDED_IEEE_FORMAT): Remove.
* config/i960/i960.h (LONG_DOUBLE_TYPE_SIZE): Mind -mlong-double-64.
(OVERRIDE_OPTIONS): Move code...
* config/i960/i960.c (i960_initialize): ... here. Set
real_format_for_mode for Intel 80-bit extended.
* config/ia64/ia64.c (ia64_override_options): Set real_format_for_mode
for Intel 80-bit extended, if enabled.
* config/m68k/m68k.c (override_options): Set real_format_for_mode
for Motorola 96-bit extended.
* config/vax/vax.h (OVERRIDE_OPTIONS): New.
* config/vax/vax.c (override_options): New.
* config/vax/vax-protos.h: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57388 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.h')
-rw-r--r-- | gcc/real.h | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/gcc/real.h b/gcc/real.h index d59e5202a1f..6f8f7d8ef04 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -95,10 +95,44 @@ extern char test_real_width # endif #endif -/* Declare functions in real.c. */ -/* Initialize the emulator. */ -extern void init_real_once PARAMS ((void)); +/* Describes the properties of the specific target format in use. */ +struct real_format +{ + /* Move to and from the target bytes. */ + void (*encode) (const struct real_format *, long *, const REAL_VALUE_TYPE *); + void (*decode) (const struct real_format *, REAL_VALUE_TYPE *, const long *); + + /* The radix of the exponent and digits of the significand. */ + int b; + + /* log2(b). */ + int log2_b; + + /* Size of the significand in digits of radix B. */ + int p; + + /* The minimum negative integer, x, such that b**(x-1) is normalized. */ + int emin; + + /* The maximum integer, x, such that b**(x-1) is representable. */ + int emax; + + /* Properties of the format. */ + bool has_nans; + bool has_inf; + bool has_denorm; + bool has_signed_zero; + bool qnan_msb_set; +}; + + +/* The target format used for each floating floating point mode. + Indexed by MODE - QFmode. */ +extern const struct real_format *real_format_for_mode[TFmode - QFmode + 1]; + + +/* Declare functions in real.c. */ /* Binary or unary arithmetic on tree_code. */ extern void real_arithmetic PARAMS ((REAL_VALUE_TYPE *, int, @@ -156,9 +190,13 @@ extern void real_from_integer PARAMS ((REAL_VALUE_TYPE *, unsigned HOST_WIDE_INT, HOST_WIDE_INT, int)); +extern long real_to_target_fmt PARAMS ((long *, const REAL_VALUE_TYPE *, + const struct real_format *)); extern long real_to_target PARAMS ((long *, const REAL_VALUE_TYPE *, enum machine_mode)); +extern void real_from_target_fmt PARAMS ((REAL_VALUE_TYPE *, const long *, + const struct real_format *)); extern void real_from_target PARAMS ((REAL_VALUE_TYPE *, const long *, enum machine_mode)); @@ -171,6 +209,23 @@ extern void real_2expN PARAMS ((REAL_VALUE_TYPE *, int)); extern unsigned int real_hash PARAMS ((const REAL_VALUE_TYPE *)); + +/* Target formats defined in real.c. */ +extern const struct real_format ieee_single_format; +extern const struct real_format ieee_double_format; +extern const struct real_format ieee_extended_motorola_format; +extern const struct real_format ieee_extended_intel_96_format; +extern const struct real_format ieee_extended_intel_128_format; +extern const struct real_format ieee_quad_format; +extern const struct real_format vax_f_format; +extern const struct real_format vax_d_format; +extern const struct real_format vax_g_format; +extern const struct real_format i370_single_format; +extern const struct real_format i370_double_format; +extern const struct real_format c4x_single_format; +extern const struct real_format c4x_extended_format; + + /* ====================================================================== */ /* Crap. */ |