mirror of
https://github.com/kejilion/sh.git
synced 2025-10-03 23:34:20 +08:00
Add files via upload
This commit is contained in:
parent
232dc1e22d
commit
a74d54a3ef
1 changed files with 11 additions and 0 deletions
11
check_x86-64_psabi.sh
Normal file
11
check_x86-64_psabi.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/awk -f
|
||||
|
||||
BEGIN {
|
||||
while (!/flags/) if (getline < "/proc/cpuinfo" != 1) exit 1
|
||||
if (/lm/&&/cmov/&&/cx8/&&/fpu/&&/fxsr/&&/mmx/&&/syscall/&&/sse2/) level = 1
|
||||
if (level == 1 && /cx16/&&/lahf/&&/popcnt/&&/sse4_1/&&/sse4_2/&&/ssse3/) level = 2
|
||||
if (level == 2 && /avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/) level = 3
|
||||
if (level == 3 && /avx512f/&&/avx512bw/&&/avx512cd/&&/avx512dq/&&/avx512vl/) level = 4
|
||||
if (level > 0) { print "CPU supports x86-64-v" level; exit level + 1 }
|
||||
exit 1
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue