Contents of /trunk/glibc/patches/glibc-2.16.0-detect-fma.patch
Parent Directory | Revision Log
Revision 1925 -
(show annotations)
(download)
Sun Oct 28 19:05:24 2012 UTC (11 years, 10 months ago) by niro
File size: 3127 byte(s)
Sun Oct 28 19:05:24 2012 UTC (11 years, 10 months ago) by niro
File size: 3127 byte(s)
-more glibc-2.16 fixes
1 | diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c |
2 | index fb44dcf..fed5ab8 100644 |
3 | --- a/sysdeps/x86_64/multiarch/init-arch.c |
4 | +++ b/sysdeps/x86_64/multiarch/init-arch.c |
5 | @@ -156,6 +156,9 @@ __init_cpu_features (void) |
6 | /* Determine if AVX is usable. */ |
7 | if (CPUID_AVX) |
8 | __cpu_features.feature[index_AVX_Usable] |= bit_AVX_Usable; |
9 | + /* Determine if FMA is usable. */ |
10 | + if (CPUID_FMA) |
11 | + __cpu_features.feature[index_FMA_Usable] |= bit_FMA_Usable; |
12 | /* Determine if FMA4 is usable. */ |
13 | if (CPUID_FMA4) |
14 | __cpu_features.feature[index_FMA4_Usable] |= bit_FMA4_Usable; |
15 | diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h |
16 | index 45e2651..f33f1c8 100644 |
17 | --- a/sysdeps/x86_64/multiarch/init-arch.h |
18 | +++ b/sysdeps/x86_64/multiarch/init-arch.h |
19 | @@ -22,7 +22,8 @@ |
20 | #define bit_Fast_Unaligned_Load (1 << 4) |
21 | #define bit_Prefer_PMINUB_for_stringop (1 << 5) |
22 | #define bit_AVX_Usable (1 << 6) |
23 | -#define bit_FMA4_Usable (1 << 7) |
24 | +#define bit_FMA_Usable (1 << 7) |
25 | +#define bit_FMA4_Usable (1 << 8) |
26 | |
27 | /* CPUID Feature flags. */ |
28 | #define bit_SSE2 (1 << 26) |
29 | @@ -56,6 +57,7 @@ |
30 | # define index_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE |
31 | # define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE |
32 | # define index_AVX_Usable FEATURE_INDEX_1*FEATURE_SIZE |
33 | +# define index_FMA_Usable FEATURE_INDEX_1*FEATURE_SIZE |
34 | # define index_FMA4_Usable FEATURE_INDEX_1*FEATURE_SIZE |
35 | |
36 | #else /* __ASSEMBLER__ */ |
37 | @@ -131,6 +133,8 @@ extern const struct cpu_features *__get_cpu_features (void) |
38 | HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_OSXSAVE) |
39 | # define CPUID_AVX \ |
40 | HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_AVX) |
41 | +# define CPUID_FMA \ |
42 | + HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_FMA) |
43 | # define CPUID_FMA4 \ |
44 | HAS_CPUID_FLAG (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4) |
45 | |
46 | @@ -140,7 +144,6 @@ extern const struct cpu_features *__get_cpu_features (void) |
47 | # define HAS_SSSE3 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSSE3) |
48 | # define HAS_SSE4_1 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_1) |
49 | # define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_2) |
50 | -# define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_FMA) |
51 | |
52 | # define index_Fast_Rep_String FEATURE_INDEX_1 |
53 | # define index_Fast_Copy_Backward FEATURE_INDEX_1 |
54 | @@ -148,6 +151,7 @@ extern const struct cpu_features *__get_cpu_features (void) |
55 | # define index_Prefer_SSE_for_memop FEATURE_INDEX_1 |
56 | # define index_Fast_Unaligned_Load FEATURE_INDEX_1 |
57 | # define index_AVX_Usable FEATURE_INDEX_1 |
58 | +# define index_FMA_Usable FEATURE_INDEX_1 |
59 | # define index_FMA4_Usable FEATURE_INDEX_1 |
60 | |
61 | # define HAS_ARCH_FEATURE(name) \ |
62 | @@ -159,6 +163,7 @@ extern const struct cpu_features *__get_cpu_features (void) |
63 | # define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop) |
64 | # define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load) |
65 | # define HAS_AVX HAS_ARCH_FEATURE (AVX_Usable) |
66 | +# define HAS_FMA HAS_ARCH_FEATURE (FMA_Usable) |
67 | # define HAS_FMA4 HAS_ARCH_FEATURE (FMA4_Usable) |
68 | |
69 | #endif /* __ASSEMBLER__ */ |
70 | -- |
71 | 1.7.3.4 |