1 /* Definitions of target machine for GNU compiler,
2 for IBM RS/6000 running AIX version 3.1.
3 Copyright (C) 1993,1997, 2000 Free Software Foundation, Inc.
4 Contributed by Richard Kenner (kenner@nyu.edu)
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)
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, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 #include "rs6000/rs6000.h"
25 #include "rs6000/aix.h"
27 /* Output something to declare an external symbol to the assembler. Most
28 assemblers don't need this.
30 If we haven't already, add "[RW]" (or "[DS]" for a function) to the
31 name. Normally we write this out along with the name. In the few cases
32 where we can't, it gets stripped off. */
34 #undef ASM_OUTPUT_EXTERNAL
35 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
36 { rtx _symref = XEXP (DECL_RTL (DECL), 0); \
37 if ((TREE_CODE (DECL) == VAR_DECL \
38 || TREE_CODE (DECL) == FUNCTION_DECL) \
39 && (NAME)[strlen (NAME) - 1] != ']') \
41 char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
42 strcpy (_name, XSTR (_symref, 0)); \
43 strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
44 XSTR (_symref, 0) = _name; \
46 fputs ("\t.extern ", FILE); \
47 assemble_name (FILE, XSTR (_symref, 0)); \
48 if (TREE_CODE (DECL) == FUNCTION_DECL) \
50 fputs ("\n\t.extern .", FILE); \
51 RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
56 /* Similar, but for libcall. We only have to worry about the function name,
57 not that of the descriptor. */
59 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
60 { fputs ("\t.extern .", FILE); \
61 assemble_name (FILE, XSTR (FUN, 0)); \
65 /* AIX 3.2 defined _AIX32, but older versions do not. */
67 #define CPP_PREDEFINES "-D_IBMR2 -D_AIX -Asystem=unix -Asystem=aix -Acpu=rs6000 -Amachine=rs6000"
69 /* AIX 3.1 uses bit 15 in CROR as the magic nop. */
70 #undef RS6000_CALL_GLUE
71 #define RS6000_CALL_GLUE "cror 15,15,15"
73 /* AIX 3.1 does not prepend underscores to itrunc, uitrunc, or mcount. */
75 #define RS6000_ITRUNC "itrunc"
77 #define RS6000_UITRUNC "uitrunc"
79 #define RS6000_MCOUNT ".mcount"