Line
Link Here
|
0 |
-- sysdeps/x86_64/multiarch/init-arch.c |
0 |
++ sysdeps/x86_64/multiarch/init-arch.c |
Lines 1-6
Link Here
|
1 |
/* Initialize CPU feature data. |
1 |
/* Initialize CPU feature data. |
2 |
This file is part of the GNU C Library. |
2 |
This file is part of the GNU C Library. |
3 |
Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
3 |
Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. |
4 |
Contributed by Ulrich Drepper <drepper@redhat.com>. |
4 |
Contributed by Ulrich Drepper <drepper@redhat.com>. |
5 |
|
5 |
|
6 |
The GNU C Library is free software; you can redistribute it and/or |
6 |
The GNU C Library is free software; you can redistribute it and/or |
Lines 144-149
__init_cpu_features (void)
Link Here
|
144 |
else |
144 |
else |
145 |
kind = arch_kind_other; |
145 |
kind = arch_kind_other; |
146 |
|
146 |
|
|
|
147 |
if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX) |
148 |
{ |
149 |
/* Reset the AVX bit in case OSXSAVE is disabled. */ |
150 |
if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) == 0 |
151 |
|| ({ unsigned int xcrlow; |
152 |
unsigned int xcrhigh; |
153 |
asm ("xgetbv" |
154 |
: "=a" (xcrlow), "=d" (xcrhigh) : "c" (0)); |
155 |
(xcrlow & 6) != 6; })) |
156 |
__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~bit_AVX; |
157 |
} |
158 |
|
147 |
__cpu_features.family = family; |
159 |
__cpu_features.family = family; |
148 |
__cpu_features.model = model; |
160 |
__cpu_features.model = model; |
149 |
atomic_write_barrier (); |
161 |
atomic_write_barrier (); |
150 |
-- sysdeps/x86_64/multiarch/init-arch.h |
162 |
++ sysdeps/x86_64/multiarch/init-arch.h |
Lines 1-5
Link Here
|
1 |
/* This file is part of the GNU C Library. |
1 |
/* This file is part of the GNU C Library. |
2 |
Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
2 |
Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. |
3 |
|
3 |
|
4 |
The GNU C Library is free software; you can redistribute it and/or |
4 |
The GNU C Library is free software; you can redistribute it and/or |
5 |
modify it under the terms of the GNU Lesser General Public |
5 |
modify it under the terms of the GNU Lesser General Public |
Lines 27-32
Link Here
|
27 |
#define bit_SSSE3 (1 << 9) |
27 |
#define bit_SSSE3 (1 << 9) |
28 |
#define bit_SSE4_1 (1 << 19) |
28 |
#define bit_SSE4_1 (1 << 19) |
29 |
#define bit_SSE4_2 (1 << 20) |
29 |
#define bit_SSE4_2 (1 << 20) |
|
|
30 |
#define bit_OSXSAVE (1 << 27) |
30 |
#define bit_AVX (1 << 28) |
31 |
#define bit_AVX (1 << 28) |
31 |
#define bit_POPCOUNT (1 << 23) |
32 |
#define bit_POPCOUNT (1 << 23) |
32 |
#define bit_FMA (1 << 12) |
33 |
#define bit_FMA (1 << 12) |