Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

2
devel/cpuflags/DESCR Normal file
View File

@@ -0,0 +1,2 @@
cpuflags returns the appropriate gcc flags to optimise compilation for the
current CPU.

36
devel/cpuflags/Makefile Normal file
View File

@@ -0,0 +1,36 @@
# $NetBSD: Makefile,v 1.151 2012/10/31 11:16:48 asau Exp $
DISTNAME= cpuflags-1.42
CATEGORIES= devel sysutils
MASTER_SITES= # empty
DISTFILES= # empty
MAINTAINER= abs@NetBSD.org
COMMENT= Determine compiler flags to best target current cpu
ONLY_FOR_PLATFORM= NetBSD-*-* Linux-*-* SunOS-*-* FreeBSD-*-* Darwin-*-*
USE_LANGUAGES= # empty
NO_CONFIGURE= yes
MAKE_FLAGS+= INSTALL_DATA=${INSTALL_DATA:Q}
MAKE_FLAGS+= INSTALL_MAN=${INSTALL_MAN:Q}
MAKE_FLAGS+= INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
MAKE_FLAGS+= INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q}
MAKE_FLAGS+= INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q}
MAKE_FLAGS+= INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q}
MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}/man1
SUBST_CLASSES+= cpuflags
SUBST_STAGE.cpuflags= post-patch
SUBST_FILES.cpuflags= cpuflags.sh
SUBST_SED.cpuflags= -e s,@@SH@@,${SH:Q},
do-extract:
${MKDIR} ${WRKSRC}
${CP} ${FILESDIR}/Makefile ${WRKSRC}
${CP} ${FILESDIR}/c* ${WRKSRC}
${CP} ${FILESDIR}/o* ${WRKSRC}
${CP} ${FILESDIR}/s* ${WRKSRC}
.include "../../mk/bsd.pkg.mk"

12
devel/cpuflags/PLIST Normal file
View File

@@ -0,0 +1,12 @@
@comment $NetBSD: PLIST,v 1.7 2010/12/06 10:56:31 abs Exp $
bin/cpuflags
man/man1/cpuflags.1
share/cpuflags/subr_Darwin
share/cpuflags/subr_FreeBSD
share/cpuflags/subr_Linux
share/cpuflags/subr_NetBSD
share/cpuflags/subr_SunOS
share/cpuflags/subr_gcc
share/cpuflags/subr_x86
share/mk/cpuflags.mk
share/mk/optimize_gcc.mk

View File

@@ -0,0 +1,43 @@
# $Id: Makefile,v 1.14 2009/11/12 05:40:36 obache Exp $
VERSION=1.14
PREFIX?=/usr/local
OPSYS?=`uname`
MANDIR?=${PREFIX}/man/man1
SUBRDIR?=${PREFIX}/share/cpuflags
SHAREMKDIR?=${PREFIX}/share/mk
BINDIR?=${PREFIX}/bin
INSTALL_DATA?=install
INSTALL_MAN?=install
INSTALL_SCRIPT?=install
INSTALL_PROGRAM_DIR?=mkdir -p
INSTALL_MAN_DIR?=mkdir -p
INSTALL_DATA_DIR?=mkdir -p
SED?=sed
all:
${SED} -e 's|@PREFIX@|${PREFIX}|g' cpuflags.1 > cpuflags.1.out
${SED} -e 's|@PREFIX@|${PREFIX}|g' cpuflags.mk > cpuflags.mk.out
${SED} -e 's|@PREFIX@|${PREFIX}|g' cpuflags.sh > cpuflags.sh.out
clean:
rm -rf *.out DIST
install:
${INSTALL_PROGRAM_DIR} ${DESTDIR}${BINDIR}
${INSTALL_MAN_DIR} ${DESTDIR}${MANDIR}
${INSTALL_DATA_DIR} ${DESTDIR}${SHAREMKDIR}
${INSTALL_DATA_DIR} ${DESTDIR}${SUBRDIR}
${INSTALL_SCRIPT} cpuflags.sh.out ${DESTDIR}${BINDIR}/cpuflags
${INSTALL_MAN} cpuflags.1.out ${DESTDIR}${MANDIR}/cpuflags.1
${INSTALL_DATA} optimize_gcc.mk ${DESTDIR}${SHAREMKDIR}/optimize_gcc.mk
${INSTALL_DATA} cpuflags.mk.out ${DESTDIR}${SHAREMKDIR}/cpuflags.mk
${INSTALL_DATA} subr_* ${DESTDIR}${SUBRDIR}
dist:
mkdir -p DIST/cpuflags-${VERSION}
cp Makefile [a-z]* DIST/cpuflags-${VERSION}
(cd DIST;pax -w cpuflags-${VERSION}|bzip2 -9 > cpuflags-${VERSION}.tbz)
rm -rf DIST/cpuflags-${VERSION}

View File

