summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-10-18 04:34:20 -0700
committerMatthew Cline <zelgadis@sourceforge.net>2009-10-18 04:34:20 -0700
commit0a32c9f82392db7fe510c3c09ead69076aba2ae6 (patch)
treeeaa6df26b0f6eb5b4ebed2cf1c6ab8f7e2026ed2 /crawl-ref/source/util
parentb2aa4add5ed29c54cba353d9ff914c9fe10c886e (diff)
downloadcrawl-ref-0a32c9f82392db7fe510c3c09ead69076aba2ae6.tar.gz
crawl-ref-0a32c9f82392db7fe510c3c09ead69076aba2ae6.zip
git-opt-x86.pl: Detect some more arches
Detect pentium, pentium-mmx, pentiumpro, athlon, and amdfam10.
Diffstat (limited to 'crawl-ref/source/util')
-rwxr-xr-xcrawl-ref/source/util/gcc-opt-x86.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/crawl-ref/source/util/gcc-opt-x86.pl b/crawl-ref/source/util/gcc-opt-x86.pl
index 808eecac2d..7454df70ea 100755
--- a/crawl-ref/source/util/gcc-opt-x86.pl
+++ b/crawl-ref/source/util/gcc-opt-x86.pl
@@ -29,6 +29,8 @@ if ( ! $cpuinfo ) {
my %features;
my $family;
+my $uname_M = `uname -m`;
+my $uname_P = `uname -p`;
my $uname_S = `uname -s`;
#
@@ -66,12 +68,27 @@ if ( $uname_S =~ /^Darwin/ ) {
$features{"ssse3"} = `sysctl -n hw.optional.supplementalsse3`;
}
+# TODO architectures:
+# * athlon-4, athlon-xp, athlon-mp
+# * k8, opteron, athlon64, athlon-fx
+# * k8-sse3, opteron-sse3, athlon64-sse3
+# * winchip-c6, winchip2
+
#
# Check the minimum march/mtune value
#
my $march = "i386";
my $fpmath;
+if ($uname_M eq "i586" || $uname_M eq "i686")
+{
+ # Pentium and PentiumPro
+ $march = $uname_M;
+}
+if ( $uname_M eq "i586" && $features{"mmx"} )
+{
+ $march = "pentium-mmx";
+}
if ( $features{"cmov"} && $features{"mmx"} ) {
$march = "pentium2";
}
@@ -85,6 +102,15 @@ if ( $features{"sse2"} ) {
if ( $features{"pni"} ) {
$march = "prescott";
}
+if ( $uname_P =~ /Athlon/ )
+{
+ $march = "athlon";
+
+ if ( $features{"abm"} && $features{"sse4a"} )
+ {
+ $march = "amdfam10";
+ }
+}
# It's important to specify 'march=pentium4' for the
# Pentium 4, because it has vastly different optimization