--- gcc/config/i860v4.h 2018/04/24 17:54:08 1.1.1.2 +++ gcc/config/i860v4.h 2018/04/24 17:59:03 1.1.1.3 @@ -60,6 +60,55 @@ the Free Software Foundation, 675 Mass A 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 %.20e\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.float %.12e\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); \ @@ -129,3 +178,19 @@ tdesc_section () \ in_section = in_tdesc; \ } \ } + +#ifdef OUTPUT_TDESC +#undef ASM_FILE_END +#define ASM_FILE_END(FILE) \ +do { \ + if (current_function_original_name != NULL) { \ + tdesc_section(); \ + fprintf ((FILE), "%s __ETEXT\n", ASM_LONG); \ + fprintf ((FILE), "%s 0\n", ASM_LONG); \ + text_section(); \ + fputs("__ETEXT:\n", (FILE)); \ + } \ + fprintf ((FILE), "\t.ident\t\"GCC: (GNU) %s\"\n", \ + version_string); \ + } while (0) +#endif