tweaked cpu flag short output to handle sse4a and sse4 and sse5

This commit is contained in:
inxi-svn 2009-08-03 06:59:17 +00:00
parent aaf69ff9d2
commit a18aa882a8

16
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.1.6 #### version: 1.1.7
#### Date: August 2 2009 #### Date: August 2 2009
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -3379,10 +3379,10 @@ process_cpu_flags()
{ {
eval $LOGFS eval $LOGFS
local cpu_flags="$1" local cpu_flags="$1"
# nx = AMD stack protection extensions # nx = AMD stack protection extensions
# lm = Intel 64bit extensions # lm = Intel 64bit extensions
# sse, sse2, pni = sse1,2,3 gfx extensions # sse, sse2, pni = sse1,2,3,4,5 gfx extensions
# svm = AMD pacifica virtualization extensions # svm = AMD pacifica virtualization extensions
# vmx = Intel IVT (vanderpool) virtualization extensions # vmx = Intel IVT (vanderpool) virtualization extensions
cpu_flags=$( echo "$cpu_flags" | gawk ' cpu_flags=$( echo "$cpu_flags" | gawk '
@ -3391,11 +3391,15 @@ process_cpu_flags()
ssel["sse"] = 1 ssel["sse"] = 1
ssel["sse2"] = 2 ssel["sse2"] = 2
ssel["pni"] = 3 ssel["pni"] = 3
ssel["sse4"] = 4 ssel["sse4a"] = 4 # 4a must precede 4
ssel["sse4"] = 5
ssel["sse5"] = 6
sses[1] = "sse" sses[1] = "sse"
sses[2] = "sse2" sses[2] = "sse2"
sses[3] = "sse3" sses[3] = "sse3"
sses[4] = "sse4" sses[4] = "sse4a"
sses[5] = "sse4"
sses[6] = "sse5"
} }
/^(nx|lm|svm|vmx)$/ { /^(nx|lm|svm|vmx)$/ {
if (s) { if (s) {
@ -3405,7 +3409,7 @@ process_cpu_flags()
s = $0 s = $0
} }
} }
/^(sse|sse2|sse4|pni)$/ { /^(sse|sse2|sse4a|sse4|sse5|pni)$/ {
if (ssel[$0] > sse) { if (ssel[$0] > sse) {
sse = ssel[$0] sse = ssel[$0]
} }