From: Richard Stallman Date: Thu, 28 May 1992 18:41:59 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f529f0a6e2833e74da8ebdfc55f9800ea30284a;p=gcc.git *** empty log message *** From-SVN: r1112 --- diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h index 580a0c33e41..5992413a3fc 100644 --- a/gcc/config/i386/sysv4.h +++ b/gcc/config/i386/sysv4.h @@ -22,6 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "i386.h" /* Base i386 target machine definitions */ #include "att386.h" /* Use the i386 AT&T assembler syntax */ #include "svr4.h" /* Definitions common to all SVR4 targets */ +#include "real.h" #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (i386 System V Release 4)"); @@ -57,6 +58,36 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define CPP_PREDEFINES \ "-Di386 -Dunix -D__svr4__ -Asystem(unix) -Acpu(i386) -Amachine(i386)" +/* If the host and target formats match, output the floats as hex. */ +#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT +#if defined (HOST_WORDS_BIG_ENDIAN) == WORDS_BIG_ENDIAN +/* This is how to output assembly code to define a `float' constant. + We always have to use a .long pseudo-op to do this because the native + SVR4 ELF assembler is buggy and it generates incorrect values when we + try to use the .float pseudo-op instead. */ + +#undef ASM_OUTPUT_FLOAT +#define ASM_OUTPUT_FLOAT(FILE,VALUE) \ +do { long value; \ + REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \ + fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value); \ + } while (0) + +/* This is how to output assembly code to define a `double' constant. + We always have to use a pair of .long pseudo-ops to do this because + the native SVR4 ELF assembler is buggy and it generates incorrect + values when we try to use the the .double pseudo-op instead. */ + +#undef ASM_OUTPUT_DOUBLE +#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ +do { long value[2]; \ + REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \ + fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \ + fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \ + } while (0) +#endif /* word order matches */ +#endif /* HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT */ + /* Output at beginning of assembler file. */ /* The .file command should always begin the output. */ diff --git a/gcc/config/i860/sysv4.h b/gcc/config/i860/sysv4.h index bfed5f73e2a..9c208197cad 100644 --- a/gcc/config/i860/sysv4.h +++ b/gcc/config/i860/sysv4.h @@ -60,6 +60,55 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ fprintf (FILE, "]@%s", PART_CODE); \ } while (0) +/* If the host and target formats match, output the floats as hex. */ +#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT +#if defined (HOST_WORDS_BIG_ENDIAN) == WORDS_BIG_ENDIAN + +/* This is how to output an assembler line defining a `double' constant. + Note that the native i860/svr4 ELF assembler can't properly handle + infinity. It generates an incorrect (non-infinity) value when given + `.double 99e9999' and it doesn't grok `inf' at all. It also mishandles + NaNs and -0.0. */ + +#undef ASM_OUTPUT_DOUBLE +#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ + { \ + if (REAL_VALUE_ISINF (VALUE) \ + || REAL_VALUE_ISNAN (VALUE) \ + || REAL_VALUE_MINUS_ZERO (VALUE)) \ + { \ + long t[2]; \ + REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \ + fprintf (FILE, "\t.word 0x%lx\n\t.word 0x%lx\n", t[0], t[1]); \ + } \ + else \ + fprintf (FILE, "\t.double 0r%.17g\n", VALUE); \ + } + +/* This is how to output an assembler line defining a `float' constant. + Note that the native i860/svr4 ELF assembler can't properly handle + infinity. It actually generates an assembly time error when given + `.float 99e9999' and it doesn't grok `inf' at all. It also mishandles + NaNs and -0.0. */ + +#undef ASM_OUTPUT_FLOAT +#define ASM_OUTPUT_FLOAT(FILE,VALUE) \ + { \ + if (REAL_VALUE_ISINF (VALUE) \ + || REAL_VALUE_ISNAN (VALUE) \ + || REAL_VALUE_MINUS_ZERO (VALUE)) \ + { \ + long t; \ + REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \ + fprintf (FILE, "\t.word 0x%lx\n", t); \ + } \ + else \ + fprintf (FILE, "\t.single 0r%.9g\n", VALUE); \ + } + +#endif /* word order matches */ +#endif /* HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT */ + #undef ASM_FILE_START #define ASM_FILE_START(FILE) \ do { output_file_directive (FILE, main_input_filename); \