@@ -0,0 +1,121 @@
.\" $NetBSD: cpuflags.1,v 1.21 2008/07/21 10:46:16 abs Exp $
.\"
.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by David Brownlee <abs@NetBSD.org>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 31, 2001
.Dt CPUFLAGS 1
.Os
.Sh NAME
.Nm cpuflags
.Nd determine compiler flags to best target current CPU
.Sh SYNOPSIS
.Nm
.Op cc_pathname
.Sh DESCRIPTION
.Nm
determines the current CPU type and gcc version, then outputs appropriate
compiler options to best target code for that CPU.
If no options exist to target the current CPU then nothing is output.
.Pp
In the event of the CPU not being recognised, a warning is sent to stderr.
.Pp
If
.Pa cc_pathname
is not specified it defaults to the first
.Pa cc
found in the path.
.Sh ENVIRONMENT
The BSD makefile fragment
.Pa @PREFIX@/share/mk/cpuflags.mk
will set the following
.Xr make 1
variables, plus add CPU_FLAGS and CPU_DIR to .MAKEFLAGS for sub-makes.
.Pp
.Bl -tag -width CPU_FLAGS -compact
.It CPU_FLAGS
The output of cpuflags
.It CPU_DIR
CPU_FLAGS with spaces stripped (eg: for use in PACKAGES)
.It CFLAGS
Has CPU_FLAGS appended
.It CXXFLAGS
Has CPU_FLAGS appended
.El
.Sh FILES
.Bl -tag -width @PREFIX@/share/mk/optimize_gcc.mk -compact
.It @PREFIX@/share/mk/cpuflags.mk
Set appropriate compiler flags based on the output from
.Nm .
Suitable for inclusion in /etc/mk.conf
.It @PREFIX@/share/mk/optimize_gcc.mk
Attempt to set additional -mXXX gcc flags based on gcc version and packages
being compiled.
Note: This is experimental and not supported.
.El
.Sh EXAMPLES
.Nm
can be used to set default flags for building entries from pkgsrc
and recompiling the
.Nx
kernel or userland by adding the following to
.Pa /etc/mk.conf :
.Bd -literal -offset indent
.sinclude "@PREFIX@/share/mk/cpuflags.mk"
.Ed
.Pp
To experiment with optimisations that can break generated code there is
optimize_gcc.mk.
This is unsupported, but for full effect add the following to
.Pa /etc/mk.conf :
.Bd -literal -offset indent
.sinclude "@PREFIX@/share/mk/cpuflags.mk"
.sinclude "@PREFIX@/share/mk/optimize_gcc.mk"
.Ed
.Pp
On all except low memory machines compilation can be speeded up by adding the
following to /etc/mk.conf.
(Note this will not affect the binaries produced)
.Bd -literal -offset indent
COPTS?= -pipe ${DEFCOPTS}
CFLAGS+=-pipe
.Ed
.Sh BUGS
.Nm
still needs to learn about more CPU types - updates welcomed
to
.Aq abs@NetBSD.org .
Also the Makefile fragments and examples are BSD make
specific - gmake examples welcomed.
.Pp
Currently
.Nm
is also gcc specific.
.Sh NOTES
.Nm
is based on input from many sources.
I would like to thank them all, in particular Yakovetsky Vladimir.

View File

@@ -0,0 +1,53 @@
# $Id: cpuflags.mk,v 1.20 2009/01/28 23:30:50 abs Exp $
# Makefile include fragment to simplify use of cpuflags in pkgsrc
# abs@absd.org - freely distributable, no warrenties, stick no bills.
# Try to optimise based on CPU
# Does not affect any package that overrides CFLAGS/CXXFLAGS/CCOPTIONS
# Sets five variables:
#
# CPU_FLAGS The output of cpuflags
# CFLAGS Has CPU_FLAGS appended
# CXXFLAGS Has CPU_FLAGS appended
#
# CPU_DIR CPU_FLAGS with spaces stripped (eg: for use in PACKAGES)
.ifndef CPU_FLAGS
. if exists(${.PARSEDIR}/cpuflags.sh)
_CPUFLAGS_SH=${SH} ${.PARSEDIR}/cpuflags.sh
. else
_CPUFLAGS_SH=@PREFIX@/bin/cpuflags
. endif
. if defined(CCPATH)
CPU_FLAGS!=${_CPUFLAGS_SH} ${CCPATH}
. elif defined(BSD_PKG_MK) || ${USETOOLS:Uyes} == "no"
CPU_FLAGS!=${_CPUFLAGS_SH} ${CC}
. else
CPU_FLAGS!=${_CPUFLAGS_SH}
. endif
_CPUFLAGS_SH=
.endif # CPU_FLAGS
.ifndef CPU_DIR
CPU_DIR!=echo ${CPU_FLAGS} | sed 's/ //g'
.endif
.if !defined(MAKEFLAGS) || empty(MAKEFLAGS:MCPU_FLAGS)
MAKEFLAGS+=CPU_FLAGS=${CPU_FLAGS:Q} CPU_DIR=${CPU_DIR:Q} # For sub makes
.endif
.ifdef BSD_PKG_MK # Try to catch various package opts
CFLAGS+=${CPU_FLAGS}
CXXFLAGS+=${CPU_FLAGS}
MAKE_FLAGS+=CCOPTIONS="${CPU_FLAGS}" # Override CCOPTIONS for imake
.elif !defined(IMAGESIZE) && ${DBG} != "-Os"
# Assume in base system & not building space optimised distrib, set COPTS
COPTS?=${CPU_FLAGS} ${DEFCOPTS}
# Include ${DEFCOPTS} and set ?= to allow overriding in kernel builds
.endif

104
devel/cpuflags/files/cpuflags.sh Executable file
View File

