OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [config/] [mips/] [netbsd.h] - Blame information for rev 753

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 709 jeremybenn
/* Definitions of target machine for GNU compiler, for MIPS NetBSD systems.
2
   Copyright (C) 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
3
   2007, 2010, 2011 Free Software Foundation, Inc.
4
 
5
This file is part of GCC.
6
 
7
GCC 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 3, or (at your option)
10
any later version.
11
 
12
GCC 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.
16
 
17
You should have received a copy of the GNU General Public License
18
along with GCC; see the file COPYING3.  If not see
19
<http://www.gnu.org/licenses/>.  */
20
 
21
 
22
/* Define default target values.  */
23
 
24
#define TARGET_OS_CPP_BUILTINS()                        \
25
  do                                                    \
26
    {                                                   \
27
      NETBSD_OS_CPP_BUILTINS_ELF();                     \
28
      builtin_define ("__NO_LEADING_UNDERSCORES__");    \
29
      builtin_define ("__GP_SUPPORT__");                \
30
      if (TARGET_LONG64)                                \
31
        builtin_define ("__LONG64");                    \
32
                                                        \
33
      if (TARGET_ABICALLS)                              \
34
        builtin_define ("__ABICALLS__");                \
35
                                                        \
36
      if (mips_abi == ABI_EABI)                         \
37
        builtin_define ("__mips_eabi");                 \
38
      else if (mips_abi == ABI_N32)                     \
39
        builtin_define ("__mips_n32");                  \
40
      else if (mips_abi == ABI_64)                      \
41
        builtin_define ("__mips_n64");                  \
42
      else if (mips_abi == ABI_O64)                     \
43
        builtin_define ("__mips_o64");                  \
44
    }                                                   \
45
  while (0)
46
 
47
/* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for NetBSD.
48
   Specifically, they define too many namespace-invasive macros.  Override
49
   them here.  Note this is structured for easy comparison to the version
50
   in mips.h.
51
 
52
   FIXME: This probably isn't the best solution.  But in the absence
53
   of something better, it will have to do, for now.  */
54
 
55
#undef TARGET_CPU_CPP_BUILTINS
56
#define TARGET_CPU_CPP_BUILTINS()                               \
57
  do                                                            \
58
    {                                                           \
59
      builtin_assert ("cpu=mips");                              \
60
      builtin_define ("__mips__");                              \
61
      builtin_define ("_mips");                                 \
62
                                                                \
63
      /* No _R3000 or _R4000.  */                               \
64
      if (TARGET_64BIT)                                         \
65
        builtin_define ("__mips64");                            \
66
                                                                \
67
      if (TARGET_FLOAT64)                                       \
68
        builtin_define ("__mips_fpr=64");                       \
69
      else                                                      \
70
        builtin_define ("__mips_fpr=32");                       \
71
                                                                \
72
      if (TARGET_MIPS16)                                        \
73
        builtin_define ("__mips16");                            \
74
                                                                \
75
      MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info);    \
76
      MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info);    \
77
                                                                \
78
      if (ISA_MIPS1)                                            \
79
        builtin_define ("__mips=1");                            \
80
      else if (ISA_MIPS2)                                       \
81
        builtin_define ("__mips=2");                            \
82
      else if (ISA_MIPS3)                                       \
83
        builtin_define ("__mips=3");                            \
84
      else if (ISA_MIPS4)                                       \
85
        builtin_define ("__mips=4");                            \
86
      else if (ISA_MIPS32)                                      \
87
        {                                                       \
88
          builtin_define ("__mips=32");                         \
89
          builtin_define ("__mips_isa_rev=1");                  \
90
        }                                                       \
91
      else if (ISA_MIPS32R2)                                    \
92
        {                                                       \
93
          builtin_define ("__mips=32");                         \
94
          builtin_define ("__mips_isa_rev=2");                  \
95
        }                                                       \
96
      else if (ISA_MIPS64)                                      \
97
        {                                                       \
98
          builtin_define ("__mips=64");                         \
99
          builtin_define ("__mips_isa_rev=1");                  \
100
        }                                                       \
101
                                                                \
102
      if (TARGET_HARD_FLOAT)                                    \
103
        builtin_define ("__mips_hard_float");                   \
104
      else if (TARGET_SOFT_FLOAT)                               \
105
        builtin_define ("__mips_soft_float");                   \
106
                                                                \
107
      if (TARGET_SINGLE_FLOAT)                                  \
108
        builtin_define ("__mips_single_float");                 \
109
                                                                \
110
      if (TARGET_BIG_ENDIAN)                                    \
111
        builtin_define ("__MIPSEB__");                          \
112
      else                                                      \
113
        builtin_define ("__MIPSEL__");                          \
114
                                                                \
115
      /* No language dialect defines.  */                       \
116
                                                                \
117
      /* ABIs handled in TARGET_OS_CPP_BUILTINS.  */            \
118
    }                                                           \
119
  while (0)
120
 
121
 
122
/* Extra specs we need.  */
123
#undef SUBTARGET_EXTRA_SPECS
124
#define SUBTARGET_EXTRA_SPECS                                           \
125
  { "netbsd_cpp_spec",          NETBSD_CPP_SPEC },                      \
126
  { "netbsd_link_spec",         NETBSD_LINK_SPEC_ELF },                 \
127
  { "netbsd_entry_point",       NETBSD_ENTRY_POINT },
128
 
129
/* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD.  */
130
 
131
#undef SUBTARGET_CPP_SPEC
132
#define SUBTARGET_CPP_SPEC "%(netbsd_cpp_spec)"
133
 
134
/* Provide a LINK_SPEC appropriate for a NetBSD/mips target.
135
   This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
136
   the MIPS target.  */
137
 
138
#undef LINK_SPEC
139
#define LINK_SPEC \
140
  "%{EL:-m elf32lmip} \
141
   %{EB:-m elf32bmip} \
142
   %(endian_spec) \
143
   %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \
144
   %(netbsd_link_spec)"
145
 
146
#define NETBSD_ENTRY_POINT "__start"
147
 
148
#undef SUBTARGET_ASM_SPEC
149
#define SUBTARGET_ASM_SPEC \
150
  "%{!mno-abicalls: \
151
     %{!fno-PIC:%{!fno-pic:-KPIC}}}"
152
 
153
 
154
/* -G is incompatible with -KPIC which is the default, so only allow objects
155
   in the small data section if the user explicitly asks for it.  */
156
 
157
#undef MIPS_DEFAULT_GVALUE
158
#define MIPS_DEFAULT_GVALUE 0
159
 
160
 
161
#undef ASM_FINAL_SPEC
162
#undef SET_ASM_OP
163
 
164
 
165
/* NetBSD hasn't historically provided _flush_cache(), but rather
166
   _cacheflush(), which takes the same arguments as the former.  */
167
#undef CACHE_FLUSH_FUNC
168
#define CACHE_FLUSH_FUNC "_cacheflush"
169
 
170
 
171
/* Make gcc agree with <machine/ansi.h> */
172
 
173
#undef WCHAR_TYPE
174
#define WCHAR_TYPE "int"
175
 
176
#undef WCHAR_TYPE_SIZE
177
#define WCHAR_TYPE_SIZE 32
178
 
179
#undef WINT_TYPE
180
#define WINT_TYPE "int"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.