View previous topic :: View next topic |
Author |
Message |
ConiKost Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 11 Jan 2005 Posts: 1371
|
Posted: Mon Sep 26, 2005 9:51 pm Post subject: Optimale CFlags für Pentium3m ? |
|
|
Hallo!
Momentan nutze ich folgende CFlags ...
Code: |
-march=pentium3m -O3 -pipe -fomit-frame-pointer
|
Ich würde gerne wissen, ob es noch irgendwelche empfehlenswerte Einträge für einen Pentium III (mobile) ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pablo_supertux Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/Mario/Mario_-_Yoshi2.gif)
Joined: 25 Jan 2004 Posts: 2953 Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)
|
Posted: Mon Sep 26, 2005 10:47 pm Post subject: |
|
|
Irgendwann habe ich hier im Forum das hier gefunden, wo weiß ich aber nicht mehr:
Code: |
#!/bin/sh
# Author: pixelbeat
#This script is Linux specific
#It should work on any gcc >= 2.95 at least
#these apply to any arch (just here for reference)
unsafe_math_opts="-ffast-math -fno-math-errno -funsafe-math-optimizations -fno-trapping-math"
gcc_version=`gcc -dumpversion | sed 's/\([0-9]\{1,\}\.[0-9]\{1,\}\)\.*\([0-9]\{1,\}\)\{0,1\}/\1\2/'`
IFS=":"
while read name value; do
unset IFS
name=`echo $name`
value=`echo $value`
IFS=":"
if [ "$name" == "vendor_id" ]; then
vendor_id="$value"
elif [ "$name" == "cpu family" ]; then
cpu_family="$value"
elif [ "$name" == "model" ]; then
cpu_model="$value"
elif [ "$name" == "flags" ]; then
flags="$value"
fi
done < /proc/cpuinfo
unset IFS
if [ "$vendor_id" == "AuthenticAMD" ]; then
if [ "$cpu_family" == "4" ]; then
_CFLAGS="$_CFLAGS -march=i486"
elif [ "$cpu_family" == "5" ]; then
if [ "$cpu_model" -lt "4" ]; then
_CFLAGS="$_CFLAGS -march=pentium"
elif [ "$cpu_model" == "6" ] || [ "$cpu_model" == "7" ]; then
_CFLAGS="$_CFLAGS -march=k6"
elif [ "$cpu_model" == "8" ] || [ "$cpu_model" == "12" ]; then
if expr $gcc_version '>=' 3.1 >/dev/null; then
_CFLAGS="$_CFLAGS -march=k6-2"
else
_CFLAGS="$_CFLAGS -march=k6"
fi
elif [ "$cpu_model" == "9" ] || [ "$cpu_model" == "13" ]; then
if expr $gcc_version '>=' 3.1 >/dev/null; then
_CFLAGS="$_CFLAGS -march=k6-3"
else
_CFLAGS="$_CFLAGS -march=k6"
fi
fi
elif [ "$cpu_family" == "6" ]; then
if [ "$cpu_model" -le "3" ]; then
if expr $gcc_version '>=' 3.0 >/dev/null; then
_CFLAGS="$_CFLAGS -march=athlon"
else
_CFLAGS="$_CFLAGS -march=k6"
fi
elif [ "$cpu_model" == "4" ]; then
if expr $gcc_version '>=' 3.1 >/dev/null; then
_CFLAGS="$_CFLAGS -march=athlon-tbird"
elif expr $gcc_version '>=' 3.0 >/dev/null; then
_CFLAGS="$_CFLAGS -march=athlon"
else
_CFLAGS="$_CFLAGS -march=k6"
fi
elif [ "$cpu_model" -ge "6" ]; then #athlon-{4,xp,mp}
if expr $gcc_version '>=' 3.1 >/dev/null; then
_CFLAGS="$_CFLAGS -march=athlon-xp"
elif expr $gcc_version '>=' 3.0 >/dev/null; then
_CFLAGS="$_CFLAGS -march=athlon"
else
_CFLAGS="$_CFLAGS -march=k6"
fi
fi
fi
else #everything else "GenuineIntel"
if [ "$cpu_family" == "3" ]; then
_CFLAGS="$_CFLAGS -march=i386"
elif [ "$cpu_family" == "4" ]; then
_CFLAGS="$_CFLAGS -march=i486"
elif [ "$cpu_family" == "5" ] && expr $gcc_version '<' 3.1 >/dev/null; then
_CFLAGS="$_CFLAGS -march=pentium"
elif [ "$cpu_family" -ge "6" ] && expr $gcc_version '<' 3.1 >/dev/null; then
_CFLAGS="$_CFLAGS -march=pentiumpro"
elif [ "$cpu_family" == "5" ]; then
if [ "$cpu_model" != "4" ]; then
_CFLAGS="$_CFLAGS -march=pentium"
else
_CFLAGS="$_CFLAGS -march=pentium-mmx" #No overlap with other vendors
fi
elif [ "$cpu_family" == "6" ]; then
if echo "$flags" | grep -vq cmov; then #gcc incorrectly assumes i686 always has cmov
_CFLAGS="$_CFLAGS -march=pentium -mcpu=pentiumpro" #VIA CPUs exhibit this
else
if [ "$cpu_model" == "0" ] || [ "$cpu_model" == "1" ]; then
_CFLAGS="$_CFLAGS -march=pentiumpro"
elif [ "$cpu_model" -ge "3" ] && [ "$cpu_model" -le "6" ]; then #4=TM5600 at least
_CFLAGS="$_CFLAGS -march=pentium2"
elif [ "$cpu_model" -ge "7" ] && [ "$cpu_model" -le "11" ]; then #9 invalid
_CFLAGS="$_CFLAGS -march=pentium3"
fi
fi
elif [ "$cpu_family" == "15" ]; then
_CFLAGS="$_CFLAGS -march=pentium4"
fi
fi
if expr $gcc_version '>=' 3.1 >/dev/null; then
if echo "$flags" | grep -q sse2; then
_CFLAGS="$_CFLAGS -mfpmath=sse -msse2"
elif echo "$flags" | grep -q sse; then
_CFLAGS="$_CFLAGS -mfpmath=sse -msse"
fi
if echo "$flags" | grep -q mmx; then
_CFLAGS="$_CFLAGS -mmmx"
fi
if echo "$flags" | grep -q 3dnow; then
_CFLAGS="$_CFLAGS -m3dnow"
fi
fi
echo "$_CFLAGS"
|
Ich hab ein einen P3 und benutze seitdem diese Flags und bei mir geht alles wunderbar.
edit: wegen Schreibfehler _________________ A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
EdtheRat Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 17 Sep 2005 Posts: 113 Location: Germany - in the middle of nowhere!
|
Posted: Tue Sep 27, 2005 5:41 pm Post subject: |
|
|
Das sind zusätzliche cpuflags die Du auch teilweise mit den useflags definieren kannst! Herausfinden kannst Du das mit less /proc/cpuinfo. Prozessorlastige Programme die das unterstützen, nutzen dann auch diese Flags, weil sie ja auch damit "übersetzt" werden. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
tango Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 24 Jan 2005 Posts: 251
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Mr. Anderson l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/2070781095424ebf0894d33.png)
Joined: 22 Apr 2004 Posts: 762
|
Posted: Wed Sep 28, 2005 2:18 am Post subject: |
|
|
Ich würd's so belassen wie es ist. Evtl. aus dem O3 ein O2 machen. Das Skript ist zwar schön gemacht, hilft hier m. E. aber nicht weiter. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|