@@ -0,0 +1,104 @@
#!@@SH@@
# $NetBSD: cpuflags.sh,v 1.7 2009/01/28 23:30:50 abs Exp $
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
# cd to the directory containing the binary, so we can usefully check for
# include files from there
case "$0" in
/*) cd $(dirname $0);;
*) cd $(dirname $PWD/$0);;
esac
include()
{
file=$1
if [ -f ./$file ] ; then
file=./$file
else
file=@PREFIX@/share/cpuflags/$file
fi
verbose . $file
. $file
}
verbose()
{
[ -n "$opt_v" ] && echo $* >&2
return 0
}
UNAME=$(uname)
if [ "$1" = -v ] ; then
shift
opt_v=1
fi
if [ -n "$1" ]; then
CC=$1
else
CC=gcc
fi
# Each UNAME subr_ file is expected to set AWK & SED, and to provide the
# following methods:
# extract_hw_details: Must be called before determine_arch/determine_features
# determine_arch: Returns cpu arch
# determine_features: Returns cpu features
# display_hw_details: Human readable output for current machine
#
include subr_${UNAME}
# This provides gcc_ser(), gcc_ver() and gcc_fixup_arch_flags()
#
include subr_gcc
# native arch
M_ARCH_NATIVE='-march=native'
# Determine the flags for this OS/machine
extract_hw_details
if [ $(gcc_ser $CC) -gt 4002 ] ; then
ARCH="$M_ARCH_NATIVE"
else
ARCH=$(determine_arch)
fi
FEATURES=$(determine_features)
test "x$ARCH" != "x$M_ARCH_NATIVE" && # gcc have not autodetection
case "$hw_machine_arch" in # all known x86 mnemonics
i386|i486|i586|i686|x86_64|amd64|i86pc)
include subr_x86 # this provides flags_fixup_x86arch()
l_arch=$(flags_fixup_x86arch "$ARCH" "$FEATURES")
test -n "$l_arch" && ARCH="-march=$l_arch"
esac
# Fixup any flags which are too new for our gcc version
#
CPUFLAGS=$(gcc_fixup_arch_flags $CC $ARCH $FEATURES)
CPUFLAGS=$(echo $CPUFLAGS)
if [ -n "$opt_v" ] ; then
if [ -n "$NOARCH" ] ; then
ARCH="No flags for this architecture"
fi
if [ -z "$ARCH" ]; then
ARCH=Unknown
fi
cat <<END
ARCH : $ARCH
FEATURES : $FEATURES
CPUFLAGS : $CPUFLAGS
GCC version : $(gcc_ver $CC)
END
display_hw_details
exit;
fi
if [ -z "$ARCH" -a -z "$NOARCH" ] ; then
echo 'Unknown machine - please send cpuflags details to abs@absd.org' >&2
display_hw_details >&2
fi
echo $CPUFLAGS
exit 0

View File

@@ -0,0 +1,82 @@
# $Id: optimize_gcc.mk,v 1.36 2009/04/21 16:47:48 tnn Exp $
# This file is 'experimental' - which is doublespeak for unspeakably
# ugly, and quite broken by design.
#
# The intention is to pass additional flags to gcc to further optimise
# generated code. It _will_ make it impossible to debug, may fail to
# compile some code, and even generate curdled binaries. It is completely
# unsupported. Any questions should be directed to <abs@absd.org>.
.ifdef BSD_PKG_MK # Try to catch various package opts
# -----------------------------------------------------------------------------
# Per package exclusions
# firefox-1: v1.0, NetBSD i386/2.0
PKG_EXCLUDE_OMIT_FRAME_POINTER+=www/firefox
PKG_EXCLUDE_FAST_MATH+=www/firefox
# seamonkey-1.0.5: gcc-4.1.2 NetBSD 4.99.3 i386
PKG_EXCLUDE_OMIT_FRAME_POINTER+=www/seamonkey www/seamonkey-gtk1
PKG_EXCLUDE_OMIT_FRAME_POINTER+=mail/thunderbird mail/thunderbird-gtk1
PKG_EXCLUDE_OMIT_FRAME_POINTER+=mail/thunderbird15 mail/thunderbird15-gtk1
PKG_EXCLUDE_OMIT_FRAME_POINTER+=lang/lua
PKG_EXCLUDE_OMIT_FRAME_POINTER+=lang/ruby18-base # NetBSD i386/3.0
# perl5: '49/49!=1 in test'
PKG_EXCLUDE_FAST_MATH+=lang/perl5
PKG_EXCLUDE_INLINE_FUNCTIONS+=emulators/qemu net/userppp multimedia/vlc
# binutils-2.17: Linux 2.6.21.5 i686, gcc-4.1.3
PKG_EXCLUDE_INLINE_FUNCTIONS+=cross/binutils devel/binutils
# procmail-3.22: debian_linux-2.6.21.5/gcc-4.1.3, gcc-4.1.2 NetBSD 4.0_BETA2
PKG_EXCLUDE_INLINE_FUNCTIONS+=mail/procmail
# aspell-0.60.5: gcc-4.1.2 NetBSD 4.0_BETA2 i386
PKG_EXCLUDE_INLINE_FUNCTIONS+=textproc/aspell
# gcc3.3.3 NetBSD i386/3.0 breaks kde3
PKG_EXCLUDE_FAST_MATH+=x11/qt3-libs
# gcc4.1.3 NetBSD i386/4.99.29 breaks liboil
PKG_EXCLUDE_OMIT_FRAME_POINTER+=devel/liboil
# -----------------------------------------------------------------------------
# Assign default flags, then remove values based on settings above
#
COPT_FLAGS=-finline-functions -fomit-frame-pointer -ffast-math
.if !empty(PKG_EXCLUDE_OMIT_FRAME_POINTER:M${PKGPATH})
COPT_FLAGS:= ${COPT_FLAGS:S/-fomit-frame-pointer//}
.endif
.if !empty(PKG_EXCLUDE_INLINE_FUNCTIONS:M${PKGPATH})
COPT_FLAGS:= ${COPT_FLAGS:S/-finline-functions//}
.endif
.if !empty(PKG_EXCLUDE_FAST_MATH:M${PKGPATH})
COPT_FLAGS:= ${COPT_FLAGS:S/-ffast-math//}
.endif
CFLAGS+=${COPT_FLAGS}
CXXFLAGS+=${COPT_FLAGS}
MAKE_FLAGS+=CCOPTIONS="${COPT_FLAGS}" # Override CCOPTIONS for imake
.else # (BSD_PKG_MK) Assume in NetBSD base system, only COPTS
.if ${USETOOLS:Uyes} == "no"
COPT_FLAGS+=-fomit-frame-pointer
# Include ${DEFCOPTS} and set ?= to allow overriding in kernel builds
.if !defined(COPTS)
COPTS=${DEFCOPTS} ${COPT_FLAGS}
.else
COPTS+=${COPT_FLAGS}
.endif
.endif
.endif

View File

@@ -0,0 +1,70 @@
# $NetBSD: subr_Darwin,v 1.1 2010/12/05 11:19:39 abs Exp $
AWK=awk
SED=sed
display_hw_details()
{
cat <<END
OS : '$(uname)'
OS version : '$(uname -r)'
hw.model : '$hw_model'
hw.machine : '$hw_machine'
hw.machine_arch : '$hw_machine_arch'
CPU : '$cpu'
END
echo "$cpu_details"
}
extract_hw_details()
{
hw_model=$(sysctl -n hw.model | $SED 's/^ *//')
hw_machine=$(sysctl -n hw.machine)
hw_machine_arch=$(uname -p)
cpu_details=$(hostinfo| $AWK '/^Processor type:/{print $3}')
# We're almost certainly crosscompiling
if [ -n "$MACHINE" -a "$hw_machine" != "$MACHINE" ]; then
echo
exit
fi
}
determine_arch()
{
ARCH=
case $hw_machine_arch in
powerpc) case $cpu_details in # Examples
ppc7450) ARCH='-mcpu=7450' ;; #
ppc750) ARCH='-mcpu=750' ;; # Beige G3
ppc970) ARCH='-mcpu=970' ;; #
esac ;;
esac
echo $ARCH
}
determine_features()
{
FEATURES=
case $hw_machine_arch in
i386 | x86_64)
if [ -n "$cpu_feature_SSE3" ] ; then
FEATURES="-mfpmath=sse -msse3"
elif [ -n "$cpu_feature_SSE2" ] ; then
FEATURES="-mfpmath=sse -msse2"
elif [ -n "$cpu_feature_SSE" ] ; then
FEATURES="-mfpmath=sse -msse"
fi
;;
m68k)
case "$(egrep '^fpu0 ' /var/run/dmesg.boot)" in
*\(emulator\)*) FEATURES="-msoft-float" ;;
*\(no\ math\ support\)*) FEATURES="-msoft-float" ;;
esac
;;
esac
echo $FEATURES
}

