annotate gcc/config/i386/i386-c.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Subroutines used for macro/preprocessor support on the ia-32.
111
kono
parents: 67
diff changeset
2 Copyright (C) 2008-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 #include "config.h"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #include "system.h"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 #include "coretypes.h"
111
kono
parents: 67
diff changeset
23 #include "target.h"
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
24 #include "c-family/c-common.h"
111
kono
parents: 67
diff changeset
25 #include "memmodel.h"
kono
parents: 67
diff changeset
26 #include "tm_p.h"
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
27 #include "c-family/c-pragma.h"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 static bool ix86_pragma_target_parse (tree, tree);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 static void ix86_target_macros_internal
111
kono
parents: 67
diff changeset
31 (HOST_WIDE_INT, HOST_WIDE_INT, enum processor_type, enum processor_type, enum fpmath_unit,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 void (*def_or_undef) (cpp_reader *, const char *));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 /* Internal function to either define or undef the appropriate system
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 macros. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 static void
111
kono
parents: 67
diff changeset
37 ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
kono
parents: 67
diff changeset
38 HOST_WIDE_INT isa_flag2,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 enum processor_type arch,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 enum processor_type tune,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 enum fpmath_unit fpmath,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 void (*def_or_undef) (cpp_reader *,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 const char *))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 {
111
kono
parents: 67
diff changeset
45 /* For some of the k6/pentium varients there weren't separate ISA bits to
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 identify which tune/arch flag was passed, so figure it out here. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 size_t arch_len = strlen (ix86_arch_string);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 size_t tune_len = strlen (ix86_tune_string);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 int last_arch_char = ix86_arch_string[arch_len - 1];
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 int last_tune_char = ix86_tune_string[tune_len - 1];
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 /* Built-ins based on -march=. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 switch (arch)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 case PROCESSOR_I386:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 case PROCESSOR_I486:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 def_or_undef (parse_in, "__i486");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 def_or_undef (parse_in, "__i486__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 break;
111
kono
parents: 67
diff changeset
61 case PROCESSOR_LAKEMONT:
kono
parents: 67
diff changeset
62 /* Intel MCU is based on Intel Pentium CPU. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 case PROCESSOR_PENTIUM:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 def_or_undef (parse_in, "__i586");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 def_or_undef (parse_in, "__i586__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 def_or_undef (parse_in, "__pentium");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 def_or_undef (parse_in, "__pentium__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 if (isa_flag & OPTION_MASK_ISA_MMX)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 def_or_undef (parse_in, "__pentium_mmx__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 case PROCESSOR_PENTIUMPRO:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 def_or_undef (parse_in, "__i686");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 def_or_undef (parse_in, "__i686__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 def_or_undef (parse_in, "__pentiumpro");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 def_or_undef (parse_in, "__pentiumpro__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 case PROCESSOR_GEODE:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 def_or_undef (parse_in, "__geode");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 def_or_undef (parse_in, "__geode__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 case PROCESSOR_K6:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 def_or_undef (parse_in, "__k6");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 def_or_undef (parse_in, "__k6__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 if (last_arch_char == '2')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 def_or_undef (parse_in, "__k6_2__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 else if (last_arch_char == '3')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 def_or_undef (parse_in, "__k6_3__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 else if (isa_flag & OPTION_MASK_ISA_3DNOW)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 def_or_undef (parse_in, "__k6_3__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 case PROCESSOR_ATHLON:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 def_or_undef (parse_in, "__athlon");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 def_or_undef (parse_in, "__athlon__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 if (isa_flag & OPTION_MASK_ISA_SSE)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 def_or_undef (parse_in, "__athlon_sse__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 case PROCESSOR_K8:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 def_or_undef (parse_in, "__k8");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 def_or_undef (parse_in, "__k8__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 case PROCESSOR_AMDFAM10:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 def_or_undef (parse_in, "__amdfam10");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 def_or_undef (parse_in, "__amdfam10__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 break;
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
105 case PROCESSOR_BDVER1:
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
106 def_or_undef (parse_in, "__bdver1");
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
107 def_or_undef (parse_in, "__bdver1__");
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
108 break;
111
kono
parents: 67
diff changeset
109 case PROCESSOR_BDVER2:
kono
parents: 67
diff changeset
110 def_or_undef (parse_in, "__bdver2");
kono
parents: 67
diff changeset
111 def_or_undef (parse_in, "__bdver2__");
kono
parents: 67
diff changeset
112 break;
kono
parents: 67
diff changeset
113 case PROCESSOR_BDVER3:
kono
parents: 67
diff changeset
114 def_or_undef (parse_in, "__bdver3");
kono
parents: 67
diff changeset
115 def_or_undef (parse_in, "__bdver3__");
kono
parents: 67
diff changeset
116 break;
kono
parents: 67
diff changeset
117 case PROCESSOR_BDVER4:
kono
parents: 67
diff changeset
118 def_or_undef (parse_in, "__bdver4");
kono
parents: 67
diff changeset
119 def_or_undef (parse_in, "__bdver4__");
kono
parents: 67
diff changeset
120 break;
kono
parents: 67
diff changeset
121 case PROCESSOR_ZNVER1:
kono
parents: 67
diff changeset
122 def_or_undef (parse_in, "__znver1");
kono
parents: 67
diff changeset
123 def_or_undef (parse_in, "__znver1__");
kono
parents: 67
diff changeset
124 break;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
125 case PROCESSOR_BTVER1:
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
126 def_or_undef (parse_in, "__btver1");
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
127 def_or_undef (parse_in, "__btver1__");
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
128 break;
111
kono
parents: 67
diff changeset
129 case PROCESSOR_BTVER2:
kono
parents: 67
diff changeset
130 def_or_undef (parse_in, "__btver2");
kono
parents: 67
diff changeset
131 def_or_undef (parse_in, "__btver2__");
kono
parents: 67
diff changeset
132 break;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 case PROCESSOR_PENTIUM4:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 def_or_undef (parse_in, "__pentium4");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 def_or_undef (parse_in, "__pentium4__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 case PROCESSOR_NOCONA:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 def_or_undef (parse_in, "__nocona");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 def_or_undef (parse_in, "__nocona__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 break;
111
kono
parents: 67
diff changeset
141 case PROCESSOR_CORE2:
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 def_or_undef (parse_in, "__core2");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 def_or_undef (parse_in, "__core2__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 break;
111
kono
parents: 67
diff changeset
145 case PROCESSOR_NEHALEM:
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
146 def_or_undef (parse_in, "__corei7");
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
147 def_or_undef (parse_in, "__corei7__");
111
kono
parents: 67
diff changeset
148 def_or_undef (parse_in, "__nehalem");
kono
parents: 67
diff changeset
149 def_or_undef (parse_in, "__nehalem__");
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
150 break;
111
kono
parents: 67
diff changeset
151 case PROCESSOR_SANDYBRIDGE:
kono
parents: 67
diff changeset
152 def_or_undef (parse_in, "__corei7_avx");
kono
parents: 67
diff changeset
153 def_or_undef (parse_in, "__corei7_avx__");
kono
parents: 67
diff changeset
154 def_or_undef (parse_in, "__sandybridge");
kono
parents: 67
diff changeset
155 def_or_undef (parse_in, "__sandybridge__");
kono
parents: 67
diff changeset
156 break;
kono
parents: 67
diff changeset
157 case PROCESSOR_HASWELL:
kono
parents: 67
diff changeset
158 def_or_undef (parse_in, "__core_avx2");
kono
parents: 67
diff changeset
159 def_or_undef (parse_in, "__core_avx2__");
kono
parents: 67
diff changeset
160 def_or_undef (parse_in, "__haswell");
kono
parents: 67
diff changeset
161 def_or_undef (parse_in, "__haswell__");
kono
parents: 67
diff changeset
162 break;
kono
parents: 67
diff changeset
163 case PROCESSOR_BONNELL:
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
164 def_or_undef (parse_in, "__atom");
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
165 def_or_undef (parse_in, "__atom__");
111
kono
parents: 67
diff changeset
166 def_or_undef (parse_in, "__bonnell");
kono
parents: 67
diff changeset
167 def_or_undef (parse_in, "__bonnell__");
kono
parents: 67
diff changeset
168 break;
kono
parents: 67
diff changeset
169 case PROCESSOR_SILVERMONT:
kono
parents: 67
diff changeset
170 def_or_undef (parse_in, "__slm");
kono
parents: 67
diff changeset
171 def_or_undef (parse_in, "__slm__");
kono
parents: 67
diff changeset
172 def_or_undef (parse_in, "__silvermont");
kono
parents: 67
diff changeset
173 def_or_undef (parse_in, "__silvermont__");
kono
parents: 67
diff changeset
174 break;
kono
parents: 67
diff changeset
175 case PROCESSOR_KNL:
kono
parents: 67
diff changeset
176 def_or_undef (parse_in, "__knl");
kono
parents: 67
diff changeset
177 def_or_undef (parse_in, "__knl__");
kono
parents: 67
diff changeset
178 break;
kono
parents: 67
diff changeset
179 case PROCESSOR_KNM:
kono
parents: 67
diff changeset
180 def_or_undef (parse_in, "__knm");
kono
parents: 67
diff changeset
181 def_or_undef (parse_in, "__knm__");
kono
parents: 67
diff changeset
182 break;
kono
parents: 67
diff changeset
183 case PROCESSOR_SKYLAKE_AVX512:
kono
parents: 67
diff changeset
184 def_or_undef (parse_in, "__skylake_avx512");
kono
parents: 67
diff changeset
185 def_or_undef (parse_in, "__skylake_avx512__");
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
186 break;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 /* use PROCESSOR_max to not set/unset the arch macro. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 case PROCESSOR_max:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 break;
111
kono
parents: 67
diff changeset
190 case PROCESSOR_INTEL:
kono
parents: 67
diff changeset
191 case PROCESSOR_GENERIC:
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 gcc_unreachable ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 /* Built-ins based on -mtune=. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 switch (tune)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 case PROCESSOR_I386:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 def_or_undef (parse_in, "__tune_i386__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 case PROCESSOR_I486:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 def_or_undef (parse_in, "__tune_i486__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 case PROCESSOR_PENTIUM:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 def_or_undef (parse_in, "__tune_i586__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 def_or_undef (parse_in, "__tune_pentium__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 if (last_tune_char == 'x')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 def_or_undef (parse_in, "__tune_pentium_mmx__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 case PROCESSOR_PENTIUMPRO:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 def_or_undef (parse_in, "__tune_i686__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 def_or_undef (parse_in, "__tune_pentiumpro__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 switch (last_tune_char)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 case '3':
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 def_or_undef (parse_in, "__tune_pentium3__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 /* FALLTHRU */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 case '2':
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 def_or_undef (parse_in, "__tune_pentium2__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 case PROCESSOR_GEODE:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 def_or_undef (parse_in, "__tune_geode__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 case PROCESSOR_K6:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 def_or_undef (parse_in, "__tune_k6__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 if (last_tune_char == '2')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 def_or_undef (parse_in, "__tune_k6_2__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 else if (last_tune_char == '3')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 def_or_undef (parse_in, "__tune_k6_3__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 else if (isa_flag & OPTION_MASK_ISA_3DNOW)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 def_or_undef (parse_in, "__tune_k6_3__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 case PROCESSOR_ATHLON:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 def_or_undef (parse_in, "__tune_athlon__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 if (isa_flag & OPTION_MASK_ISA_SSE)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 def_or_undef (parse_in, "__tune_athlon_sse__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 case PROCESSOR_K8:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 def_or_undef (parse_in, "__tune_k8__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 case PROCESSOR_AMDFAM10:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 def_or_undef (parse_in, "__tune_amdfam10__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 break;
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
246 case PROCESSOR_BDVER1:
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
247 def_or_undef (parse_in, "__tune_bdver1__");
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
248 break;
111
kono
parents: 67
diff changeset
249 case PROCESSOR_BDVER2:
kono
parents: 67
diff changeset
250 def_or_undef (parse_in, "__tune_bdver2__");
kono
parents: 67
diff changeset
251 break;
kono
parents: 67
diff changeset
252 case PROCESSOR_BDVER3:
kono
parents: 67
diff changeset
253 def_or_undef (parse_in, "__tune_bdver3__");
kono
parents: 67
diff changeset
254 break;
kono
parents: 67
diff changeset
255 case PROCESSOR_BDVER4:
kono
parents: 67
diff changeset
256 def_or_undef (parse_in, "__tune_bdver4__");
kono
parents: 67
diff changeset
257 break;
kono
parents: 67
diff changeset
258 case PROCESSOR_ZNVER1:
kono
parents: 67
diff changeset
259 def_or_undef (parse_in, "__tune_znver1__");
kono
parents: 67
diff changeset
260 break;
kono
parents: 67
diff changeset
261 case PROCESSOR_BTVER1:
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
262 def_or_undef (parse_in, "__tune_btver1__");
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
263 break;
111
kono
parents: 67
diff changeset
264 case PROCESSOR_BTVER2:
kono
parents: 67
diff changeset
265 def_or_undef (parse_in, "__tune_btver2__");
kono
parents: 67
diff changeset
266 break;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 case PROCESSOR_PENTIUM4:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 def_or_undef (parse_in, "__tune_pentium4__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 case PROCESSOR_NOCONA:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 def_or_undef (parse_in, "__tune_nocona__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 break;
111
kono
parents: 67
diff changeset
273 case PROCESSOR_CORE2:
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 def_or_undef (parse_in, "__tune_core2__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 break;
111
kono
parents: 67
diff changeset
276 case PROCESSOR_NEHALEM:
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
277 def_or_undef (parse_in, "__tune_corei7__");
111
kono
parents: 67
diff changeset
278 def_or_undef (parse_in, "__tune_nehalem__");
kono
parents: 67
diff changeset
279 break;
kono
parents: 67
diff changeset
280 case PROCESSOR_SANDYBRIDGE:
kono
parents: 67
diff changeset
281 def_or_undef (parse_in, "__tune_corei7_avx__");
kono
parents: 67
diff changeset
282 def_or_undef (parse_in, "__tune_sandybridge__");
kono
parents: 67
diff changeset
283 break;
kono
parents: 67
diff changeset
284 case PROCESSOR_HASWELL:
kono
parents: 67
diff changeset
285 def_or_undef (parse_in, "__tune_core_avx2__");
kono
parents: 67
diff changeset
286 def_or_undef (parse_in, "__tune_haswell__");
kono
parents: 67
diff changeset
287 break;
kono
parents: 67
diff changeset
288 case PROCESSOR_BONNELL:
kono
parents: 67
diff changeset
289 def_or_undef (parse_in, "__tune_atom__");
kono
parents: 67
diff changeset
290 def_or_undef (parse_in, "__tune_bonnell__");
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
291 break;
111
kono
parents: 67
diff changeset
292 case PROCESSOR_SILVERMONT:
kono
parents: 67
diff changeset
293 def_or_undef (parse_in, "__tune_slm__");
kono
parents: 67
diff changeset
294 def_or_undef (parse_in, "__tune_silvermont__");
kono
parents: 67
diff changeset
295 break;
kono
parents: 67
diff changeset
296 case PROCESSOR_KNL:
kono
parents: 67
diff changeset
297 def_or_undef (parse_in, "__tune_knl__");
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
298 break;
111
kono
parents: 67
diff changeset
299 case PROCESSOR_KNM:
kono
parents: 67
diff changeset
300 def_or_undef (parse_in, "__tune_knm__");
kono
parents: 67
diff changeset
301 break;
kono
parents: 67
diff changeset
302 case PROCESSOR_SKYLAKE_AVX512:
kono
parents: 67
diff changeset
303 def_or_undef (parse_in, "__tune_skylake_avx512__");
kono
parents: 67
diff changeset
304 break;
kono
parents: 67
diff changeset
305 case PROCESSOR_LAKEMONT:
kono
parents: 67
diff changeset
306 def_or_undef (parse_in, "__tune_lakemont__");
kono
parents: 67
diff changeset
307 break;
kono
parents: 67
diff changeset
308 case PROCESSOR_INTEL:
kono
parents: 67
diff changeset
309 case PROCESSOR_GENERIC:
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 /* use PROCESSOR_max to not set/unset the tune macro. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 case PROCESSOR_max:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315
111
kono
parents: 67
diff changeset
316 switch (ix86_cmodel)
kono
parents: 67
diff changeset
317 {
kono
parents: 67
diff changeset
318 case CM_SMALL:
kono
parents: 67
diff changeset
319 case CM_SMALL_PIC:
kono
parents: 67
diff changeset
320 def_or_undef (parse_in, "__code_model_small__");
kono
parents: 67
diff changeset
321 break;
kono
parents: 67
diff changeset
322 case CM_MEDIUM:
kono
parents: 67
diff changeset
323 case CM_MEDIUM_PIC:
kono
parents: 67
diff changeset
324 def_or_undef (parse_in, "__code_model_medium__");
kono
parents: 67
diff changeset
325 break;
kono
parents: 67
diff changeset
326 case CM_LARGE:
kono
parents: 67
diff changeset
327 case CM_LARGE_PIC:
kono
parents: 67
diff changeset
328 def_or_undef (parse_in, "__code_model_large__");
kono
parents: 67
diff changeset
329 break;
kono
parents: 67
diff changeset
330 case CM_32:
kono
parents: 67
diff changeset
331 def_or_undef (parse_in, "__code_model_32__");
kono
parents: 67
diff changeset
332 break;
kono
parents: 67
diff changeset
333 case CM_KERNEL:
kono
parents: 67
diff changeset
334 def_or_undef (parse_in, "__code_model_kernel__");
kono
parents: 67
diff changeset
335 break;
kono
parents: 67
diff changeset
336 default:
kono
parents: 67
diff changeset
337 ;
kono
parents: 67
diff changeset
338 }
kono
parents: 67
diff changeset
339
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 if (isa_flag & OPTION_MASK_ISA_MMX)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 def_or_undef (parse_in, "__MMX__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 if (isa_flag & OPTION_MASK_ISA_3DNOW)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 def_or_undef (parse_in, "__3dNOW__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 if (isa_flag & OPTION_MASK_ISA_3DNOW_A)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 def_or_undef (parse_in, "__3dNOW_A__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 if (isa_flag & OPTION_MASK_ISA_SSE)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 def_or_undef (parse_in, "__SSE__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 if (isa_flag & OPTION_MASK_ISA_SSE2)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 def_or_undef (parse_in, "__SSE2__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 if (isa_flag & OPTION_MASK_ISA_SSE3)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 def_or_undef (parse_in, "__SSE3__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 if (isa_flag & OPTION_MASK_ISA_SSSE3)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 def_or_undef (parse_in, "__SSSE3__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 if (isa_flag & OPTION_MASK_ISA_SSE4_1)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 def_or_undef (parse_in, "__SSE4_1__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 if (isa_flag & OPTION_MASK_ISA_SSE4_2)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 def_or_undef (parse_in, "__SSE4_2__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 if (isa_flag & OPTION_MASK_ISA_AES)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 def_or_undef (parse_in, "__AES__");
111
kono
parents: 67
diff changeset
360 if (isa_flag & OPTION_MASK_ISA_SHA)
kono
parents: 67
diff changeset
361 def_or_undef (parse_in, "__SHA__");
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 if (isa_flag & OPTION_MASK_ISA_PCLMUL)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 def_or_undef (parse_in, "__PCLMUL__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 if (isa_flag & OPTION_MASK_ISA_AVX)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 def_or_undef (parse_in, "__AVX__");
111
kono
parents: 67
diff changeset
366 if (isa_flag & OPTION_MASK_ISA_AVX2)
kono
parents: 67
diff changeset
367 def_or_undef (parse_in, "__AVX2__");
kono
parents: 67
diff changeset
368 if (isa_flag & OPTION_MASK_ISA_AVX512F)
kono
parents: 67
diff changeset
369 def_or_undef (parse_in, "__AVX512F__");
kono
parents: 67
diff changeset
370 if (isa_flag & OPTION_MASK_ISA_AVX512ER)
kono
parents: 67
diff changeset
371 def_or_undef (parse_in, "__AVX512ER__");
kono
parents: 67
diff changeset
372 if (isa_flag & OPTION_MASK_ISA_AVX512CD)
kono
parents: 67
diff changeset
373 def_or_undef (parse_in, "__AVX512CD__");
kono
parents: 67
diff changeset
374 if (isa_flag & OPTION_MASK_ISA_AVX512PF)
kono
parents: 67
diff changeset
375 def_or_undef (parse_in, "__AVX512PF__");
kono
parents: 67
diff changeset
376 if (isa_flag & OPTION_MASK_ISA_AVX512DQ)
kono
parents: 67
diff changeset
377 def_or_undef (parse_in, "__AVX512DQ__");
kono
parents: 67
diff changeset
378 if (isa_flag & OPTION_MASK_ISA_AVX512BW)
kono
parents: 67
diff changeset
379 def_or_undef (parse_in, "__AVX512BW__");
kono
parents: 67
diff changeset
380 if (isa_flag & OPTION_MASK_ISA_AVX512VL)
kono
parents: 67
diff changeset
381 def_or_undef (parse_in, "__AVX512VL__");
kono
parents: 67
diff changeset
382 if (isa_flag & OPTION_MASK_ISA_AVX512VBMI)
kono
parents: 67
diff changeset
383 def_or_undef (parse_in, "__AVX512VBMI__");
kono
parents: 67
diff changeset
384 if (isa_flag & OPTION_MASK_ISA_AVX512IFMA)
kono
parents: 67
diff changeset
385 def_or_undef (parse_in, "__AVX512IFMA__");
kono
parents: 67
diff changeset
386 if (isa_flag2 & OPTION_MASK_ISA_AVX5124VNNIW)
kono
parents: 67
diff changeset
387 def_or_undef (parse_in, "__AVX5124VNNIW__");
kono
parents: 67
diff changeset
388 if (isa_flag2 & OPTION_MASK_ISA_SGX)
kono
parents: 67
diff changeset
389 def_or_undef (parse_in, "__SGX__");
kono
parents: 67
diff changeset
390 if (isa_flag2 & OPTION_MASK_ISA_AVX5124FMAPS)
kono
parents: 67
diff changeset
391 def_or_undef (parse_in, "__AVX5124FMAPS__");
kono
parents: 67
diff changeset
392 if (isa_flag2 & OPTION_MASK_ISA_AVX512VPOPCNTDQ)
kono
parents: 67
diff changeset
393 def_or_undef (parse_in, "__AVX512VPOPCNTDQ__");
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 if (isa_flag & OPTION_MASK_ISA_FMA)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 def_or_undef (parse_in, "__FMA__");
111
kono
parents: 67
diff changeset
396 if (isa_flag & OPTION_MASK_ISA_RTM)
kono
parents: 67
diff changeset
397 def_or_undef (parse_in, "__RTM__");
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 if (isa_flag & OPTION_MASK_ISA_SSE4A)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 def_or_undef (parse_in, "__SSE4A__");
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
400 if (isa_flag & OPTION_MASK_ISA_FMA4)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
401 def_or_undef (parse_in, "__FMA4__");
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
402 if (isa_flag & OPTION_MASK_ISA_XOP)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
403 def_or_undef (parse_in, "__XOP__");
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
404 if (isa_flag & OPTION_MASK_ISA_LWP)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
405 def_or_undef (parse_in, "__LWP__");
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
406 if (isa_flag & OPTION_MASK_ISA_ABM)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
407 def_or_undef (parse_in, "__ABM__");
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
408 if (isa_flag & OPTION_MASK_ISA_BMI)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
409 def_or_undef (parse_in, "__BMI__");
111
kono
parents: 67
diff changeset
410 if (isa_flag & OPTION_MASK_ISA_BMI2)
kono
parents: 67
diff changeset
411 def_or_undef (parse_in, "__BMI2__");
kono
parents: 67
diff changeset
412 if (isa_flag & OPTION_MASK_ISA_LZCNT)
kono
parents: 67
diff changeset
413 def_or_undef (parse_in, "__LZCNT__");
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
414 if (isa_flag & OPTION_MASK_ISA_TBM)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
415 def_or_undef (parse_in, "__TBM__");
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
416 if (isa_flag & OPTION_MASK_ISA_POPCNT)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
417 def_or_undef (parse_in, "__POPCNT__");
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
418 if (isa_flag & OPTION_MASK_ISA_FSGSBASE)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
419 def_or_undef (parse_in, "__FSGSBASE__");
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
420 if (isa_flag & OPTION_MASK_ISA_RDRND)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
421 def_or_undef (parse_in, "__RDRND__");
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
422 if (isa_flag & OPTION_MASK_ISA_F16C)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
423 def_or_undef (parse_in, "__F16C__");
111
kono
parents: 67
diff changeset
424 if (isa_flag & OPTION_MASK_ISA_RDSEED)
kono
parents: 67
diff changeset
425 def_or_undef (parse_in, "__RDSEED__");
kono
parents: 67
diff changeset
426 if (isa_flag & OPTION_MASK_ISA_PRFCHW)
kono
parents: 67
diff changeset
427 def_or_undef (parse_in, "__PRFCHW__");
kono
parents: 67
diff changeset
428 if (isa_flag & OPTION_MASK_ISA_ADX)
kono
parents: 67
diff changeset
429 def_or_undef (parse_in, "__ADX__");
kono
parents: 67
diff changeset
430 if (isa_flag & OPTION_MASK_ISA_FXSR)
kono
parents: 67
diff changeset
431 def_or_undef (parse_in, "__FXSR__");
kono
parents: 67
diff changeset
432 if (isa_flag & OPTION_MASK_ISA_XSAVE)
kono
parents: 67
diff changeset
433 def_or_undef (parse_in, "__XSAVE__");
kono
parents: 67
diff changeset
434 if (isa_flag & OPTION_MASK_ISA_XSAVEOPT)
kono
parents: 67
diff changeset
435 def_or_undef (parse_in, "__XSAVEOPT__");
kono
parents: 67
diff changeset
436 if (isa_flag & OPTION_MASK_ISA_PREFETCHWT1)
kono
parents: 67
diff changeset
437 def_or_undef (parse_in, "__PREFETCHWT1__");
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 def_or_undef (parse_in, "__SSE_MATH__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE2))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 def_or_undef (parse_in, "__SSE2_MATH__");
111
kono
parents: 67
diff changeset
442 if (isa_flag & OPTION_MASK_ISA_CLFLUSHOPT)
kono
parents: 67
diff changeset
443 def_or_undef (parse_in, "__CLFLUSHOPT__");
kono
parents: 67
diff changeset
444 if (isa_flag & OPTION_MASK_ISA_CLZERO)
kono
parents: 67
diff changeset
445 def_or_undef (parse_in, "__CLZERO__");
kono
parents: 67
diff changeset
446 if (isa_flag & OPTION_MASK_ISA_XSAVEC)
kono
parents: 67
diff changeset
447 def_or_undef (parse_in, "__XSAVEC__");
kono
parents: 67
diff changeset
448 if (isa_flag & OPTION_MASK_ISA_XSAVES)
kono
parents: 67
diff changeset
449 def_or_undef (parse_in, "__XSAVES__");
kono
parents: 67
diff changeset
450 if (isa_flag & OPTION_MASK_ISA_MPX)
kono
parents: 67
diff changeset
451 def_or_undef (parse_in, "__MPX__");
kono
parents: 67
diff changeset
452 if (isa_flag & OPTION_MASK_ISA_CLWB)
kono
parents: 67
diff changeset
453 def_or_undef (parse_in, "__CLWB__");
kono
parents: 67
diff changeset
454 if (isa_flag & OPTION_MASK_ISA_MWAITX)
kono
parents: 67
diff changeset
455 def_or_undef (parse_in, "__MWAITX__");
kono
parents: 67
diff changeset
456 if (isa_flag & OPTION_MASK_ISA_PKU)
kono
parents: 67
diff changeset
457 def_or_undef (parse_in, "__PKU__");
kono
parents: 67
diff changeset
458 if (isa_flag2 & OPTION_MASK_ISA_RDPID)
kono
parents: 67
diff changeset
459 def_or_undef (parse_in, "__RDPID__");
kono
parents: 67
diff changeset
460 if (isa_flag2 & OPTION_MASK_ISA_GFNI)
kono
parents: 67
diff changeset
461 def_or_undef (parse_in, "__GFNI__");
kono
parents: 67
diff changeset
462 if (isa_flag2 & OPTION_MASK_ISA_IBT)
kono
parents: 67
diff changeset
463 {
kono
parents: 67
diff changeset
464 def_or_undef (parse_in, "__IBT__");
kono
parents: 67
diff changeset
465 if (flag_cf_protection != CF_NONE)
kono
parents: 67
diff changeset
466 def_or_undef (parse_in, "__CET__");
kono
parents: 67
diff changeset
467 }
kono
parents: 67
diff changeset
468 if (isa_flag2 & OPTION_MASK_ISA_SHSTK)
kono
parents: 67
diff changeset
469 {
kono
parents: 67
diff changeset
470 def_or_undef (parse_in, "__SHSTK__");
kono
parents: 67
diff changeset
471 if (flag_cf_protection != CF_NONE)
kono
parents: 67
diff changeset
472 def_or_undef (parse_in, "__CET__");
kono
parents: 67
diff changeset
473 }
kono
parents: 67
diff changeset
474 if (TARGET_IAMCU)
kono
parents: 67
diff changeset
475 {
kono
parents: 67
diff changeset
476 def_or_undef (parse_in, "__iamcu");
kono
parents: 67
diff changeset
477 def_or_undef (parse_in, "__iamcu__");
kono
parents: 67
diff changeset
478 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 /* Hook to validate the current #pragma GCC target and set the state, and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 update the macros based on what was changed. If ARGS is NULL, then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 POP_TARGET is used to reset the options. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 ix86_pragma_target_parse (tree args, tree pop_target)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 {
111
kono
parents: 67
diff changeset
489 tree prev_tree = build_target_option_node (&global_options);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 tree cur_tree;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 struct cl_target_option *prev_opt;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 struct cl_target_option *cur_opt;
111
kono
parents: 67
diff changeset
493 HOST_WIDE_INT prev_isa;
kono
parents: 67
diff changeset
494 HOST_WIDE_INT cur_isa;
kono
parents: 67
diff changeset
495 HOST_WIDE_INT diff_isa;
kono
parents: 67
diff changeset
496 HOST_WIDE_INT prev_isa2;
kono
parents: 67
diff changeset
497 HOST_WIDE_INT cur_isa2;
kono
parents: 67
diff changeset
498 HOST_WIDE_INT diff_isa2;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499 enum processor_type prev_arch;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 enum processor_type prev_tune;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 enum processor_type cur_arch;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 enum processor_type cur_tune;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
503
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 if (! args)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 {
111
kono
parents: 67
diff changeset
506 cur_tree = (pop_target ? pop_target : target_option_default_node);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
507 cl_target_option_restore (&global_options,
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
508 TREE_TARGET_OPTION (cur_tree));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
509 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
510 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
511 {
111
kono
parents: 67
diff changeset
512 cur_tree = ix86_valid_target_attribute_tree (args, &global_options,
kono
parents: 67
diff changeset
513 &global_options_set);
kono
parents: 67
diff changeset
514 if (!cur_tree || cur_tree == error_mark_node)
kono
parents: 67
diff changeset
515 {
kono
parents: 67
diff changeset
516 cl_target_option_restore (&global_options,
kono
parents: 67
diff changeset
517 TREE_TARGET_OPTION (prev_tree));
kono
parents: 67
diff changeset
518 return false;
kono
parents: 67
diff changeset
519 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 target_option_current_node = cur_tree;
111
kono
parents: 67
diff changeset
523 ix86_reset_previous_fndecl ();
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 /* Figure out the previous/current isa, arch, tune and the differences. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 prev_opt = TREE_TARGET_OPTION (prev_tree);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 cur_opt = TREE_TARGET_OPTION (cur_tree);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
528 prev_isa = prev_opt->x_ix86_isa_flags;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
529 cur_isa = cur_opt->x_ix86_isa_flags;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 diff_isa = (prev_isa ^ cur_isa);
111
kono
parents: 67
diff changeset
531 prev_isa2 = prev_opt->x_ix86_isa_flags2;
kono
parents: 67
diff changeset
532 cur_isa2 = cur_opt->x_ix86_isa_flags2;
kono
parents: 67
diff changeset
533 diff_isa2 = (prev_isa2 ^ cur_isa2);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
534 prev_arch = (enum processor_type) prev_opt->arch;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
535 prev_tune = (enum processor_type) prev_opt->tune;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
536 cur_arch = (enum processor_type) cur_opt->arch;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
537 cur_tune = (enum processor_type) cur_opt->tune;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 /* If the same processor is used for both previous and current options, don't
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 change the macros. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 if (cur_arch == prev_arch)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 cur_arch = prev_arch = PROCESSOR_max;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 if (cur_tune == prev_tune)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 cur_tune = prev_tune = PROCESSOR_max;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 /* Undef all of the macros for that are no longer current. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 ix86_target_macros_internal (prev_isa & diff_isa,
111
kono
parents: 67
diff changeset
549 prev_isa2 & diff_isa2,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 prev_arch,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 prev_tune,
111
kono
parents: 67
diff changeset
552 (enum fpmath_unit) prev_opt->x_ix86_fpmath,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 cpp_undef);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
554
111
kono
parents: 67
diff changeset
555 /* For the definitions, ensure all newly defined macros are considered
kono
parents: 67
diff changeset
556 as used for -Wunused-macros. There is no point warning about the
kono
parents: 67
diff changeset
557 compiler predefined macros. */
kono
parents: 67
diff changeset
558 cpp_options *cpp_opts = cpp_get_options (parse_in);
kono
parents: 67
diff changeset
559 unsigned char saved_warn_unused_macros = cpp_opts->warn_unused_macros;
kono
parents: 67
diff changeset
560 cpp_opts->warn_unused_macros = 0;
kono
parents: 67
diff changeset
561
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
562 /* Define all of the macros for new options that were just turned on. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 ix86_target_macros_internal (cur_isa & diff_isa,
111
kono
parents: 67
diff changeset
564 cur_isa2 & diff_isa2,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 cur_arch,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
566 cur_tune,
111
kono
parents: 67
diff changeset
567 (enum fpmath_unit) cur_opt->x_ix86_fpmath,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
568 cpp_define);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
569
111
kono
parents: 67
diff changeset
570 cpp_opts->warn_unused_macros = saved_warn_unused_macros;
kono
parents: 67
diff changeset
571
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
572 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
573 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
574
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 /* Function to tell the preprocessor about the defines for the current target. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
576
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
577 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578 ix86_target_macros (void)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
579 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 /* 32/64-bit won't change with target specific options, so do the assert and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 builtin_define_std calls here. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 if (TARGET_64BIT)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
583 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
584 cpp_assert (parse_in, "cpu=x86_64");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
585 cpp_assert (parse_in, "machine=x86_64");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
586 cpp_define (parse_in, "__amd64");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
587 cpp_define (parse_in, "__amd64__");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
588 cpp_define (parse_in, "__x86_64");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
589 cpp_define (parse_in, "__x86_64__");
111
kono
parents: 67
diff changeset
590 if (TARGET_X32)
kono
parents: 67
diff changeset
591 {
kono
parents: 67
diff changeset
592 cpp_define (parse_in, "_ILP32");
kono
parents: 67
diff changeset
593 cpp_define (parse_in, "__ILP32__");
kono
parents: 67
diff changeset
594 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
595 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
596 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
597 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
598 cpp_assert (parse_in, "cpu=i386");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599 cpp_assert (parse_in, "machine=i386");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
600 builtin_define_std ("i386");
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
601 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602
111
kono
parents: 67
diff changeset
603 if (!TARGET_80387)
kono
parents: 67
diff changeset
604 cpp_define (parse_in, "_SOFT_FLOAT");
kono
parents: 67
diff changeset
605
kono
parents: 67
diff changeset
606 if (TARGET_LONG_DOUBLE_64)
kono
parents: 67
diff changeset
607 cpp_define (parse_in, "__LONG_DOUBLE_64__");
kono
parents: 67
diff changeset
608
kono
parents: 67
diff changeset
609 if (TARGET_LONG_DOUBLE_128)
kono
parents: 67
diff changeset
610 cpp_define (parse_in, "__LONG_DOUBLE_128__");
kono
parents: 67
diff changeset
611
kono
parents: 67
diff changeset
612 if (TARGET_128BIT_LONG_DOUBLE)
kono
parents: 67
diff changeset
613 cpp_define (parse_in, "__SIZEOF_FLOAT80__=16");
kono
parents: 67
diff changeset
614 else
kono
parents: 67
diff changeset
615 cpp_define (parse_in, "__SIZEOF_FLOAT80__=12");
kono
parents: 67
diff changeset
616
kono
parents: 67
diff changeset
617 cpp_define (parse_in, "__SIZEOF_FLOAT128__=16");
kono
parents: 67
diff changeset
618
kono
parents: 67
diff changeset
619 cpp_define_formatted (parse_in, "__ATOMIC_HLE_ACQUIRE=%d", IX86_HLE_ACQUIRE);
kono
parents: 67
diff changeset
620 cpp_define_formatted (parse_in, "__ATOMIC_HLE_RELEASE=%d", IX86_HLE_RELEASE);
kono
parents: 67
diff changeset
621
kono
parents: 67
diff changeset
622 cpp_define (parse_in, "__GCC_ASM_FLAG_OUTPUTS__");
kono
parents: 67
diff changeset
623
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
624 ix86_target_macros_internal (ix86_isa_flags,
111
kono
parents: 67
diff changeset
625 ix86_isa_flags2,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
626 ix86_arch,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
627 ix86_tune,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
628 ix86_fpmath,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
629 cpp_define);
111
kono
parents: 67
diff changeset
630
kono
parents: 67
diff changeset
631 cpp_define (parse_in, "__SEG_FS");
kono
parents: 67
diff changeset
632 cpp_define (parse_in, "__SEG_GS");
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
633 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
634
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
635
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
636 /* Register target pragmas. We need to add the hook for parsing #pragma GCC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
637 option here rather than in i386.c since it will pull in various preprocessor
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
638 functions, and those are not present in languages like fortran without a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
639 preprocessor. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
640
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
641 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 ix86_register_pragmas (void)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644 /* Update pragma hook to allow parsing #pragma GCC target. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 targetm.target_option.pragma_parse = ix86_pragma_target_parse;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646
111
kono
parents: 67
diff changeset
647 c_register_addr_space ("__seg_fs", ADDR_SPACE_SEG_FS);
kono
parents: 67
diff changeset
648 c_register_addr_space ("__seg_gs", ADDR_SPACE_SEG_GS);
kono
parents: 67
diff changeset
649
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
650 #ifdef REGISTER_SUBTARGET_PRAGMAS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651 REGISTER_SUBTARGET_PRAGMAS ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
652 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
653 }