diff options
Diffstat (limited to 'gcc/config/i386/i386.h')
-rw-r--r-- | gcc/config/i386/i386.h | 215 |
1 files changed, 14 insertions, 201 deletions
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index d17e414eb5f..c7d33c7eb05 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -49,6 +49,13 @@ along with GCC; see the file COPYING3. If not see #define TARGET_SSE4A OPTION_ISA_SSE4A #define TARGET_SSE5 OPTION_ISA_SSE5 #define TARGET_ROUND OPTION_ISA_ROUND +#define TARGET_ABM OPTION_ISA_ABM +#define TARGET_POPCNT OPTION_ISA_POPCNT +#define TARGET_SAHF OPTION_ISA_SAHF +#define TARGET_AES OPTION_ISA_AES +#define TARGET_PCLMUL OPTION_ISA_PCLMUL +#define TARGET_CMPXCHG16B OPTION_ISA_CX16 + /* SSE5 and SSE4.1 define the same round instructions */ #define OPTION_MASK_ISA_ROUND (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSE5) @@ -286,7 +293,7 @@ enum ix86_tune_indices { X86_TUNE_LAST }; -extern unsigned int ix86_tune_features[X86_TUNE_LAST]; +extern unsigned char ix86_tune_features[X86_TUNE_LAST]; #define TARGET_USE_LEAVE ix86_tune_features[X86_TUNE_USE_LEAVE] #define TARGET_PUSH_MEMORY ix86_tune_features[X86_TUNE_PUSH_MEMORY] @@ -380,7 +387,7 @@ enum ix86_arch_indices { X86_ARCH_LAST }; -extern unsigned int ix86_arch_features[X86_ARCH_LAST]; +extern unsigned char ix86_arch_features[X86_ARCH_LAST]; #define TARGET_CMOVE ix86_arch_features[X86_ARCH_CMOVE] #define TARGET_CMPXCHG ix86_arch_features[X86_ARCH_CMPXCHG] @@ -392,15 +399,7 @@ extern unsigned int ix86_arch_features[X86_ARCH_LAST]; extern int x86_prefetch_sse; -#define TARGET_ABM x86_abm -#define TARGET_CMPXCHG16B x86_cmpxchg16b -#define TARGET_POPCNT x86_popcnt #define TARGET_PREFETCH_SSE x86_prefetch_sse -#define TARGET_SAHF x86_sahf -#define TARGET_RECIP x86_recip -#define TARGET_FUSED_MADD x86_fused_muladd -#define TARGET_AES (TARGET_SSE2 && x86_aes) -#define TARGET_PCLMUL (TARGET_SSE2 && x86_pclmul) #define ASSEMBLER_DIALECT (ix86_asm_dialect) @@ -475,7 +474,7 @@ enum calling_abi Don't use this macro to turn on various extra optimizations for `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ -#define OVERRIDE_OPTIONS override_options () +#define OVERRIDE_OPTIONS override_options (true) /* Define this to change the optimizations performed by default. */ #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ @@ -537,196 +536,10 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #endif /* Target CPU builtins. */ -#define TARGET_CPU_CPP_BUILTINS() \ - do \ - { \ - size_t arch_len = strlen (ix86_arch_string); \ - size_t tune_len = strlen (ix86_tune_string); \ - int last_arch_char = ix86_arch_string[arch_len - 1]; \ - int last_tune_char = ix86_tune_string[tune_len - 1]; \ - \ - if (TARGET_64BIT) \ - { \ - builtin_assert ("cpu=x86_64"); \ - builtin_assert ("machine=x86_64"); \ - builtin_define ("__amd64"); \ - builtin_define ("__amd64__"); \ - builtin_define ("__x86_64"); \ - builtin_define ("__x86_64__"); \ - } \ - else \ - { \ - builtin_assert ("cpu=i386"); \ - builtin_assert ("machine=i386"); \ - builtin_define_std ("i386"); \ - } \ - \ - /* Built-ins based on -march=. */ \ - switch (ix86_arch) \ - { \ - case PROCESSOR_I386: \ - break; \ - case PROCESSOR_I486: \ - builtin_define ("__i486"); \ - builtin_define ("__i486__"); \ - break; \ - case PROCESSOR_PENTIUM: \ - builtin_define ("__i586"); \ - builtin_define ("__i586__"); \ - builtin_define ("__pentium"); \ - builtin_define ("__pentium__"); \ - if (last_arch_char == 'x') \ - builtin_define ("__pentium_mmx__"); \ - break; \ - case PROCESSOR_PENTIUMPRO: \ - builtin_define ("__i686"); \ - builtin_define ("__i686__"); \ - builtin_define ("__pentiumpro"); \ - builtin_define ("__pentiumpro__"); \ - break; \ - case PROCESSOR_GEODE: \ - builtin_define ("__geode"); \ - builtin_define ("__geode__"); \ - break; \ - case PROCESSOR_K6: \ - builtin_define ("__k6"); \ - builtin_define ("__k6__"); \ - if (last_arch_char == '2') \ - builtin_define ("__k6_2__"); \ - else if (last_arch_char == '3') \ - builtin_define ("__k6_3__"); \ - break; \ - case PROCESSOR_ATHLON: \ - builtin_define ("__athlon"); \ - builtin_define ("__athlon__"); \ - /* Only plain "athlon" lacks SSE. */ \ - if (last_arch_char != 'n') \ - builtin_define ("__athlon_sse__"); \ - break; \ - case PROCESSOR_K8: \ - builtin_define ("__k8"); \ - builtin_define ("__k8__"); \ - break; \ - case PROCESSOR_AMDFAM10: \ - builtin_define ("__amdfam10"); \ - builtin_define ("__amdfam10__"); \ - break; \ - case PROCESSOR_PENTIUM4: \ - builtin_define ("__pentium4"); \ - builtin_define ("__pentium4__"); \ - break; \ - case PROCESSOR_NOCONA: \ - builtin_define ("__nocona"); \ - builtin_define ("__nocona__"); \ - break; \ - case PROCESSOR_CORE2: \ - builtin_define ("__core2"); \ - builtin_define ("__core2__"); \ - break; \ - case PROCESSOR_GENERIC32: \ - case PROCESSOR_GENERIC64: \ - case PROCESSOR_max: \ - gcc_unreachable (); \ - } \ - \ - /* Built-ins based on -mtune=. */ \ - switch (ix86_tune) \ - { \ - case PROCESSOR_I386: \ - builtin_define ("__tune_i386__"); \ - break; \ - case PROCESSOR_I486: \ - builtin_define ("__tune_i486__"); \ - break; \ - case PROCESSOR_PENTIUM: \ - builtin_define ("__tune_i586__"); \ - builtin_define ("__tune_pentium__"); \ - if (last_tune_char == 'x') \ - builtin_define ("__tune_pentium_mmx__"); \ - break; \ - case PROCESSOR_PENTIUMPRO: \ - builtin_define ("__tune_i686__"); \ - builtin_define ("__tune_pentiumpro__"); \ - switch (last_tune_char) \ - { \ - case '3': \ - builtin_define ("__tune_pentium3__"); \ - /* FALLTHRU */ \ - case '2': \ - builtin_define ("__tune_pentium2__"); \ - break; \ - } \ - break; \ - case PROCESSOR_GEODE: \ - builtin_define ("__tune_geode__"); \ - break; \ - case PROCESSOR_K6: \ - builtin_define ("__tune_k6__"); \ - if (last_tune_char == '2') \ - builtin_define ("__tune_k6_2__"); \ - else if (last_tune_char == '3') \ - builtin_define ("__tune_k6_3__"); \ - break; \ - case PROCESSOR_ATHLON: \ - builtin_define ("__tune_athlon__"); \ - /* Only plain "athlon" lacks SSE. */ \ - if (last_tune_char != 'n') \ - builtin_define ("__tune_athlon_sse__"); \ - break; \ - case PROCESSOR_K8: \ - builtin_define ("__tune_k8__"); \ - break; \ - case PROCESSOR_AMDFAM10: \ - builtin_define ("__tune_amdfam10__"); \ - break; \ - case PROCESSOR_PENTIUM4: \ - builtin_define ("__tune_pentium4__"); \ - break; \ - case PROCESSOR_NOCONA: \ - builtin_define ("__tune_nocona__"); \ - break; \ - case PROCESSOR_CORE2: \ - builtin_define ("__tune_core2__"); \ - break; \ - case PROCESSOR_GENERIC32: \ - case PROCESSOR_GENERIC64: \ - break; \ - case PROCESSOR_max: \ - gcc_unreachable (); \ - } \ - \ - if (TARGET_MMX) \ - builtin_define ("__MMX__"); \ - if (TARGET_3DNOW) \ - builtin_define ("__3dNOW__"); \ - if (TARGET_3DNOW_A) \ - builtin_define ("__3dNOW_A__"); \ - if (TARGET_SSE) \ - builtin_define ("__SSE__"); \ - if (TARGET_SSE2) \ - builtin_define ("__SSE2__"); \ - if (TARGET_SSE3) \ - builtin_define ("__SSE3__"); \ - if (TARGET_SSSE3) \ - builtin_define ("__SSSE3__"); \ - if (TARGET_SSE4_1) \ - builtin_define ("__SSE4_1__"); \ - if (TARGET_SSE4_2) \ - builtin_define ("__SSE4_2__"); \ - if (TARGET_AES) \ - builtin_define ("__AES__"); \ - if (TARGET_PCLMUL) \ - builtin_define ("__PCLMUL__"); \ - if (TARGET_SSE4A) \ - builtin_define ("__SSE4A__"); \ - if (TARGET_SSE5) \ - builtin_define ("__SSE5__"); \ - if (TARGET_SSE_MATH && TARGET_SSE) \ - builtin_define ("__SSE_MATH__"); \ - if (TARGET_SSE_MATH && TARGET_SSE2) \ - builtin_define ("__SSE2_MATH__"); \ - } \ - while (0) +#define TARGET_CPU_CPP_BUILTINS() ix86_target_macros () + +/* Target Pragmas. */ +#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas () enum target_cpu_default { |