comparison gcc/config/i386/i386-c.c @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* Subroutines used for macro/preprocessor support on the ia-32. 1 /* Subroutines used for macro/preprocessor support on the ia-32.
2 Copyright (C) 2008, 2009 2 Copyright (C) 2008, 2009, 2010
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "system.h" 22 #include "system.h"
23 #include "coretypes.h" 23 #include "coretypes.h"
24 #include "tm.h" 24 #include "tm.h"
25 #include "rtl.h"
26 #include "tree.h" 25 #include "tree.h"
27 #include "tm_p.h" 26 #include "tm_p.h"
28 #include "flags.h" 27 #include "flags.h"
29 #include "c-common.h" 28 #include "c-family/c-common.h"
30 #include "ggc.h" 29 #include "ggc.h"
31 #include "target.h" 30 #include "target.h"
32 #include "target-def.h" 31 #include "target-def.h"
33 #include "cpplib.h" 32 #include "cpplib.h"
34 #include "c-pragma.h" 33 #include "c-family/c-pragma.h"
35 34
36 static bool ix86_pragma_target_parse (tree, tree); 35 static bool ix86_pragma_target_parse (tree, tree);
37 static void ix86_target_macros_internal 36 static void ix86_target_macros_internal
38 (int, enum processor_type, enum processor_type, enum fpmath_unit, 37 (int, enum processor_type, enum processor_type, enum fpmath_unit,
39 void (*def_or_undef) (cpp_reader *, const char *)); 38 void (*def_or_undef) (cpp_reader *, const char *));
109 break; 108 break;
110 case PROCESSOR_BDVER1: 109 case PROCESSOR_BDVER1:
111 def_or_undef (parse_in, "__bdver1"); 110 def_or_undef (parse_in, "__bdver1");
112 def_or_undef (parse_in, "__bdver1__"); 111 def_or_undef (parse_in, "__bdver1__");
113 break; 112 break;
113 case PROCESSOR_BTVER1:
114 def_or_undef (parse_in, "__btver1");
115 def_or_undef (parse_in, "__btver1__");
116 break;
114 case PROCESSOR_PENTIUM4: 117 case PROCESSOR_PENTIUM4:
115 def_or_undef (parse_in, "__pentium4"); 118 def_or_undef (parse_in, "__pentium4");
116 def_or_undef (parse_in, "__pentium4__"); 119 def_or_undef (parse_in, "__pentium4__");
117 break; 120 break;
118 case PROCESSOR_NOCONA: 121 case PROCESSOR_NOCONA:
119 def_or_undef (parse_in, "__nocona"); 122 def_or_undef (parse_in, "__nocona");
120 def_or_undef (parse_in, "__nocona__"); 123 def_or_undef (parse_in, "__nocona__");
121 break; 124 break;
122 case PROCESSOR_CORE2: 125 case PROCESSOR_CORE2_32:
126 case PROCESSOR_CORE2_64:
123 def_or_undef (parse_in, "__core2"); 127 def_or_undef (parse_in, "__core2");
124 def_or_undef (parse_in, "__core2__"); 128 def_or_undef (parse_in, "__core2__");
129 break;
130 case PROCESSOR_COREI7_32:
131 case PROCESSOR_COREI7_64:
132 def_or_undef (parse_in, "__corei7");
133 def_or_undef (parse_in, "__corei7__");
125 break; 134 break;
126 case PROCESSOR_ATOM: 135 case PROCESSOR_ATOM:
127 def_or_undef (parse_in, "__atom"); 136 def_or_undef (parse_in, "__atom");
128 def_or_undef (parse_in, "__atom__"); 137 def_or_undef (parse_in, "__atom__");
129 break; 138 break;
187 def_or_undef (parse_in, "__tune_amdfam10__"); 196 def_or_undef (parse_in, "__tune_amdfam10__");
188 break; 197 break;
189 case PROCESSOR_BDVER1: 198 case PROCESSOR_BDVER1:
190 def_or_undef (parse_in, "__tune_bdver1__"); 199 def_or_undef (parse_in, "__tune_bdver1__");
191 break; 200 break;
201 case PROCESSOR_BTVER1:
202 def_or_undef (parse_in, "__tune_btver1__");
203 break;
192 case PROCESSOR_PENTIUM4: 204 case PROCESSOR_PENTIUM4:
193 def_or_undef (parse_in, "__tune_pentium4__"); 205 def_or_undef (parse_in, "__tune_pentium4__");
194 break; 206 break;
195 case PROCESSOR_NOCONA: 207 case PROCESSOR_NOCONA:
196 def_or_undef (parse_in, "__tune_nocona__"); 208 def_or_undef (parse_in, "__tune_nocona__");
197 break; 209 break;
198 case PROCESSOR_CORE2: 210 case PROCESSOR_CORE2_32:
211 case PROCESSOR_CORE2_64:
199 def_or_undef (parse_in, "__tune_core2__"); 212 def_or_undef (parse_in, "__tune_core2__");
213 break;
214 case PROCESSOR_COREI7_32:
215 case PROCESSOR_COREI7_64:
216 def_or_undef (parse_in, "__tune_corei7__");
200 break; 217 break;
201 case PROCESSOR_ATOM: 218 case PROCESSOR_ATOM:
202 def_or_undef (parse_in, "__tune_atom__"); 219 def_or_undef (parse_in, "__tune_atom__");
203 break; 220 break;
204 case PROCESSOR_GENERIC32: 221 case PROCESSOR_GENERIC32:
243 def_or_undef (parse_in, "__XOP__"); 260 def_or_undef (parse_in, "__XOP__");
244 if (isa_flag & OPTION_MASK_ISA_LWP) 261 if (isa_flag & OPTION_MASK_ISA_LWP)
245 def_or_undef (parse_in, "__LWP__"); 262 def_or_undef (parse_in, "__LWP__");
246 if (isa_flag & OPTION_MASK_ISA_ABM) 263 if (isa_flag & OPTION_MASK_ISA_ABM)
247 def_or_undef (parse_in, "__ABM__"); 264 def_or_undef (parse_in, "__ABM__");
265 if (isa_flag & OPTION_MASK_ISA_BMI)
266 def_or_undef (parse_in, "__BMI__");
267 if (isa_flag & OPTION_MASK_ISA_TBM)
268 def_or_undef (parse_in, "__TBM__");
248 if (isa_flag & OPTION_MASK_ISA_POPCNT) 269 if (isa_flag & OPTION_MASK_ISA_POPCNT)
249 def_or_undef (parse_in, "__POPCNT__"); 270 def_or_undef (parse_in, "__POPCNT__");
271 if (isa_flag & OPTION_MASK_ISA_FSGSBASE)
272 def_or_undef (parse_in, "__FSGSBASE__");
273 if (isa_flag & OPTION_MASK_ISA_RDRND)
274 def_or_undef (parse_in, "__RDRND__");
275 if (isa_flag & OPTION_MASK_ISA_F16C)
276 def_or_undef (parse_in, "__F16C__");
250 if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE)) 277 if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE))
251 def_or_undef (parse_in, "__SSE_MATH__"); 278 def_or_undef (parse_in, "__SSE_MATH__");
252 if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE2)) 279 if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE2))
253 def_or_undef (parse_in, "__SSE2_MATH__"); 280 def_or_undef (parse_in, "__SSE2_MATH__");
254 } 281 }
276 if (! args) 303 if (! args)
277 { 304 {
278 cur_tree = ((pop_target) 305 cur_tree = ((pop_target)
279 ? pop_target 306 ? pop_target
280 : target_option_default_node); 307 : target_option_default_node);
281 cl_target_option_restore (TREE_TARGET_OPTION (cur_tree)); 308 cl_target_option_restore (&global_options,
309 TREE_TARGET_OPTION (cur_tree));
282 } 310 }
283 else 311 else
284 { 312 {
285 cur_tree = ix86_valid_target_attribute_tree (args); 313 cur_tree = ix86_valid_target_attribute_tree (args);
286 if (!cur_tree) 314 if (!cur_tree)
290 target_option_current_node = cur_tree; 318 target_option_current_node = cur_tree;
291 319
292 /* Figure out the previous/current isa, arch, tune and the differences. */ 320 /* Figure out the previous/current isa, arch, tune and the differences. */
293 prev_opt = TREE_TARGET_OPTION (prev_tree); 321 prev_opt = TREE_TARGET_OPTION (prev_tree);
294 cur_opt = TREE_TARGET_OPTION (cur_tree); 322 cur_opt = TREE_TARGET_OPTION (cur_tree);
295 prev_isa = prev_opt->ix86_isa_flags; 323 prev_isa = prev_opt->x_ix86_isa_flags;
296 cur_isa = cur_opt->ix86_isa_flags; 324 cur_isa = cur_opt->x_ix86_isa_flags;
297 diff_isa = (prev_isa ^ cur_isa); 325 diff_isa = (prev_isa ^ cur_isa);
298 prev_arch = (enum processor_type) prev_opt->arch; 326 prev_arch = (enum processor_type) prev_opt->arch;
299 prev_tune = (enum processor_type) prev_opt->tune; 327 prev_tune = (enum processor_type) prev_opt->tune;
300 cur_arch = (enum processor_type) cur_opt->arch; 328 cur_arch = (enum processor_type) cur_opt->arch;
301 cur_tune = (enum processor_type) cur_opt->tune; 329 cur_tune = (enum processor_type) cur_opt->tune;