From 1814df5b02b9c359052c2048a1d2d617b406a17a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 18 Aug 2015 07:59:49 -0700 Subject: Define HAS_CPUID/HAS_I586/HAS_I686 from -march= cpuid, i586 and i686 instructions are available if the processor specified by -march= supports them. We can use this information to determine whether those instructions can be used safely. * sysdeps/x86/cpu-features.c (init_cpu_features): Check whether cpuid is available only if HAS_CPUID is 0. * sysdeps/x86/cpu-features.h (HAS_CPUID): New. (HAS_I586): Likewise. (HAS_I686): Likewise. --- sysdeps/x86/cpu-features.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/x86/cpu-features.c') diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index 582a8f5f79..40575de611 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -40,7 +40,7 @@ init_cpu_features (struct cpu_features *cpu_features) unsigned int model = 0; enum cpu_features_kind kind; -#if !defined __i586__ && !defined __i686__ && !defined __x86_64__ +#if !HAS_CPUID if (__get_cpuid_max (0, 0) == 0) { kind = arch_kind_other; @@ -204,7 +204,7 @@ init_cpu_features (struct cpu_features *cpu_features) } } -#if !defined __i586__ && !defined __i686__ && !defined __x86_64__ +#if !HAS_CPUID no_cpuid: #endif -- cgit v1.2.3