Initial revision
[official-gcc.git] / gcc / config / rs6000 / sol2.h
blobf75ad2b5885e24d476b10c5243f85ca27a0679e5
1 /* Definitions of target machine for GNU compiler,
2 for IBM RS/6000 running AIX version 3.1.
3 Copyright (C) 1996 Free Software Foundation, Inc.
4 Contributed by David Reese (Dave.Reese@East.Sun.COM)
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 #include "rs6000/sysv4le.h"
24 /* Default ABI to use */
25 #undef RS6000_ABI_NAME
26 #define RS6000_ABI_NAME "solaris"
28 #undef ASM_CPU_SPEC
29 #define ASM_CPU_SPEC "-le -s"
31 #undef TARGET_DEFAULT
32 #define TARGET_DEFAULT (MASK_POWERPC | \
33 MASK_NEW_MNEMONICS | \
34 MASK_LITTLE_ENDIAN | \
35 MASK_REGNAMES)
37 #undef LIB_DEFAULT_SPEC
38 #define LIB_DEFAULT_SPEC "%(lib_solaris)"
40 #undef STARTFILE_DEFAULT_SPEC
41 #define STARTFILE_DEFAULT_SPEC "%(startfile_solaris)"
43 #undef ENDFILE_DEFAULT_SPEC
44 #define ENDFILE_DEFAULT_SPEC "%(endfile_solaris)"
46 #undef LINK_START_DEFAULT_SPEC
47 #define LINK_START_DEFAULT_SPEC "%(link_start_solaris)"
49 #undef CPP_OS_DEFAULT_SPEC
50 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_solaris)"
52 #undef LINK_OS_DEFAULT_SPEC
53 #define LINK_OS_DEFAULT_SPEC "%(link_os_solaris)"
55 #undef CPP_ENDIAN_LITTLE_SPEC
56 #define CPP_ENDIAN_LITTLE_SPEC CPP_ENDIAN_SOLARIS_SPEC
58 /* Don't turn -B into -L if the argument specifies a relative file name. */
59 #undef RELATIVE_PREFIX_NOT_LINKDIR
61 #define DEFAULT_PCC_STRUCT_RETURN 0
63 #undef TARGET_VERSION
64 #define TARGET_VERSION fprintf (stderr, " (PowerPC Solaris)");
67 /* Macros to check register numbers against specific register classes. */
69 #undef PREFERRED_DEBUGGING_TYPE
70 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
73 #if 0
74 #undef ASM_OUTPUT_ALIGNED_LOCAL
75 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
76 do { \
77 fprintf ((FILE), "\t%s\t", ".lcomm"); \
78 assemble_name ((FILE), (NAME)); \
79 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
80 } while (0)
81 #endif
83 /* Like block addresses, stabs line numbers are relative to the
84 current function. */
86 /* use .stabd instead of .stabn */
88 #define ASM_STABN_OP ".stabd"
90 #undef ASM_OUTPUT_SOURCE_LINE
91 #define ASM_OUTPUT_SOURCE_LINE(file, line) \
92 do \
93 { \
94 static int sym_lineno = 1; \
95 char *_p; \
96 fprintf (file, "\t.stabd 68,0,%d,.LM%d-", \
97 line, sym_lineno); \
98 STRIP_NAME_ENCODING (_p, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
99 assemble_name (file, _p); \
100 fprintf (file, "\n.LM%d:\n", sym_lineno); \
101 sym_lineno += 1; \
103 while (0)
105 /* This is how to output an assembler line defining a `double' constant. */
107 #undef ASM_OUTPUT_DOUBLE
108 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
110 if (REAL_VALUE_ISINF (VALUE) \
111 || REAL_VALUE_ISNAN (VALUE) \
112 || REAL_VALUE_MINUS_ZERO (VALUE)) \
114 long t[2]; \
115 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
116 fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", \
117 t[0] & 0xffffffff, t[1] & 0xffffffff); \
119 else \
121 char str[30]; \
122 REAL_VALUE_TO_DECIMAL (VALUE, "%.20e", str); \
123 fprintf (FILE, "\t.double %s\n", str); \
127 /* This is how to output an assembler line defining a `float' constant. */
129 #undef ASM_OUTPUT_FLOAT
130 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
132 if (REAL_VALUE_ISINF (VALUE) \
133 || REAL_VALUE_ISNAN (VALUE) \
134 || REAL_VALUE_MINUS_ZERO (VALUE)) \
136 long t; \
137 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
138 fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
140 else \
142 char str[30]; \
143 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
144 fprintf (FILE, "\t.float %s\n", str); \
149 /* Sun-ppc assembler does not permit '.' in some symbol names.
150 Use 'name_.labelno' instead. */
151 #undef ASM_FORMAT_PRIVATE_NAME
152 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
153 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
154 sprintf ((OUTPUT), "%s_.%d", (NAME), (LABELNO)))
157 /* Define this macro as a C expression for the initializer of an
158 array of string to tell the driver program which options are
159 defaults for this target and thus do not need to be handled
160 specially when using `MULTILIB_OPTIONS'.
162 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
163 the target makefile fragment or if none of the options listed in
164 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
166 #undef MULTILIB_DEFAULTS
167 #define MULTILIB_DEFAULTS { "mlittle", "mcall-solaris" }