|
|
67287f |
2014-02-18 Jakub Jelinek <jakub@redhat.com>
|
|
|
67287f |
Uros Bizjak <ubizjak@gmail.com>
|
|
|
67287f |
|
|
|
67287f |
PR driver/60233
|
|
|
67287f |
* config/i386/driver-i386.c (host_detect_local_cpu): If
|
|
|
67287f |
YMM state is not saved by the OS, also clear has_f16c. Move
|
|
|
67287f |
CPUID 0x80000001 handling before YMM state saving checking.
|
|
|
67287f |
|
|
|
67287f |
--- gcc/config/i386/driver-i386.c (revision 207833)
|
|
|
67287f |
+++ gcc/config/i386/driver-i386.c (revision 207834)
|
|
|
67287f |
@@ -488,6 +488,28 @@ const char *host_detect_local_cpu (int a
|
|
|
67287f |
has_xsaveopt = eax & bit_XSAVEOPT;
|
|
|
67287f |
}
|
|
|
67287f |
|
|
|
67287f |
+ /* Check cpuid level of extended features. */
|
|
|
67287f |
+ __cpuid (0x80000000, ext_level, ebx, ecx, edx);
|
|
|
67287f |
+
|
|
|
67287f |
+ if (ext_level > 0x80000000)
|
|
|
67287f |
+ {
|
|
|
67287f |
+ __cpuid (0x80000001, eax, ebx, ecx, edx);
|
|
|
67287f |
+
|
|
|
67287f |
+ has_lahf_lm = ecx & bit_LAHF_LM;
|
|
|
67287f |
+ has_sse4a = ecx & bit_SSE4a;
|
|
|
67287f |
+ has_abm = ecx & bit_ABM;
|
|
|
67287f |
+ has_lwp = ecx & bit_LWP;
|
|
|
67287f |
+ has_fma4 = ecx & bit_FMA4;
|
|
|
67287f |
+ has_xop = ecx & bit_XOP;
|
|
|
67287f |
+ has_tbm = ecx & bit_TBM;
|
|
|
67287f |
+ has_lzcnt = ecx & bit_LZCNT;
|
|
|
67287f |
+ has_prfchw = ecx & bit_PRFCHW;
|
|
|
67287f |
+
|
|
|
67287f |
+ has_longmode = edx & bit_LM;
|
|
|
67287f |
+ has_3dnowp = edx & bit_3DNOWP;
|
|
|
67287f |
+ has_3dnow = edx & bit_3DNOW;
|
|
|
67287f |
+ }
|
|
|
67287f |
+
|
|
|
67287f |
/* Get XCR_XFEATURE_ENABLED_MASK register with xgetbv. */
|
|
|
67287f |
#define XCR_XFEATURE_ENABLED_MASK 0x0
|
|
|
67287f |
#define XSTATE_FP 0x1
|
|
|
67287f |
@@ -506,33 +528,12 @@ const char *host_detect_local_cpu (int a
|
|
|
67287f |
has_avx2 = 0;
|
|
|
67287f |
has_fma = 0;
|
|
|
67287f |
has_fma4 = 0;
|
|
|
67287f |
+ has_f16c = 0;
|
|
|
67287f |
has_xop = 0;
|
|
|
67287f |
has_xsave = 0;
|
|
|
67287f |
has_xsaveopt = 0;
|
|
|
67287f |
}
|
|
|
67287f |
|
|
|
67287f |
- /* Check cpuid level of extended features. */
|
|
|
67287f |
- __cpuid (0x80000000, ext_level, ebx, ecx, edx);
|
|
|
67287f |
-
|
|
|
67287f |
- if (ext_level > 0x80000000)
|
|
|
67287f |
- {
|
|
|
67287f |
- __cpuid (0x80000001, eax, ebx, ecx, edx);
|
|
|
67287f |
-
|
|
|
67287f |
- has_lahf_lm = ecx & bit_LAHF_LM;
|
|
|
67287f |
- has_sse4a = ecx & bit_SSE4a;
|
|
|
67287f |
- has_abm = ecx & bit_ABM;
|
|
|
67287f |
- has_lwp = ecx & bit_LWP;
|
|
|
67287f |
- has_fma4 = ecx & bit_FMA4;
|
|
|
67287f |
- has_xop = ecx & bit_XOP;
|
|
|
67287f |
- has_tbm = ecx & bit_TBM;
|
|
|
67287f |
- has_lzcnt = ecx & bit_LZCNT;
|
|
|
67287f |
- has_prfchw = ecx & bit_PRFCHW;
|
|
|
67287f |
-
|
|
|
67287f |
- has_longmode = edx & bit_LM;
|
|
|
67287f |
- has_3dnowp = edx & bit_3DNOWP;
|
|
|
67287f |
- has_3dnow = edx & bit_3DNOW;
|
|
|
67287f |
- }
|
|
|
67287f |
-
|
|
|
67287f |
if (!arch)
|
|
|
67287f |
{
|
|
|
67287f |
if (vendor == signature_AMD_ebx
|