View File

@@ -0,0 +1,81 @@
# $NetBSD: subr_FreeBSD,v 1.4 2010/12/05 11:19:39 abs Exp $
AWK=awk
SED=sed
display_hw_details()
{
cat <<END
OS : '$(uname)'
hw.model : '$hw_model'
hw.machine : '$hw_machine'
hw.machine_arch : '$hw_machine_arch'
cpu details :
END
$SED -n '/^CPU:/{N;N;N;N;N;N;N;s/\n[^ ].*//g;/\n /p;}' \
/var/run/dmesg.boot 2>/dev/null
}
extract_hw_details()
{
hw_model=$(sysctl -n hw.model | $SED 's/(R)//g;s/([tT][mM])//g')
hw_machine=$(sysctl -n hw.machine)
hw_machine_arch=$(sysctl -n hw.machine_arch)
# We're almost certainly crosscompiling
if [ -n "$MACHINE" -a "$hw_machine" != "$MACHINE" ]; then
echo
exit
fi
}
determine_arch()
{
ARCH=
# When adding $hw_model tests use maximum context (such as trailing space)
case $hw_machine_arch in
i386) case $hw_model in
Pentium\ II*) ARCH='-march=pentium2' ;;
Intel\ Pentium\ III\ *) ARCH='-march=pentium3' ;;
Intel\ Pentium\ 4\ *) ARCH='-march=pentium4' ;;
Intel\ Core2\ *) ARCH='-march=core2' ;;
AMD\ Athlon\ XP*) ARCH='-march=athlon-xp' ;;
AMD\ Sempron\ Processor\ *) ARCH='-march=athlon-xp' ;;
# last resort:
*386-class*) ARCH='-march=i386' ;;
*486-class*) ARCH='-march=i486' ;;
*586-class*) ARCH='-march=pentium' ;;
*686-class*) ARCH='-march=pentiumpro' ;;
esac ;;
amd64) case $hw_model in
AMD\ Sempron\ Processor\ *) ARCH='-march=athlon64' ;;
esac ;;
esac
echo $ARCH
}
determine_features()
{
FEATURES=
dmesg_features=$(echo $($SED -n \
's/.* Features[0-9]\{0,1\}=0x[0-9a-f]\{1,\}<\(.*\)>$/\1/p' \
/var/run/dmesg.boot 2>/dev/null | $SED 's/,/ /g'))
case $hw_machine_arch in
i386 | amd64) case " $dmesg_features " in
*" SSE3 "*) FEATURES="-mfpmath=sse -msse3" ;;
*" SSE2 "*) FEATURES="-mfpmath=sse -msse2" ;;
*" SSE "*) FEATURES="-mfpmath=sse -msse" ;;
*" MMX "*) FEATURES="-mmmx" ;;
esac
if [ -z "$FEATURES" ]; then # FEATURES empty: jail?
# failover: try sse from sysctl db
if [ "$(sysctl -n hw.instruction_sse 2>/dev/null)" = 1 ]; then
FEATURES="-mfpmath=sse -msse"
fi
fi
esac
echo $FEATURES
}

75
devel/cpuflags/files/subr_Linux Executable file
View File

@@ -0,0 +1,75 @@
# $NetBSD: subr_Linux,v 1.2 2008/12/10 23:27:17 abs Exp $
AWK=awk
SED=sed
display_hw_details()
{
cat <<END
OS : '$(uname)'
proc model : '$hw_model'
machine_arch : '$hw_machine_arch'
proc flag : '$feat_flags'
END
}
extract_hw_details()
{
hw_machine_arch=$(uname -m)
if [ ! -f /proc/cpuinfo ] ; then
echo "Unable to open /proc/cpuinfo"
hw_model=Unknown
else
hw_model=$($AWK -F: '/^model name/{sub(" ","",$2);print $2;exit}' /proc/cpuinfo)
feat_flags=$($AWK -F: '/^flags/{sub(" ","",$2);print $2;exit}' /proc/cpuinfo)
fi
}
determine_arch()
{
ARCH=
case $hw_machine_arch in
parisc) case $hw_model in
"Mirage 100+") ARCH='-march=1.1' ;;
esac ;;
i386) ARCH='-march=i386' ;;
i486) ARCH='-march=i486' ;;
i586) ARCH='-march=pentium' ;;
i686 | x86_64)
include subr_x86 # this provides map_x86_brand_string()
ARCH=$(map_x86_brand_string "$cpu_brand")
if [ -z "$ARCH" ] ; then
case $hw_model in
"AMD Athlon(TM) XP "*) ARCH='-march=athlon-xp' ;;
"AMD Athlon(tm) 64"*) ARCH='-march=athlon64' ;;
"AMD Athlon(tm) XP"*) ARCH='-march=athlon-xp' ;;
"AMD Duron(TM)") ARCH='-march=athlon' ;;
"AMD Duron(tm) ") ARCH='-march=athlon' ;;
"AMD Opteron(tm) Processor "*) ARCH='-march=opteron' ;;
"AMD Sempron(tm) Processor "*) ARCH='-march=athlon-xp' ;;
# Intel PIII & earlier - later Intel handled by map_x86_brand_string
"Celeron (Coppermine)") ARCH='-march=pentium3' ;;
"Pentium II (Deschutes)") ARCH='-march=pentium2' ;;
"Pentium III (Coppermine)") ARCH='-march=pentium3' ;;
"Pentium III (Katmai)") ARCH='-march=pentium3' ;;
esac
fi ;;
esac
echo $ARCH
}
determine_features()
{
FEATURES=
case $hw_machine_arch in
i586|i686|x86_64)
case " $feat_flags " in
*" ssse3 "*) FEATURES='-mfpmath=sse -msse3' ;;
*" sse2 "*) FEATURES='-mfpmath=sse -msse2' ;;
*" sse "*) FEATURES='-mfpmath=sse -msse' ;;
*" mmx "*) FEATURES='-mmmx' ;;
esac ;;
esac
echo $FEATURES
}

