1 |
commit: 18f6a4706fd8339bf905e5a36d5fcff525915340 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Mar 21 20:00:01 2015 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Mar 21 20:00:01 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=18f6a470 |
7 |
|
8 |
Update gcc >= 4.9 optimization patch. See bug #544028. |
9 |
|
10 |
...-additional-cpu-optimizations-for-gcc-4.9.patch | 67 +++++++++++++--------- |
11 |
1 file changed, 41 insertions(+), 26 deletions(-) |
12 |
|
13 |
diff --git a/5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch b/5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch |
14 |
index f931f75..c4efd06 100644 |
15 |
--- a/5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch |
16 |
+++ b/5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch |
17 |
@@ -18,13 +18,14 @@ should use the newer 'march=bonnell' flag for atom processors. |
18 |
I have made that change to this patch set as well. See the following kernel |
19 |
bug report to see if I'm right: https://bugzilla.kernel.org/show_bug.cgi?id=77461 |
20 |
|
21 |
-This patch will expand the number of microarchitectures to include new |
22 |
+This patch will expand the number of microarchitectures to include newer |
23 |
processors including: AMD K10-family, AMD Family 10h (Barcelona), AMD Family |
24 |
14h (Bobcat), AMD Family 15h (Bulldozer), AMD Family 15h (Piledriver), AMD |
25 |
Family 16h (Jaguar), Intel 1st Gen Core i3/i5/i7 (Nehalem), Intel 1.5 Gen Core |
26 |
i3/i5/i7 (Westmere), Intel 2nd Gen Core i3/i5/i7 (Sandybridge), Intel 3rd Gen |
27 |
-Core i3/i5/i7 (Ivybridge), Intel 4th Gen Core i3/i5/i7 (Haswell), and Intel 5th |
28 |
-Gen Core i3/i5/i7 (Broadwell). It also offers the compiler the 'native' flag. |
29 |
+Core i3/i5/i7 (Ivybridge), Intel 4th Gen Core i3/i5/i7 (Haswell), Intel 5th |
30 |
+Gen Core i3/i5/i7 (Broadwell), and the low power Silvermont series of Atom |
31 |
+processors (Silvermont). It also offers the compiler the 'native' flag. |
32 |
|
33 |
Small but real speed increases are measurable using a make endpoint comparing |
34 |
a generic kernel to one built with one of the respective microarchs. |
35 |
@@ -36,9 +37,9 @@ REQUIREMENTS |
36 |
linux version >=3.15 |
37 |
gcc version >=4.9 |
38 |
|
39 |
---- a/arch/x86/include/asm/module.h 2014-08-03 18:25:02.000000000 -0400 |
40 |
-+++ b/arch/x86/include/asm/module.h 2014-09-13 09:37:16.721385247 -0400 |
41 |
-@@ -15,6 +15,20 @@ |
42 |
+--- a/arch/x86/include/asm/module.h 2014-06-16 16:44:27.000000000 -0400 |
43 |
++++ b/arch/x86/include/asm/module.h 2015-03-07 03:27:32.556672424 -0500 |
44 |
+@@ -15,6 +15,22 @@ |
45 |
#define MODULE_PROC_FAMILY "586MMX " |
46 |
#elif defined CONFIG_MCORE2 |
47 |
#define MODULE_PROC_FAMILY "CORE2 " |
48 |
@@ -48,6 +49,8 @@ gcc version >=4.9 |
49 |
+#define MODULE_PROC_FAMILY "NEHALEM " |
50 |
+#elif defined CONFIG_MWESTMERE |
51 |
+#define MODULE_PROC_FAMILY "WESTMERE " |
52 |
++#elif defined CONFIG_MSILVERMONT |
53 |
++#define MODULE_PROC_FAMILY "SILVERMONT " |
54 |
+#elif defined CONFIG_MSANDYBRIDGE |
55 |
+#define MODULE_PROC_FAMILY "SANDYBRIDGE " |
56 |
+#elif defined CONFIG_MIVYBRIDGE |
57 |
@@ -59,7 +62,7 @@ gcc version >=4.9 |
58 |
#elif defined CONFIG_MATOM |
59 |
#define MODULE_PROC_FAMILY "ATOM " |
60 |
#elif defined CONFIG_M686 |
61 |
-@@ -33,6 +47,20 @@ |
62 |
+@@ -33,6 +49,20 @@ |
63 |
#define MODULE_PROC_FAMILY "K7 " |
64 |
#elif defined CONFIG_MK8 |
65 |
#define MODULE_PROC_FAMILY "K8 " |
66 |
@@ -80,8 +83,8 @@ gcc version >=4.9 |
67 |
#elif defined CONFIG_MELAN |
68 |
#define MODULE_PROC_FAMILY "ELAN " |
69 |
#elif defined CONFIG_MCRUSOE |
70 |
---- a/arch/x86/Kconfig.cpu 2014-08-03 18:25:02.000000000 -0400 |
71 |
-+++ b/arch/x86/Kconfig.cpu 2014-09-13 09:37:16.721385247 -0400 |
72 |
+--- a/arch/x86/Kconfig.cpu 2014-06-16 16:44:27.000000000 -0400 |
73 |
++++ b/arch/x86/Kconfig.cpu 2015-03-07 03:32:14.337713226 -0500 |
74 |
@@ -137,9 +137,8 @@ config MPENTIUM4 |
75 |
-Paxville |
76 |
-Dempsey |
77 |
@@ -185,7 +188,7 @@ gcc version >=4.9 |
78 |
---help--- |
79 |
|
80 |
Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and |
81 |
-@@ -260,14 +318,55 @@ config MCORE2 |
82 |
+@@ -260,14 +318,63 @@ config MCORE2 |
83 |
family in /proc/cpuinfo. Newer ones have 6 and older ones 15 |
84 |
(not a typo) |
85 |
|
86 |
@@ -213,6 +216,14 @@ gcc version >=4.9 |
87 |
+ |
88 |
+ Enables -march=westmere |
89 |
+ |
90 |
++config MSILVERMONT |
91 |
++ bool "Intel Silvermont" |
92 |
++ ---help--- |
93 |
++ |
94 |
++ Select this for the Intel Silvermont platform. |
95 |
++ |
96 |
++ Enables -march=silvermont |
97 |
++ |
98 |
+config MSANDYBRIDGE |
99 |
+ bool "Intel Sandy Bridge" |
100 |
+ ---help--- |
101 |
@@ -247,7 +258,7 @@ gcc version >=4.9 |
102 |
|
103 |
config GENERIC_CPU |
104 |
bool "Generic-x86-64" |
105 |
-@@ -276,6 +375,19 @@ config GENERIC_CPU |
106 |
+@@ -276,6 +383,19 @@ config GENERIC_CPU |
107 |
Generic x86-64 CPU. |
108 |
Run equally well on all x86-64 CPUs. |
109 |
|
110 |
@@ -267,53 +278,53 @@ gcc version >=4.9 |
111 |
endchoice |
112 |
|
113 |
config X86_GENERIC |
114 |
-@@ -300,7 +412,7 @@ config X86_INTERNODE_CACHE_SHIFT |
115 |
+@@ -300,7 +420,7 @@ config X86_INTERNODE_CACHE_SHIFT |
116 |
config X86_L1_CACHE_SHIFT |
117 |
int |
118 |
default "7" if MPENTIUM4 || MPSC |
119 |
- default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU |
120 |
-+ default "6" if MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MJAGUAR || MPENTIUMM || MCORE2 || MNEHALEM || MWESTMERE || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || BROADWELL || MNATIVE || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU |
121 |
++ default "6" if MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MJAGUAR || MPENTIUMM || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || BROADWELL || MNATIVE || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU |
122 |
default "4" if MELAN || M486 || MGEODEGX1 |
123 |
default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX |
124 |
|
125 |
-@@ -331,11 +443,11 @@ config X86_ALIGNMENT_16 |
126 |
+@@ -331,11 +451,11 @@ config X86_ALIGNMENT_16 |
127 |
|
128 |
config X86_INTEL_USERCOPY |
129 |
def_bool y |
130 |
- depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 |
131 |
-+ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK8SSE3 || MK7 || MEFFICEON || MCORE2 || MK10 || MBARCELONA || MNEHALEM || MWESTMERE || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MNATIVE |
132 |
++ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK8SSE3 || MK7 || MEFFICEON || MCORE2 || MK10 || MBARCELONA || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MNATIVE |
133 |
|
134 |
config X86_USE_PPRO_CHECKSUM |
135 |
def_bool y |
136 |
- depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM |
137 |
-+ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MK10 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MK8SSE3 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MNEHALEM || MWESTMERE || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MATOM || MNATIVE |
138 |
++ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MK10 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MK8SSE3 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MATOM || MNATIVE |
139 |
|
140 |
config X86_USE_3DNOW |
141 |
def_bool y |
142 |
-@@ -359,17 +471,17 @@ config X86_P6_NOP |
143 |
+@@ -359,17 +479,17 @@ config X86_P6_NOP |
144 |
|
145 |
config X86_TSC |
146 |
def_bool y |
147 |
- depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) || X86_64 |
148 |
-+ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MK8SSE3 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MNEHALEM || MWESTMERE || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MNATIVE || MATOM) || X86_64 |
149 |
++ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MK8SSE3 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MNATIVE || MATOM) || X86_64 |
150 |
|
151 |
config X86_CMPXCHG64 |
152 |
def_bool y |
153 |
- depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM |
154 |
-+ depends on X86_PAE || X86_64 || MCORE2 || MNEHALEM || MWESTMERE || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM || MNATIVE |
155 |
++ depends on X86_PAE || X86_64 || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM || MNATIVE |
156 |
|
157 |
# this should be set for all -march=.. options where the compiler |
158 |
# generates cmov. |
159 |
config X86_CMOV |
160 |
def_bool y |
161 |
- depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX) |
162 |
-+ depends on (MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MJAGUAR || MK7 || MCORE2 || MNEHALEM || MWESTMERE || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MNATIVE || MATOM || MGEODE_LX) |
163 |
++ depends on (MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MJAGUAR || MK7 || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MNATIVE || MATOM || MGEODE_LX) |
164 |
|
165 |
config X86_MINIMUM_CPU_FAMILY |
166 |
int |
167 |
---- a/arch/x86/Makefile 2014-08-03 18:25:02.000000000 -0400 |
168 |
-+++ b/arch/x86/Makefile 2014-09-13 09:37:16.721385247 -0400 |
169 |
-@@ -92,13 +92,33 @@ else |
170 |
+--- a/arch/x86/Makefile 2014-06-16 16:44:27.000000000 -0400 |
171 |
++++ b/arch/x86/Makefile 2015-03-07 03:33:27.650843211 -0500 |
172 |
+@@ -92,13 +92,35 @@ else |
173 |
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) |
174 |
|
175 |
# FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) |
176 |
@@ -337,6 +348,8 @@ gcc version >=4.9 |
177 |
+ $(call cc-option,-march=nehalem,$(call cc-option,-mtune=nehalem)) |
178 |
+ cflags-$(CONFIG_MWESTMERE) += \ |
179 |
+ $(call cc-option,-march=westmere,$(call cc-option,-mtune=westmere)) |
180 |
++ cflags-$(CONFIG_MSILVERMONT) += \ |
181 |
++ $(call cc-option,-march=silvermont,$(call cc-option,-mtune=silvermont)) |
182 |
+ cflags-$(CONFIG_MSANDYBRIDGE) += \ |
183 |
+ $(call cc-option,-march=sandybridge,$(call cc-option,-mtune=sandybridge)) |
184 |
+ cflags-$(CONFIG_MIVYBRIDGE) += \ |
185 |
@@ -350,8 +363,8 @@ gcc version >=4.9 |
186 |
cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) |
187 |
KBUILD_CFLAGS += $(cflags-y) |
188 |
|
189 |
---- a/arch/x86/Makefile_32.cpu 2014-08-03 18:25:02.000000000 -0400 |
190 |
-+++ b/arch/x86/Makefile_32.cpu 2014-09-13 09:37:16.721385247 -0400 |
191 |
+--- a/arch/x86/Makefile_32.cpu 2014-06-16 16:44:27.000000000 -0400 |
192 |
++++ b/arch/x86/Makefile_32.cpu 2015-03-07 03:34:15.203586024 -0500 |
193 |
@@ -23,7 +23,15 @@ cflags-$(CONFIG_MK6) += -march=k6 |
194 |
# Please note, that patches that add -march=athlon-xp and friends are pointless. |
195 |
# They make zero difference whatsosever to performance at this time. |
196 |
@@ -368,7 +381,7 @@ gcc version >=4.9 |
197 |
cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 |
198 |
cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 |
199 |
cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) |
200 |
-@@ -32,8 +40,14 @@ cflags-$(CONFIG_MCYRIXIII) += $(call cc- |
201 |
+@@ -32,8 +40,15 @@ cflags-$(CONFIG_MCYRIXIII) += $(call cc- |
202 |
cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) |
203 |
cflags-$(CONFIG_MVIAC7) += -march=i686 |
204 |
cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2) |
205 |
@@ -376,6 +389,7 @@ gcc version >=4.9 |
206 |
- $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic)) |
207 |
+cflags-$(CONFIG_MNEHALEM) += -march=i686 $(call tune,nehalem) |
208 |
+cflags-$(CONFIG_MWESTMERE) += -march=i686 $(call tune,westmere) |
209 |
++cflags-$(CONFIG_MSILVERMONT) += -march=i686 $(call tune,silvermont) |
210 |
+cflags-$(CONFIG_MSANDYBRIDGE) += -march=i686 $(call tune,sandybridge) |
211 |
+cflags-$(CONFIG_MIVYBRIDGE) += -march=i686 $(call tune,ivybridge) |
212 |
+cflags-$(CONFIG_MHASWELL) += -march=i686 $(call tune,haswell) |
213 |
@@ -385,3 +399,4 @@ gcc version >=4.9 |
214 |
|
215 |
# AMD Elan support |
216 |
cflags-$(CONFIG_MELAN) += -march=i486 |
217 |
+ |