aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-03-31 20:39:19 +0000
committerRichard Stallman <rms@gnu.org>1993-03-31 20:39:19 +0000
commitf29b2a444a9d340b092cd8325026602a111cd229 (patch)
treef1d2ca9f8f67419f864257dd5edaf323385b8e41
parentc42cb1965dd5a96e2f599bc5d35048f2cc60f58f (diff)
downloadgcc-f29b2a444a9d340b092cd8325026602a111cd229.zip
gcc-f29b2a444a9d340b092cd8325026602a111cd229.tar.gz
gcc-f29b2a444a9d340b092cd8325026602a111cd229.tar.bz2
(PRINT_OPERAND, ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE):
Use new REAL_VALUE... macros. (CHECK_FLOAT_VALUE): Call check_float_value. From-SVN: r3957
-rw-r--r--gcc/config/vax/vax.h49
1 files changed, 23 insertions, 26 deletions
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 8171fce..351a2f6 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. Vax version.
- Copyright (C) 1987, 1988, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1991, 1993 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -79,6 +79,10 @@ extern int target_flags;
/* Target machine storage layout */
+/* Define for software floating point emulation of VAX format
+ when cross compiling from a non-VAX host. */
+/* #define REAL_ARITHMETIC */
+
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields.
This is not true on the vax. */
@@ -898,22 +902,8 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CONST_INT, VOIDmode, 12))
/* note that it is very hard to accidentally create a number that fits in a
double but not in a float, since their ranges are almost the same */
-#define CHECK_FLOAT_VALUE(mode, d) \
- if ((mode) == SFmode) \
- { \
- if ((d) > 1.7014117331926444e+38) \
- { error ("magnitude of constant too large for `float'"); \
- (d) = 1.7014117331926444e+38; } \
- else if ((d) < -1.7014117331926444e+38) \
- { error ("magnitude of constant too large for `float'"); \
- (d) = -1.7014117331926444e+38; } \
- else if (((d) > 0) && ((d) < 2.9387358770557188e-39)) \
- { warning ("`float' constant truncated to zero"); \
- (d) = 0.0; } \
- else if (((d) < 0) && ((d) > -2.9387358770557188e-39)) \
- { warning ("`float' constant truncated to zero"); \
- (d) = 0.0; } \
- }
+
+#define CHECK_FLOAT_VALUE(mode, d) (check_float_value (mode, &d))
/* For future reference:
D Float: 9 bit, sign magnitude, excess 128 binary exponent
@@ -1075,13 +1065,18 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CONST_INT, VOIDmode, 12))
It is .dfloat or .gfloat, depending. */
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
- fprintf (FILE, "\t.%cfloat 0%c%.20e\n", ASM_DOUBLE_CHAR, \
- ASM_DOUBLE_CHAR, (VALUE))
+do { char dstr[30]; \
+ REAL_VALUE_TO_DECIMAL (VALUE, "%.20e", dstr); \
+ fprintf (FILE, "\t.%cfloat 0%c%s\n", ASM_DOUBLE_CHAR, \
+ ASM_DOUBLE_CHAR, dstr); \
+ } while (0);
/* This is how to output an assembler line defining a `float' constant. */
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
- fprintf (FILE, "\t.float 0f%.20e\n", (VALUE))
+ do { char dstr[30]; \
+ REAL_VALUE_TO_DECIMAL (VALUE, "%.20e", dstr); \
+ fprintf (FILE, "\t.float 0f%s\n", dstr); } while (0);
/* This is how to output an assembler line defining an `int' constant. */
@@ -1238,13 +1233,15 @@ VAX operand formatting codes:
else if (GET_CODE (X) == MEM) \
output_address (XEXP (X, 0)); \
else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
- { union { double d; int i[2]; } u; \
- u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
- fprintf (FILE, "$0f%.20e", u.d); } \
+ { REAL_VALUE_TYPE r; char dstr[30]; \
+ REAL_VALUE_FROM_CONST_DOUBLE (r, X); \
+ REAL_VALUE_TO_DECIMAL (r, "%.20e", dstr); \
+ fprintf (FILE, "$0f%s", dstr); } \
else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode) \
- { union { double d; int i[2]; } u; \
- u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
- fprintf (FILE, "$0%c%.20e", ASM_DOUBLE_CHAR, u.d); } \
+ { REAL_VALUE_TYPE r; char dstr[30]; \
+ REAL_VALUE_FROM_CONST_DOUBLE (r, X); \
+ REAL_VALUE_TO_DECIMAL (r, "%.20e", dstr); \
+ fprintf (FILE, "$0%c%s", ASM_DOUBLE_CHAR, dstr); } \
else { putc ('$', FILE); output_addr_const (FILE, X); }}
/* Print a memory operand whose address is X, on file FILE.