xref: /openbsd/gnu/usr.bin/gcc/gcc/config/rs6000/aix31.h (revision c87b03e5)
1 /* Definitions of target machine for GNU compiler,
2    for IBM RS/6000 running AIX version 3.1.
3    Copyright (C) 1993,1997, 2000, 2001 Free Software Foundation, Inc.
4    Contributed by Richard Kenner (kenner@nyu.edu)
5 
6 This file is part of GNU CC.
7 
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.
12 
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.
17 
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.  */
22 
23 
24 /* Output something to declare an external symbol to the assembler.  Most
25    assemblers don't need this.
26 
27    If we haven't already, add "[RW]" (or "[DS]" for a function) to the
28    name.  Normally we write this out along with the name.  In the few cases
29    where we can't, it gets stripped off.  */
30 
31 #undef ASM_OUTPUT_EXTERNAL
32 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)				\
33 { rtx _symref = XEXP (DECL_RTL (DECL), 0);				\
34   if ((TREE_CODE (DECL) == VAR_DECL					\
35        || TREE_CODE (DECL) == FUNCTION_DECL)				\
36       && (NAME)[strlen (NAME) - 1] != ']')				\
37     {									\
38       XSTR (_symref, 0) = concat (XSTR (_symref, 0),			\
39 				  (TREE_CODE (DECL) == FUNCTION_DECL	\
40 				   ? "[DS]" : "[RW]"), 			\
41 				  NULL);				\
42     }									\
43   fputs ("\t.extern ", FILE);						\
44   assemble_name (FILE, XSTR (_symref, 0));				\
45   if (TREE_CODE (DECL) == FUNCTION_DECL)				\
46     {									\
47       fputs ("\n\t.extern .", FILE);					\
48       RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0));			\
49     }									\
50   putc ('\n', FILE);							\
51 }
52 
53 /* Similar, but for libcall.  We only have to worry about the function name,
54    not that of the descriptor.  */
55 
56 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)	\
57 { fputs ("\t.extern .", FILE);			\
58   assemble_name (FILE, XSTR (FUN, 0));		\
59   putc ('\n', FILE);				\
60 }
61 
62 /* AIX 3.2 defined _AIX32, but older versions do not.  */
63 #undef TARGET_OS_CPP_BUILTINS
64 #define TARGET_OS_CPP_BUILTINS()         \
65   do                                     \
66     {                                    \
67       builtin_define ("_IBMR2");         \
68       builtin_define ("_AIX");           \
69       builtin_assert ("system=unix");    \
70       builtin_assert ("system=aix");     \
71       builtin_assert ("cpu=rs6000");     \
72       builtin_assert ("machine=rs6000"); \
73     }                                    \
74   while (0)
75 
76 /* AIX 3.1 uses bit 15 in CROR as the magic nop.  */
77 #undef RS6000_CALL_GLUE
78 #define RS6000_CALL_GLUE "cror 15,15,15"
79 
80 /* AIX 3.1 does not prepend underscores to itrunc, uitrunc, or mcount.  */
81 #undef RS6000_ITRUNC
82 #define RS6000_ITRUNC "itrunc"
83 #undef RS6000_UITRUNC
84 #define RS6000_UITRUNC "uitrunc"
85 #undef RS6000_MCOUNT
86 #define RS6000_MCOUNT ".mcount"
87 
88