View | Details | Raw Unified | Return to bug 14059 | Differences between
and this patch

Collapse All | Expand All

(-)a/sysdeps/x86_64/multiarch/init-arch.c (-7 / +12 lines)
Lines 146-160 __init_cpu_features (void) Link Here
146
  if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
146
  if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
147
    {
147
    {
148
      /* Reset the AVX bit in case OSXSAVE is disabled.  */
148
      /* Reset the AVX bit in case OSXSAVE is disabled.  */
149
      if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) != 0
149
      if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) == 0
150
	  && ({ unsigned int xcrlow;
150
         || ({ unsigned int xcrlow;
151
		unsigned int xcrhigh;
151
             unsigned int xcrhigh;
152
		asm ("xgetbv"
152
             asm ("xgetbv"
153
		     : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
153
                  : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
154
		(xcrlow & 6) == 6; }))
154
             (xcrlow & 6) != 6; }))
155
	__cpu_features.feature[index_YMM_Usable] |= bit_YMM_Usable;
155
       __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~bit_AVX;
156
    }
156
    }
157
157
158
  /* FMA4 depends on AVX support */
159
  if (__cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ecx & bit_FMA4
160
      && (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX) == 0)
161
    __cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ecx &= ~bit_FMA4;
162
158
  __cpu_features.family = family;
163
  __cpu_features.family = family;
159
  __cpu_features.model = model;
164
  __cpu_features.model = model;
160
  atomic_write_barrier ();
165
  atomic_write_barrier ();

Return to bug 14059