* varasm.c (assemble_real): Use REAL_VALUE_TO_x and assemble_integer
[official-gcc.git] / gcc / config / m68k / next.h
blob3ccffc8ee0cef8345eb1b557bd1fab585075650a
1 /* Target definitions for GNU compiler for mc680x0 running NeXTSTEP
2 Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999
3 Free Software Foundation, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #include "m68k/m68k.h"
23 #include "nextstep.h"
25 /* See m68k.h. 0407 means 68040 (or 68030 or 68020, with 68881/2). */
27 #define TARGET_DEFAULT (MASK_68040|MASK_BITFIELD|MASK_68881|MASK_68020)
29 /* Boundary (in *bits*) on which stack pointer should be aligned. */
31 #undef STACK_BOUNDARY
32 #define STACK_BOUNDARY 32
34 /* Names to predefine in the preprocessor for this target machine. */
36 #define CPP_PREDEFINES "-Dmc68000 -Dm68k -DNeXT -Dunix -D__MACH__ -D__BIG_ENDIAN__ -D__ARCHITECTURE__=\"m68k\" -Asystem=unix -Asystem=mach -Acpu=m68k -Amachine=m68k -D_NEXT_SOURCE"
38 /* Every structure or union's size must be a multiple of 2 bytes.
39 (Why isn't this in m68k.h?) */
41 #define STRUCTURE_SIZE_BOUNDARY 16
43 #undef ASM_OUTPUT_FLOAT_OPERAND
44 #ifdef REAL_VALUE_TO_TARGET_SINGLE
45 #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \
46 do { \
47 long hex; \
48 REAL_VALUE_TO_TARGET_SINGLE (VALUE, hex); \
49 fprintf (FILE, "#0%c%lx", (CODE) == 'f' ? 'b' : 'x', hex); \
50 } while (0)
51 #else
52 #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \
53 do{ \
54 if (CODE != 'f') \
55 { \
56 long l; \
57 REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
58 if (sizeof (int) == sizeof (long)) \
59 asm_fprintf ((FILE), "%I0x%x", (int) l); \
60 else \
61 asm_fprintf ((FILE), "%I0x%lx", l); \
62 } \
63 else if (REAL_VALUE_ISINF (VALUE)) \
64 { \
65 if (REAL_VALUE_NEGATIVE (VALUE)) \
66 fprintf (FILE, "#0r-99e999"); \
67 else \
68 fprintf (FILE, "#0r99e999"); \
69 } \
70 else \
71 { char dstr[30]; \
72 REAL_VALUE_TO_DECIMAL ((VALUE), "%.9g", dstr); \
73 fprintf (FILE, "#0r%s", dstr); \
74 } \
75 } while (0)
76 #endif
78 #undef ASM_OUTPUT_DOUBLE_OPERAND
79 #ifdef REAL_VALUE_TO_TARGET_DOUBLE
80 #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
81 do { \
82 long hex[2]; \
83 REAL_VALUE_TO_TARGET_DOUBLE (VALUE, hex); \
84 fprintf (FILE, "#0b%lx%08lx", hex[0], hex[1]); \
85 } while (0)
86 #else
87 #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
88 do { if (REAL_VALUE_ISINF (VALUE)) \
89 { \
90 if (REAL_VALUE_NEGATIVE (VALUE)) \
91 fprintf (FILE, "#0r-99e999"); \
92 else \
93 fprintf (FILE, "#0r99e999"); \
94 } \
95 else \
96 { char dstr[30]; \
97 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20g", dstr); \
98 fprintf (FILE, "#0r%s", dstr); \
99 } \
100 } while (0)
101 #endif
103 /* We do not define JUMP_TABLES_IN_TEXT_SECTION, since we wish to keep
104 the text section pure. There is no point in addressing the jump
105 tables using pc relative addressing, since they are not in the text
106 section, so we undefine CASE_VECTOR_PC_RELATIVE. This also
107 causes the compiler to use absolute addresses in the jump table,
108 so we redefine CASE_VECTOR_MODE to be SImode. */
110 #undef CASE_VECTOR_MODE
111 #define CASE_VECTOR_MODE SImode
112 #undef CASE_VECTOR_PC_RELATIVE
114 /* Make sure jump tables have the same alignment as other pointers. */
116 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
117 { ASM_OUTPUT_ALIGN (FILE, 1); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
119 /* Don't treat addresses involving labels differently from symbol names.
120 Previously, references to labels generated pc-relative addressing modes
121 while references to symbol names generated absolute addressing modes. */
123 #undef GO_IF_INDEXABLE_BASE
124 #define GO_IF_INDEXABLE_BASE(X, ADDR) \
125 { if (LEGITIMATE_BASE_REG_P (X)) goto ADDR; }
127 /* This accounts for the return pc and saved fp on the m68k. */
129 #define OBJC_FORWARDING_STACK_OFFSET 8
130 #define OBJC_FORWARDING_MIN_OFFSET 8
132 /* FINALIZE_TRAMPOLINE enables executable stack. The
133 __enable_execute_stack also clears the insn cache. */
135 #undef FINALIZE_TRAMPOLINE
136 #define FINALIZE_TRAMPOLINE(TRAMP) \
137 emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), \
138 0, VOIDmode, 1, memory_address (SImode, (TRAMP)), Pmode)
140 /* A C expression used to clear the instruction cache from
141 address BEG to address END. On NeXTSTEP this i a system trap. */
143 #define CLEAR_INSN_CACHE(BEG, END) \
144 asm volatile ("trap #2")
146 /* GCC is the primary compiler for NeXTSTEP, so we don't need this. */
147 #undef PCC_STATIC_STRUCT_RETURN