We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 232dc1e commit a74d54aCopy full SHA for a74d54a
check_x86-64_psabi.sh
@@ -0,0 +1,11 @@
1
+#!/usr/bin/awk -f
2
+
3
+BEGIN {
4
+ while (!/flags/) if (getline < "/proc/cpuinfo" != 1) exit 1
5
+ if (/lm/&&/cmov/&&/cx8/&&/fpu/&&/fxsr/&&/mmx/&&/syscall/&&/sse2/) level = 1
6
+ if (level == 1 && /cx16/&&/lahf/&&/popcnt/&&/sse4_1/&&/sse4_2/&&/ssse3/) level = 2
7
+ if (level == 2 && /avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/) level = 3
8
+ if (level == 3 && /avx512f/&&/avx512bw/&&/avx512cd/&&/avx512dq/&&/avx512vl/) level = 4
9
+ if (level > 0) { print "CPU supports x86-64-v" level; exit level + 1 }
10
+ exit 1
11
+}
0 commit comments