244
devel/cpuflags/files/subr_NetBSD Executable file
View File

@@ -0,0 +1,244 @@
# $NetBSD: subr_NetBSD,v 1.12 2010/12/05 11:19:39 abs Exp $
AWK=awk
SED=sed
display_hw_details()
{
cat <<END
OS : '$(uname)'
OS version : '$(uname -r)'
hw.model : '$hw_model'
hw.machine : '$hw_machine'
hw.machine_arch : '$hw_machine_arch'
CPU : '$cpu'
END
extract_x86_cpu_vars
echo "$cpu_details"
}
extract_hw_details()
{
hw_model=$(sysctl -n hw.model | $SED 's/^ *//')
hw_machine=$(sysctl -n hw.machine)
hw_machine_arch=$(sysctl -n hw.machine_arch)
if [ "$hw_machine_arch" = i386 -o "$hw_machine_arch" = x86_64 ] ; then
if [ -x /usr/sbin/cpuctl ] ; then
cpu_details="$(cpuctl identify 0 | grep ^cpu0:)"
else
cpu_details="$(grep ^cpu0: /var/run/dmesg.boot)"
fi
eval "$(extract_x86_cpu_vars)"
fi
# We're almost certainly crosscompiling
if [ -n "$MACHINE" -a "$hw_machine" != "$MACHINE" ]; then
echo
exit
fi
}
extract_x86_cpu_vars()
{
# Set: cpu_feature_FOO=1 for each 'FOO' feature reported
# cpu_name="NAME" taken from the first cpu0: line
# cpu_brand="BRAND" the CPU branding string
echo "$cpu_details" | $AWK '
{ if (/cpu0:/ && !n) { sub("cpu0: ",""); n=1; print "cpu_name=\""$0"\"" } }
/cpu0: ".*"/ { sub("[^\"]*", ""); print "cpu_brand="$0 }
/cpu0: features/ {
sub(".*<","");
sub(">.*","");
gsub("[^,A-Z0-9]","_");
split($0, features, /,/)
for (f in features)
print "cpu_feature_"features[f]"=1";
}
/cpu0: family/ {
for (i = 2; i < NF; i = i + 2) {
f=$(i+1);
sub(/^0/, "", f);
print "cpu_"$i"="f
}
}
'
}
determine_arch()
{
ARCH=
# When adding $hw_model tests use maximum context (such as trailing space)
case $hw_machine_arch in
alpha)
# cpu0 at mainbus0: ID 0 (primary), 21164A-0 (unknown ...
case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in
*[\(\ ]2106[46][-A\ \)]*) ARCH="-mcpu=21064" ;;
*[\(\ ]21164[-\ \)]*) ARCH="-mcpu=21164" ;;
*[\(\ ]21164A[-\ \)]*) ARCH="-mcpu=21164a" ;;
*[\(\ ]21264[-\ \)]*) ARCH="-mcpu=21264" ;;
*[\(\ ]21264[AB][-\ \)]*) ARCH="-mcpu=21264a" ;;
*\ PCA56-2) ARCH="-mcpu=21164pc" ;;
esac
;;
arm | arm32) case $hw_model in
ARM610*) ARCH="-mcpu=arm610" ;; # risc pc
ARM710*) ARCH="-mcpu=arm710" ;; # risc pc
i80321\ *) ARCH="-mcpu=xscale" ;; # iyonix
SA-110*)
case $hw_machine in # arm32 split post 1.5
cats|shark|hpcarm|netwinder)
ARCH="-mcpu=strongarm110" ;;
acorn32)
ARCH="-march=armv3m -mtune=strongarm" ;;
*)
# memorybus in strongarm risc pc machines cannot support
# certain strongarm instructions, but in 1.5 and earlier
# all strongarm machines are 'arm32', so uname and sysctl
# no use
if egrep -q 'ofbus0|footbridge0' /var/run/dmesg.boot \
2>/dev/null ; then
ARCH="-mcpu=strongarm110" # shark/cats
else
ARCH="-march=armv3m -mtune=strongarm" # risc pc
fi
esac ;;
esac ;;
hppa)
case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in
*\ PA7100\ *) ARCH="-march=1.1 -mschedule=7100" ;; # untested
*\ PA7150\ *) ARCH="-march=1.1 -mschedule=7100" ;; # untested
*\ PA7100LC\ *) ARCH="-march=1.1 -mschedule=7100LC" ;; # untested
*\ PA7200\ *) ARCH="-march=1.1 -mschedule=7200" ;; # untested
*\ PA7300LC\ *) ARCH="-march=1.1 -mschedule=7300" ;; # B180L
*\ PA8*) ARCH="-march=2.0 -mschedule=8000" ;; # untested
esac
;;
i386 | x86_64)
include subr_x86 # this provides map_x86_brand_string()
ARCH=$(map_x86_brand_string)
if [ -z "$ARCH" ] ; then
case "$cpu_name" in
'AMD Athlon 64 X2 (686-class)'*) ARCH='-march=athlon64' ;;
'AMD Athlon 64 or Athlon 64 FX or Opteron '*) ARCH='-march=opteron' ;;
'AMD Athlon 64 or Sempron (686-class)'*) ARCH='-march=athlon64' ;;
'AMD Athlon Model 4 (Thunderbird) '*) ARCH='-march=athlon-tbird' ;;
'AMD Dual-Core Opteron or Athlon 64 X2 '*) ARCH='-march=opteron' ;;
'AMD Family 10h (686-class)'*) ARCH='-march=amdfam10' ;;
'AMD K6-2 (586-class)'*) ARCH="-march=k6-2" ;;
# Intel PIII & earlier - later Intel handled by map_x86_brand_string
'Intel (686-class)'*) ARCH='-march=pentiumpro' ;;
'Intel Pentium II (686-class)'*) ARCH='-march=pentium2' ;;
'Intel Pentium III (686-class)'*) ARCH='-march=pentium3' ;;
'Intel Pentium III (Katmai) (686-class)'*) ARCH='-march=pentium3' ;;
'Intel Pentium III Xeon (686-class)'*) ARCH='-march=pentium3' ;;
# Fallback classes
*'(586-class)'*) ARCH='-march=pentium' ;;
*'(486-class)'*) ARCH='-march=i486' ;;
esac
fi
;;
m68k) case $hw_model in # Examples
*\(68020*|*\ MC68020\ *) ARCH='-m68020' ;; # Untested
*\(68030*|*\ MC68030\ *) ARCH='-m68030' ;; # Mac LC III
*\(68040*|*\ MC68040\ *) ARCH='-m68040' ;; # Untested
*\(68060*|*\ MC68060\ *) ARCH='-m68060' ;; # Upgraded amiga 3000
esac
;;
mipseb|mipsel)
# cpu0 at mainbus0: QED R4600 Orion CPU (0x2020) Rev. 2.0 with ...
case $hw_model in
Infineon\ ADM5120) ARCH='-march=4kc' ;;
*)
case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in
*\ MIPS\ R2000\ *) ARCH="-march=r2000" ;;
*\ MIPS\ R3000\ *) ARCH="-march=r3000" ;;
*\ MIPS\ R3000A\ *) ARCH="-march=r3000" ;;
*\ Toshiba\ TX3912\ *) ARCH="-march=r3900" ;;
*\ Toshiba\ TX392[27]\ *) ARCH="-march=r3900" ;;
*\ MIPS\ R4000\ *) ARCH="-mtune=r4000 -mips2" ;; # mips3
*\ MIPS\ R4400\ *) ARCH="-mtune=r4400 -mips2" ;; # mips3
*\ NEC\ VR4100\ *) ARCH="-mtune=r4100 -mips2" ;; # mips3
*\ NEC\ VR4300\ *) ARCH="-mtune=r4300 -mips2" ;; # mips3
*\ QED\ R4600\ *) ARCH="-mtune=r4600 -mips2" ;; # mips3
*\ MIPS\ R5000\ *) ARCH="-mtune=r5000 -mips2" ;; # mips4
*\ QED\ RM5200\ *) ARCH="-mtune=r5000 -mips2" ;; # mips4
*\ MIPS\ R6000\ *) ARCH="-mtune=r6000 -mips2" ;;
*\ MIPS\ R8000\ *) ARCH="-mtune=r8000 -mips2" ;; # mips4
*\ MIPS\ R10000\ *) ARCH="-march=mips4 -mabi=32" ;; # mips4
esac ;;
esac
;;
powerpc) case $hw_model in # Examples
601\ *) ARCH='-mcpu=601' ;; # Untested
602\ *) ARCH='-mcpu=602' ;; # Untested
603\ *) ARCH='-mcpu=603' ;; # Untested
603e\ *|603ev\ *) ARCH='-mcpu=603e' ;; # Umax C500 / PM4400
604\ *) ARCH='-mcpu=604' ;; # Mac 8500
604e\ *) ARCH='-mcpu=604e' ;; # upgr B&W G3
604ev\ *) ARCH='-mcpu=604e' ;; # usually 604e
620\ *) ARCH='-mcpu=620' ;; # Untested
7400\ *) ARCH='-mcpu=7400' ;; # AGP G4/400 Mac
740\ *) ARCH='-mcpu=740' ;; # Untested
7410\ *) ARCH='-mcpu=7400' ;; # powerbook g4
7447A\ *) ARCH='-mcpu=7450' ;; #
7450\ *) ARCH='-mcpu=7450' ;; # tibook 550
750\ *) ARCH='-mcpu=750' ;; # orig. iBook
esac ;;
sparc | sparc64) case " $hw_model" in # Examples
*[\ \(]MB86900/1A*) ARCH='-mcpu=cypress' ;; # ss1+
*[\ \(]L64811*) ARCH='-mcpu=cypress' ;; # sun4/sun4c
*[\ \(]CY7C601*) ARCH='-mcpu=cypress' ;; # ss2
*[\ \(]W8601/8701*) ARCH='-mcpu=cypress' ;; # elc
*[\ \(]MB86904*) ARCH='-mcpu=supersparc' ;; # ss5 usparc
*[\ \(]MB86907*) ARCH='-mcpu=supersparc' ;; # ss5 usparc
*[\ \(]TMS390S10*) ARCH='-mcpu=supersparc' ;; # classic "
*[\ \(]TMS390Z50*) ARCH='-mcpu=supersparc' ;; # ss10/ss20
*[\ \(]RT620/625*) ARCH='-mcpu=hypersparc' ;; # ss20 ross
*[\ \(]MB86930*) ARCH='-mcpu=sparclite' ;; # from gcc
*[\ \(]MB86934*) ARCH='-mcpu=sparclite' ;; # from gcc
# under 1.5.1 -mcpu=ultrasparc chokes egcs-2.91.66 compiling perl
*[\ \(]SUNW,UltraSPARC*) ARCH='-mcpu=v9' ;; # Ultra
esac ;;
vax) # No VAX specific gcc optimisations available
NOARCH=1
;;
esac
echo $ARCH
}
determine_features()
{
FEATURES=
case $hw_machine_arch in
i386 | x86_64)
if [ -n "$cpu_feature_SSE3" ] ; then
FEATURES="-mfpmath=sse -msse3"
elif [ -n "$cpu_feature_SSE2" ] ; then
FEATURES="-mfpmath=sse -msse2"
elif [ -n "$cpu_feature_SSE" ] ; then
FEATURES="-mfpmath=sse -msse"
fi
;;
m68k)
case "$(egrep '^fpu0 ' /var/run/dmesg.boot)" in
*\(emulator\)*) FEATURES="-msoft-float" ;;
*\(no\ math\ support\)*) FEATURES="-msoft-float" ;;
esac
;;
esac
echo $FEATURES
}

