(change version)

fixed bug in sse output for flags
This commit is contained in:
inxi-svn 2010-03-05 22:36:09 +00:00
parent dc8706cfa7
commit 32da9c7a7f

56
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.4.7 #### version: 1.4.8
#### Date: March 4 2010 #### Date: March 5 2010
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -3943,55 +3943,45 @@ calculate_multicore_data()
process_cpu_flags() process_cpu_flags()
{ {
eval $LOGFS eval $LOGFS
local cpu_flags="$1" # must have a space after last item in list for RS=" "
local cpu_flags_working="$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,4,5 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_working" | gawk '
BEGIN { BEGIN {
RS=" " RS=" "
a_ssel["sse"] = 1 count = 0
a_ssel["sse2"] = 2 i = 1 # start at one because of for increment issue
a_ssel["pni"] = 3
a_ssel["sse4a"] = 4 # 4a must precede 4
a_ssel["sse4"] = 5
a_ssel["sse5"] = 6
a_sses[1] = "sse"
a_sses[2] = "sse2"
a_sses[3] = "sse3"
a_sses[4] = "sse4a"
a_sses[5] = "sse4"
a_sses[6] = "sse5"
sseCounter = 0
flag_string = "" flag_string = ""
} }
/^(nx|lm|svm|vmx)$/ { /^(lm|nx|pni|svm|vmx|(sss|ss)e([2-9])?([a-z])?(_[0-9])?)$/ {
if ( flag_string != "" ) { if ( $0 == "pni" ){
flag_string = flag_string " " $0 a_flags[i] = "sse3"
}
else {
flag_string = $0
}
}
/^(sse|sse2|sse4a|sse4|sse5|pni)$/ {
if ( a_ssel[$0] > sseCounter ) {
sseCounter = a_ssel[$0]
} }
else {
a_flags[i] = $0
}
i++
} }
END { END {
if ( sseCounter > 0 ) { count = asort( a_flags )
if ( flag_string != "" ) { # note: why does gawk increment before the loop and not after? weird.
flag_string = a_sses[sseCounter] " " flag_string for ( i=0; i <= count; i++ ){
if ( flag_string == "" ) {
flag_string = a_flags[i]
} }
else { else {
flag_string = a_sses[sseCounter] flag_string = flag_string " " a_flags[i]
} }
} }
print flag_string print flag_string
}' ) }'
)
#grep -oE '\<(nx|lm|sse[0-9]?|pni|svm|vmx)\>' | tr '\n' ' ')) #grep -oE '\<(nx|lm|sse[0-9]?|pni|svm|vmx)\>' | tr '\n' ' '))
if [[ -z $cpu_flags ]];then if [[ -z $cpu_flags ]];then