diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0316-Always-add-mno-XXX-for-march-native.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0316-Always-add-mno-XXX-for-march-native.patch | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0316-Always-add-mno-XXX-for-march-native.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0316-Always-add-mno-XXX-for-march-native.patch new file mode 100644 index 0000000000..b32aaa9c99 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0316-Always-add-mno-XXX-for-march-native.patch | |||
@@ -0,0 +1,98 @@ | |||
1 | From c6d129bd59a33539ec842283252e7ace52a82838 Mon Sep 17 00:00:00 2001 | ||
2 | From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Tue, 24 May 2011 17:41:51 +0000 | ||
4 | Subject: [PATCH] Always add -mno-XXX for -march=native. | ||
5 | |||
6 | 2011-05-24 H.J. Lu <hongjiu.lu@intel.com> | ||
7 | |||
8 | Backport from mainline | ||
9 | 2011-05-24 H.J. Lu <hongjiu.lu@intel.com> | ||
10 | |||
11 | PR target/49128 | ||
12 | * config/i386/driver-i386.c (host_detect_local_cpu): Always | ||
13 | add -mno-XXX. Handle FMA. | ||
14 | |||
15 | |||
16 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174127 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
17 | |||
18 | index 35962c8..747122b 100644 | ||
19 | --- a/gcc/config/i386/driver-i386.c | ||
20 | +++ b/gcc/config/i386/driver-i386.c | ||
21 | @@ -395,7 +395,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) | ||
22 | unsigned int has_movbe = 0, has_sse4_1 = 0, has_sse4_2 = 0; | ||
23 | unsigned int has_popcnt = 0, has_aes = 0, has_avx = 0; | ||
24 | unsigned int has_pclmul = 0, has_abm = 0, has_lwp = 0; | ||
25 | - unsigned int has_fma4 = 0, has_xop = 0; | ||
26 | + unsigned int has_fma = 0, has_fma4 = 0, has_xop = 0; | ||
27 | unsigned int has_bmi = 0, has_tbm = 0; | ||
28 | |||
29 | bool arch; | ||
30 | @@ -443,6 +443,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) | ||
31 | has_popcnt = ecx & bit_POPCNT; | ||
32 | has_aes = ecx & bit_AES; | ||
33 | has_pclmul = ecx & bit_PCLMUL; | ||
34 | + has_fma = ecx & bit_FMA; | ||
35 | |||
36 | has_cmpxchg8b = edx & bit_CMPXCHG8B; | ||
37 | has_cmov = edx & bit_CMOV; | ||
38 | @@ -681,37 +682,26 @@ const char *host_detect_local_cpu (int argc, const char **argv) | ||
39 | |||
40 | if (arch) | ||
41 | { | ||
42 | - if (has_cmpxchg16b) | ||
43 | - options = concat (options, " -mcx16", NULL); | ||
44 | - if (has_lahf_lm) | ||
45 | - options = concat (options, " -msahf", NULL); | ||
46 | - if (has_movbe) | ||
47 | - options = concat (options, " -mmovbe", NULL); | ||
48 | - if (has_aes) | ||
49 | - options = concat (options, " -maes", NULL); | ||
50 | - if (has_pclmul) | ||
51 | - options = concat (options, " -mpclmul", NULL); | ||
52 | - if (has_popcnt) | ||
53 | - options = concat (options, " -mpopcnt", NULL); | ||
54 | - if (has_abm) | ||
55 | - options = concat (options, " -mabm", NULL); | ||
56 | - if (has_lwp) | ||
57 | - options = concat (options, " -mlwp", NULL); | ||
58 | - if (has_fma4) | ||
59 | - options = concat (options, " -mfma4", NULL); | ||
60 | - if (has_xop) | ||
61 | - options = concat (options, " -mxop", NULL); | ||
62 | - if (has_bmi) | ||
63 | - options = concat (options, " -mbmi", NULL); | ||
64 | - if (has_tbm) | ||
65 | - options = concat (options, " -mtbm", NULL); | ||
66 | - | ||
67 | - if (has_avx) | ||
68 | - options = concat (options, " -mavx", NULL); | ||
69 | - else if (has_sse4_2) | ||
70 | - options = concat (options, " -msse4.2", NULL); | ||
71 | - else if (has_sse4_1) | ||
72 | - options = concat (options, " -msse4.1", NULL); | ||
73 | + const char *cx16 = has_cmpxchg16b ? " -mcx16" : " -mno-cx16"; | ||
74 | + const char *sahf = has_lahf_lm ? " -msahf" : " -mno-sahf"; | ||
75 | + const char *movbe = has_movbe ? " -mmovbe" : " -mno-movbe"; | ||
76 | + const char *ase = has_aes ? " -maes" : " -mno-aes"; | ||
77 | + const char *pclmul = has_pclmul ? " -mpclmul" : " -mno-pclmul"; | ||
78 | + const char *popcnt = has_popcnt ? " -mpopcnt" : " -mno-popcnt"; | ||
79 | + const char *abm = has_abm ? " -mabm" : " -mno-abm"; | ||
80 | + const char *lwp = has_lwp ? " -mlwp" : " -mno-lwp"; | ||
81 | + const char *fma = has_fma ? " -mfma" : " -mno-fma"; | ||
82 | + const char *fma4 = has_fma4 ? " -mfma4" : " -mno-fma4"; | ||
83 | + const char *xop = has_xop ? " -mxop" : " -mno-xop"; | ||
84 | + const char *bmi = has_bmi ? " -mbmi" : " -mno-bmi"; | ||
85 | + const char *tbm = has_tbm ? " -mtbm" : " -mno-tbm"; | ||
86 | + const char *avx = has_avx ? " -mavx" : " -mno-avx"; | ||
87 | + const char *sse4_2 = has_sse4_2 ? " -msse4.2" : " -mno-msse4.2"; | ||
88 | + const char *sse4_1 = has_sse4_1 ? " -msse4.1" : " -mno-sse4.1"; | ||
89 | + | ||
90 | + options = concat (options, cx16, sahf, movbe, ase, pclmul, | ||
91 | + popcnt, abm, lwp, fma, fma4, xop, bmi, tbm, | ||
92 | + avx, sse4_2, sse4_1, NULL); | ||
93 | } | ||
94 | |||
95 | done: | ||
96 | -- | ||
97 | 1.7.0.4 | ||
98 | |||