45
devel/cpuflags/files/subr_SunOS Executable file
View File

@@ -0,0 +1,45 @@
# $NetBSD: subr_SunOS,v 1.5 2009/03/04 00:32:44 abs Exp $
AWK=nawk
SED=sed
display_hw_details()
{
cat <<END
OS : '$(uname)'
arch : '$hw_arch'
psrinfo : '$hw_psrinfo'
END
}
extract_hw_details()
{
hw_arch=$(/usr/bin/uname -m)
# Just gets the first CPU
hw_psrinfo=$(psrinfo -pv | $AWK 'NR==3{sub(" *","");print}')
}
determine_arch()
{
ARCH=
case $hw_arch in
sun4c | sun4 ) ARCH='-mcpu=cypress' ;;
sun4m ) ARCH='-mcpu=supersparc' ;;
sun4u ) ARCH='-mcpu=v9' ;;
i86pc )
include subr_x86 # this provides map_x86_brand_string()
ARCH=$(map_x86_brand_string "$cpu_brand")
if [ -z "$ARCH" ] ; then
case "$hw_psrinfo" in
*)
esac
fi
;;
esac
echo $ARCH
}
determine_features()
{
echo
}

View File

@@ -0,0 +1,120 @@
# $NetBSD: subr_gcc,v 1.6 2009/01/12 22:11:58 abs Exp $
# Return gcc version string
gcc_ver()
{
gcc=$1
${gcc} -dumpversion | $SED -e 's/^[^0-9\.]\{1,\}//' -e 's/[^0-9\.]\{1,\}$//'
}
gcc_ser()
{
gcc=$1
gcc_ver $gcc | $AWK -F. '{ print ($1*1000+$2)}'
}
gcc_fixup_arch_flags()
{
gcc=$1
shift
gcc_arch_flags="$*"
# Fixup options for older gccs.
# Entries can be recursive - eg:
# -march=k6-3 -> -march=k6 -> -march=pentium -> -march=i486
#
# The format of table is
# gcc_version_in_which_option_was_introduced : new_option : old_option
$AWK -F: -v "flags=$gcc_arch_flags" -v "gcc_ver=$(gcc_ver $gcc)" '
{ if (gcc_ver < $1) { map[$2] = ""$3 } }
END {
FS=" "; split(flags, flaglist);
for (af in flaglist) {
flag = flaglist[af];
while (flag in map) {
flag = map[flag]
}
print flag
}
}
' <<EOD
2.90:-march=i386:-mno-486
2.90:-march=i486:-m486
2.90:-march=pentium:-m486
2.90:-march=pentiumpro:-m486
2.90:-mcpu=21164a:
2.90:-mcpu=arm610:-m6
2.90:-mcpu=arm710:-m6
2.90:-mcpu=cypress:-mcypress
2.90:-mcpu=sparclite:-msparclite
2.90:-mcpu=strongarm110:-m6
2.90:-mcpu=supersparc:-msupersparc
2.90:-mcpu=v9:-mv8
2.95:-march=k6:-march=pentium
3.0:-march=athlon:-march=pentiumpro
3.1:-march=athlon-4:-march=athlon
3.1:-march=athlon-mp:-march=athlon
3.1:-march=athlon-tbird:-march=athlon
3.1:-march=athlon-xp:-march=athlon
3.1:-march=k6-2:-march=k6
3.1:-march=k6-3:-march=k6
3.1:-march=pentium-mmx:-march=pentium
3.1:-march=pentium2:-march=pentiumpro
3.1:-march=pentium3 -mno-sse:-march=pentiumpro
3.1:-march=pentium3:-march=pentiumpro
3.1:-march=pentium4:-march=pentiumpro
3.1:-march=r2000:-cpu=r2000
3.1:-march=r3000:-cpu=r3000
3.1:-march=r3900:-cpu=r3900
3.1:-march=r4000:-cpu=r4000
3.1:-march=r4100:-cpu=r4100
3.1:-march=r4300:-cpu=r4300
3.1:-march=r4400:-cpu=r4400
3.1:-march=r4600:-cpu=r4600
3.1:-march=r5000:-cpu=r5000
3.1:-march=r6000:-cpu=r6000
3.1:-march=r8000:-cpu=r8000
3.1:-mcpu=21264a:-mcpu=21264
3.1:-mcpu=7400:-mcpu=750
3.1:-mcpu=7450:-mcpu=750
3.1:-mfpmath=sse:
3.1:-mmmx:
3.1:-msse2:
3.1:-msse:
3.1:-mtune=r2000:-cpu=r2000
3.1:-mtune=r3000:-cpu=r3000
3.1:-mtune=r3900:-cpu=r3900
3.1:-mtune=r4000:-cpu=r4000
3.1:-mtune=r4100:-cpu=r4100
3.1:-mtune=r4300:-cpu=r4300
3.1:-mtune=r4400:-cpu=r4400
3.1:-mtune=r4600:-cpu=r4600
3.1:-mtune=r5000:-cpu=r5000
3.1:-mtune=r6000:-cpu=r6000
3.1:-mtune=r8000:-cpu=r8000
3.3:-march=c3:-march=i586
3.3:-march=winchip-c6:-march=i586
3.3:-march=winchip2:-march=i586
3.4:-march=athlon-fx:-march=athlon-xp
3.4:-march=athlon64:-march=athlon-xp
3.4:-march=c3-2:-march=c3
3.4:-march=k8:-march=athlon-xp
3.4:-march=nocona:-march=pentium4
3.4:-march=opteron:-march=athlon-xp
3.4:-march=pentium-m:-march=pentium3
3.4:-march=pentium3m:-march=pentium3
3.4:-march=pentium4m:-march=pentium4
3.4:-march=prescott:-march=pentium4
3.4:-msse3:
4.2:-m3dnow:
4.2:-march=native:
4.3:-march=amdfam10:-march=athlon64
4.3:-march=athlon64-sse3:-march=athlon64
4.3:-march=barcelona:-march=athlon64
4.3:-march=core2:-march=nocona
4.3:-march=geode:-march=k6-3
4.3:-march=k8-sse3:-march=k8
4.3:-march=opteron-sse3:-march=opteron
EOD
}

