Add AVX/AVX2 supported archs in build system
This patch adds new arch features avx2 and avx512 and
their supported archictectures for x86 and x86_64
Bug: 123376719
Test: m checkbuild
Change-Id: I3c079741815b39d7dbb4072e12ef7c9c2c15f5fe
Signed-off-by: Shalini Salomi Bodapati <shalini.salomi.bodapati@intel.com>
diff --git a/android/arch.go b/android/arch.go
index 151cabd..797c84c 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -155,18 +155,32 @@
"mips64r6",
},
X86: {
+ "amberlake",
"atom",
+ "broadwell",
"haswell",
+ "icelake",
"ivybridge",
+ "kabylake",
"sandybridge",
"silvermont",
+ "skylake",
+ "tigerlake",
+ "whiskeylake",
"x86_64",
},
X86_64: {
+ "amberlake",
+ "broadwell",
"haswell",
+ "icelake",
"ivybridge",
+ "kabylake",
"sandybridge",
"silvermont",
+ "skylake",
+ "tigerlake",
+ "whiskeylake",
},
}
@@ -190,6 +204,8 @@
"sse4_2",
"aes_ni",
"avx",
+ "avx2",
+ "avx512",
"popcnt",
"movbe",
},
@@ -200,6 +216,8 @@
"sse4_2",
"aes_ni",
"avx",
+ "avx2",
+ "avx512",
"popcnt",
},
}
@@ -230,10 +248,30 @@
},
},
X86: {
+ "amberlake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
"atom": {
"ssse3",
"movbe",
},
+ "broadwell": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
"haswell": {
"ssse3",
"sse4",
@@ -244,6 +282,17 @@
"popcnt",
"movbe",
},
+ "icelake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
"ivybridge": {
"ssse3",
"sse4",
@@ -253,6 +302,16 @@
"avx",
"popcnt",
},
+ "kabylake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
"sandybridge": {
"ssse3",
"sse4",
@@ -269,6 +328,39 @@
"popcnt",
"movbe",
},
+ "skylake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
+ "tigerlake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
+ "whiskeylake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
"x86_64": {
"ssse3",
"sse4",
@@ -278,6 +370,26 @@
},
},
X86_64: {
+ "amberlake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
+ "broadwell": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
"haswell": {
"ssse3",
"sse4",
@@ -287,6 +399,17 @@
"avx",
"popcnt",
},
+ "icelake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
"ivybridge": {
"ssse3",
"sse4",
@@ -296,6 +419,16 @@
"avx",
"popcnt",
},
+ "kabylake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
"sandybridge": {
"ssse3",
"sse4",
@@ -311,6 +444,39 @@
"aes_ni",
"popcnt",
},
+ "skylake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
+ "tigerlake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
+ "whiskeylake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "avx512",
+ "aes_ni",
+ "popcnt",
+ },
},
}
diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go
index 4264eda..8a86db4 100644
--- a/cc/config/x86_64_device.go
+++ b/cc/config/x86_64_device.go
@@ -38,6 +38,10 @@
"": []string{
"-march=x86-64",
},
+ "broadwell": []string{
+ "-march=broadwell",
+ },
+
"haswell": []string{
"-march=core-avx2",
},
@@ -50,6 +54,9 @@
"silvermont": []string{
"-march=slm",
},
+ "skylake": []string{
+ "-march=skylake",
+ },
}
x86_64ArchFeatureCflags = map[string][]string{
@@ -59,6 +66,8 @@
"sse4_2": []string{"-msse4.2"},
"popcnt": []string{"-mpopcnt"},
"avx": []string{"-mavx"},
+ "avx2": []string{"-mavx2"},
+ "avx512": []string{"-mavx512"},
"aes_ni": []string{"-maes"},
}
)
diff --git a/cc/config/x86_device.go b/cc/config/x86_device.go
index 34e7df8..b3d6a4d 100644
--- a/cc/config/x86_device.go
+++ b/cc/config/x86_device.go
@@ -51,6 +51,10 @@
"-march=atom",
"-mfpmath=sse",
},
+ "broadwell": []string{
+ "-march=broadwell",
+ "-mfpmath=sse",
+ },
"haswell": []string{
"-march=core-avx2",
"-mfpmath=sse",
@@ -67,6 +71,10 @@
"-march=slm",
"-mfpmath=sse",
},
+ "skylake": []string{
+ "-march=skylake",
+ "-mfpmath=sse",
+ },
}
x86ArchFeatureCflags = map[string][]string{