1 /* Subroutines for the C front end on the POWER and PowerPC architectures.
3 Free Software Foundation, Inc.
5 Contributed by Zack Weinberg <zack@codesourcery.com>
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
26 #include "coretypes.h"
34 /* Handle the machine specific pragma longcall. Its syntax is
36 # pragma longcall ( TOGGLE )
38 where TOGGLE is either 0 or 1.
40 rs6000_default_long_calls is set to the value of TOGGLE, changing
41 whether or not new function declarations receive a longcall
42 attribute by default. */
44 #define SYNTAX_ERROR(msgid) do { \
46 warning ("ignoring malformed #pragma longcall"); \
51 rs6000_pragma_longcall (pfile)
52 cpp_reader *pfile ATTRIBUTE_UNUSED;
56 /* If we get here, generic code has already scanned the directive
57 leader and the word "longcall". */
59 if (c_lex (&x) != CPP_OPEN_PAREN)
60 SYNTAX_ERROR ("missing open paren");
61 if (c_lex (&n) != CPP_NUMBER)
62 SYNTAX_ERROR ("missing number");
63 if (c_lex (&x) != CPP_CLOSE_PAREN)
64 SYNTAX_ERROR ("missing close paren");
66 if (n != integer_zero_node && n != integer_one_node)
67 SYNTAX_ERROR ("number must be 0 or 1");
69 if (c_lex (&x) != CPP_EOF)
70 warning ("junk at end of #pragma longcall");
72 rs6000_default_long_calls = (n == integer_one_node);
75 /* Handle defining many CPP flags based on TARGET_xxx. As a general
76 policy, rather than trying to guess what flags a user might want a
77 #define for, it's better to define a flag for everything. */
79 #define builtin_define(TXT) cpp_define (pfile, TXT)
80 #define builtin_assert(TXT) cpp_assert (pfile, TXT)
83 rs6000_cpu_cpp_builtins (pfile)
87 builtin_define ("_ARCH_PWR2");
88 else if (TARGET_POWER)
89 builtin_define ("_ARCH_PWR");
91 builtin_define ("_ARCH_PPC");
93 builtin_define ("_ARCH_PPC64");
94 if (! TARGET_POWER && ! TARGET_POWER2 && ! TARGET_POWERPC)
95 builtin_define ("_ARCH_COM");
97 builtin_define ("__ALTIVEC__");
99 builtin_define ("__SPE__");
100 if (TARGET_SOFT_FLOAT)
101 builtin_define ("_SOFT_FLOAT");
102 /* Used by lwarx/stwcx. errata work-around. */
103 if (rs6000_cpu == PROCESSOR_PPC405)
104 builtin_define ("__PPC405__");
106 /* May be overridden by target configuration. */
107 RS6000_CPU_CPP_ENDIAN_BUILTINS();
109 if (TARGET_LONG_DOUBLE_128)
110 builtin_define ("__LONG_DOUBLE_128__");
112 switch (rs6000_current_abi)
115 builtin_define ("_CALL_SYSV");
118 builtin_define ("_CALL_AIX");
121 builtin_define ("_CALL_AIXDESC");
122 builtin_define ("_CALL_AIX");
125 builtin_define ("_CALL_DARWIN");