View File

@@ -0,0 +1,131 @@
# $NetBSD: subr_x86,v 1.13 2009/03/30 21:02:25 abs Exp $
# Apparently the only way to reliably determine the architecture of a recent
# Intel CPU is to use the cpu brand string - as they reused family and
# extended family bitflags... annoying
# Even better, they appear to have reused brand strings between Northwood
# and Prescott pentium4s. Thats just... special.
# AMD, in contrast decided to keep things simple:
# (thanks to Christoph Egger for this list)
# Family 0x6: AMD K7
# Family 0xf: AMD K8
# Family 0x10: AMD Barcelona/Phenom
# Family 0x11: AMD Turion Ultra
map_x86_brand_string()
{
case "$cpu_brand" in
"AMD*")
case "$cpu_family-$cpu_model" in
5-6 | 5-7 ) echo '-march=k6' ;;
5-8 ) echo '-march=k6-2' ;;
5-9 ) echo '-march=k6-3' ;;
6-1 | 6-2 | 6-3 ) echo '-march=athlon' ;;
6-4 | 6-6 | 6-7 | 6-8 | 6-a ) echo '-march=athlon-4' ;;
esac
;;
"VIA Nehemiah"*) echo '-march=c3' ;;
"Genuine Intel(R) CPU T2400"*) echo '-march=core2' ;;
"Genuine Intel(R) CPU T2500"*) echo '-march=core2' ;;
"Intel(R) Atom(TM) CPU "*) echo '-march=core2 -mtune=pentium' ;;#So far
"Intel(R) Celeron(R) CPU E1400"*) echo '-march=core2' ;;
"Intel(R) Celeron(R) CPU 2.40GHz") echo '-march=pentium4' ;;
"Intel(R) Celeron(R) M processor "*) echo '-march=pentium-m' ;;
"Intel(R) Celeron(TM) CPU 1400MHz") echo '-march=pentium3' ;;
"Intel(R) Core 2 "*) echo '-march=core2' ;;
"Intel(R) Core(TM)2 "*) echo '-march=core2' ;;
"Intel(R) Pentium(R) 4 CPU"*)
if [ -n "$cpu_feature_SSE3" ] ; then
echo '-march=prescott'
else
echo '-march=pentium4'
fi ;;
"Intel(R) Pentium(R) M processor "*) echo '-march=pentium-m' ;;
"Intel(R) Xeon(R) CPU 3040"*) echo '-march=core2' ;;
"Intel(R) Xeon(R) CPU 3050"*) echo '-march=core2' ;;
"Intel(R) Xeon(R) CPU E5310"*) echo '-march=core2' ;;
"Intel(r) Xeon(r) CPU E5430"*) echo '-march=core2' ;;
"Pentium(R) Dual-Core CPU E5200"*) echo '-march=core2' ;;
esac
}
flags_fixup_x86arch()
{
arch=$1
features=$2
# Fixup ARCH for x86
#
# The format of table is
# feature:lowend_arch:fix_arch
#
$AWK -v "arch=${arch#-march=}" -v "features=$features" '
BEGIN { split(features,ar); FS=":" }
{ for (af in ar)
{ if ((ar[af] == $1) && (arch == $3)) { print $2; exit;} }
}
' <<EOD
-msse:pentium3:i386
-msse:pentium3:i486
-msse:pentium3:i586
-msse:pentium3:i686
-msse:pentium3:pentium
-msse:pentium3:pentium-mmx
-msse:pentium3:pentiumpro
-msse:pentium3:pentium2
-msse:athlon:k6
-msse:athlon:k6-2
-msse:athlon:k6-3
-msse2:pentium4:i386
-msse2:pentium4:i386
-msse2:pentium4:i486
-msse2:pentium4:i586
-msse2:pentium4:i686
-msse2:pentium4:pentium
-msse2:pentium4:pentium-mmx
-msse2:pentium4:pentiumpro
-msse2:pentium4:pentium2
-msse2:pentium4:pentium3
-msse2:pentium4:pentium3m
-msse2:k8:k6
-msse2:k8:k6-2
-msse2:k8:k6-3
-msse2:k8:athlon
-msse2:k8:athlon-tbird
-msse2:k8:athlon-4
-msse2:k8:athlon-xp
-msse2:k8:athlon-mp
-msse3:prescott:i386
-msse3:prescott:i386
-msse3:prescott:i486
-msse3:prescott:i586
-msse3:prescott:i686
-msse3:prescott:pentium
-msse3:prescott:pentium-mmx
-msse3:prescott:pentiumpro
-msse3:prescott:pentium2
-msse3:prescott:pentium3
-msse3:prescott:pentium3m
-msse3:prescott:pentium-m
-msse3:prescott:pentium4
-msse3:prescott:pentium4m
-msse3:k8:k6
-msse3:k8:k6-2
-msse3:k8:k6-3
-msse3:k8:athlon
-msse3:k8:athlon-tbird
-msse3:k8:athlon-4
-msse3:k8:athlon-xp
-msse3:k8:athlon-mp
-m3dnow:athlon:k6
-m3dnow:athlon:k6-2
-m3dnow:athlon:k6-3
EOD
## in future
#-mssse3:nocona:prescott ...
#-msse4:nehalem:nocona ...
}