diff options
author | Richard Stallman <rms@gnu.org> | 1993-03-31 21:18:22 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-03-31 21:18:22 +0000 |
commit | f6ba6a91603140e5c8aec983ac0e3f48395013c9 (patch) | |
tree | 620e6dcf2a224699d8febfa53d13bf5ad7d07626 | |
parent | c1cfb2ae9ba507a30f76b6d73bede24446e4d876 (diff) | |
download | gcc-f6ba6a91603140e5c8aec983ac0e3f48395013c9.zip gcc-f6ba6a91603140e5c8aec983ac0e3f48395013c9.tar.gz gcc-f6ba6a91603140e5c8aec983ac0e3f48395013c9.tar.bz2 |
(LONG_DOUBLE_TYPE_SIZE): Set to 96, for XFmode support.
(ASM_OUTPUT_LONG_DOUBLE_OPERAND) New macro.
(ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE): Use REAL_VALUE_... macros.
(ASM_OUTPUT_DOUBLE_OPERAND): Likewise.
(ASM_OUTPUT_FLOAT_OPERAND): Likewise. Also, new argument CODE.
(ASM_OUTPUT_FLOAT): Delete special def for CROSS_COMPILE.
(ASM_OUTPUT_LONG_DOUBLE): New macro.
(PRINT_OPERAND_EXTRACT_FLOAT): Definitions deleted.
(PRINT_OPERAND_PRINT_FLOAT): Definitions deleted.
From-SVN: r3972
-rw-r--r-- | gcc/config/m68k/m68k.h | 105 |
1 files changed, 64 insertions, 41 deletions
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h index 4609e1d..3c5cd62 100644 --- a/gcc/config/m68k/m68k.h +++ b/gcc/config/m68k/m68k.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Sun 68000/68020 version. - Copyright (C) 1987, 1988 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1993 Free Software Foundation, Inc. This file is part of GNU CC. @@ -141,6 +141,15 @@ extern int target_flags; /* target machine storage layout */ +/* Define for XFmode extended real floating point support. + This will automatically cause REAL_ARITHMETIC to be defined. */ +#define LONG_DOUBLE_TYPE_SIZE 96 + +/* Define if you don't want extended real, but do want to use the + software floating point emulator for REAL_ARITHMETIC and + decimal <-> binary conversion. */ +/* #define REAL_ARITHMETIC */ + /* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. This is true for 68020 insns such as bfins and bfexts. @@ -1522,31 +1531,36 @@ __transfer_from_trampoline () \ #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM) +/* This is how to output a `long double' extended real constant. */ + +#define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \ +do { long l[3]; \ + REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \ + if (sizeof (int) == sizeof (long)) \ + fprintf (FILE, "\t.long 0x%x,0x%x,0x%x\n", l[0], l[1], l[2]); \ + else \ + fprintf (FILE, "\t.long 0x%lx,0x%lx,0x%lx\n", l[0], l[1], l[2]); \ + } while (0) + /* This is how to output an assembler line defining a `double' constant. */ -#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ - fprintf (FILE, "\t.double 0r%.20g\n", (VALUE)) +#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ + do { char dstr[30]; \ + REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ + fprintf (FILE, "\t.double 0r%s\n", dstr); \ + } while (0) /* This is how to output an assembler line defining a `float' constant. */ -/* Sun's assembler can't handle floating constants written as floating. - However, when cross-compiling, always use that in case format differs. */ - -#ifdef CROSS_COMPILE - -#define ASM_OUTPUT_FLOAT(FILE,VALUE) \ - fprintf (FILE, "\t.float 0r%.10g\n", (VALUE)) - -#else - -#define ASM_OUTPUT_FLOAT(FILE,VALUE) \ -do { union { float f; long l;} tem; \ - tem.f = (VALUE); \ - fprintf (FILE, "\t.long 0x%x\n", tem.l); \ +#define ASM_OUTPUT_FLOAT(FILE,VALUE) \ +do { long l; \ + REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \ + if (sizeof (int) == sizeof (long)) \ + fprintf (FILE, "\t.long 0x%x\n", l); \ + else \ + fprintf (FILE, "\t.long 0x%lx\n", l); \ } while (0) -#endif /* not CROSS_COMPILE */ - /* This is how to output an assembler line defining an `int' constant. */ #define ASM_OUTPUT_INT(FILE,VALUE) \ @@ -1649,13 +1663,41 @@ do { union { float f; long l;} tem; \ /* Output a float value (represented as a C double) as an immediate operand. This macro is a 68k-specific macro. */ -#define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \ - asm_fprintf (FILE, "%I0r%.9g", (VALUE)) + +#define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \ + do { \ + if (CODE == 'f') \ + { \ + char dstr[30]; \ + REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr); \ + asm_fprintf ((FILE), "%I0r%s", dstr); \ + } \ + else \ + { \ + long l; \ + REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \ + if (sizeof (int) == sizeof (long)) \ + asm_fprintf ((FILE), "%I0x%x", l); \ + else \ + asm_fprintf ((FILE), "%I0x%lx", l); \ + } \ + } while (0) /* Output a double value (represented as a C double) as an immediate operand. This macro is a 68k-specific macro. */ #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ - asm_fprintf (FILE, "%I0r%.20g", (VALUE)) + do { char dstr[30]; \ + REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ + asm_fprintf (FILE, "%I0r%s", dstr); \ + } while (0) + +/* Note, long double immediate operands are not actually + generated by m68k.md. */ +#define ASM_OUTPUT_LONG_DOUBLE_OPERAND(FILE,VALUE) \ + do { char dstr[30]; \ + REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ + asm_fprintf (FILE, "%I0r%s", dstr); \ + } while (0) /* Print operand X (an rtx) in assembler syntax to file FILE. CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. @@ -1692,25 +1734,6 @@ do { union { float f; long l;} tem; \ || (CODE) == '+' || (CODE) == '@' || (CODE) == '!' \ || (CODE) == '$' || (CODE) == '&' || (CODE) == '/') -#ifdef HOST_WORDS_BIG_ENDIAN -#define PRINT_OPERAND_EXTRACT_FLOAT(X) \ - u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); -#else -#define PRINT_OPERAND_EXTRACT_FLOAT(X) \ - u.i[0] = CONST_DOUBLE_HIGH (X); u.i[1] = CONST_DOUBLE_LOW (X); -#endif - -#ifdef CROSS_COMPILE -#define PRINT_OPERAND_PRINT_FLOAT(CODE, FILE) \ - ASM_OUTPUT_FLOAT_OPERAND (FILE, u1.f); -#else -#define PRINT_OPERAND_PRINT_FLOAT(CODE, FILE) \ -{ if (CODE == 'f') \ - ASM_OUTPUT_FLOAT_OPERAND (FILE, u1.f); \ - else \ - asm_fprintf (FILE, "%I0x%x", u1.i); } -#endif - /* A C compound statement to output to stdio stream STREAM the assembler syntax for an instruction operand X. X is an RTL expression. |