Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Sep 2002 18:08:23 -0700
From:      Maxime Henrion <mux@freebsd.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        Peter Wemm <peter@wemm.org>, Darren Pilgrim <dmp@pantherdragon.org>, Matthew Dillon <dillon@apollo.backplane.com>, Dan Nelson <dnelson@allantgroup.com>, Terry Lambert <tlambert2@mindspring.com>, Jason Andresen <jandrese@mitre.org>, Dmitry Morozovsky <marck@rinet.ru>, hackers@FreeBSD.ORG
Subject:   Re: Updating bsd.cpu.mk (Re: -fomit-frame-pointer for the world build)
Message-ID:  <20020907010823.GN86074@elvis.mu.org>
In-Reply-To: <20020907005833.GA84369@xor.obsecurity.org>
References:  <3D50664F.71603B49@pantherdragon.org> <20020807015511.A1A092A7D6@canning.wemm.org> <20020906203026.GA78157@xor.obsecurity.org> <20020907005547.GM86074@elvis.mu.org> <20020907005833.GA84369@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--rQ2U398070+RC21q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Kris Kennaway wrote:
> On Fri, Sep 06, 2002 at 05:55:47PM -0700, Maxime Henrion wrote:
> 
> > I've got a very similar patch which I believe to be a bit more complete
> > because it also updates the MACHINE_CPU variable which lists the
> > features available on a particular CPU.  I attach it to this mail.
> 
> Oops, I forgot that part.  How about sse2 though?

Forgot that one.  Here is an updated patch.  I'm quite sure that on the
Intel side, only the pentium 4 have sse2, but I don't know if any AMD
chip supports it yet.  The attached patch only adds it for p4's.

Cheers,
Maxime

--rQ2U398070+RC21q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cpu.patch"

Index: bsd.cpu.mk
===================================================================
RCS file: /home/ncvs/src/share/mk/bsd.cpu.mk,v
retrieving revision 1.16
diff -u -p -r1.16 bsd.cpu.mk
--- bsd.cpu.mk	2 Aug 2002 18:04:22 -0000	1.16
+++ bsd.cpu.mk	7 Sep 2002 01:05:43 -0000
@@ -28,8 +28,8 @@ CPUTYPE = ultrasparc
 CPUTYPE = i686
 .  elif ${CPUTYPE} == "pentium"
 CPUTYPE = i586
-.  elif ${CPUTYPE} == "athlon"
-CPUTYPE = k7
+.  elif ${CPUTYPE} == "k7"
+CPUTYPE = athlon
 .  endif
 . endif
 
@@ -42,20 +42,30 @@ CPUTYPE = k7
 #	http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
 
 . if ${MACHINE_ARCH} == "i386"
-.  if ${CPUTYPE} == "k7"
+.  if ${CPUTYPE} == "athlon-mp"
+_CPUCFLAGS = -march=athlon-mp
+.  elif ${CPUTYPE} == "athlon-xp"
+_CPUCFLAGS = -march=athlon-xp
+.  elif ${CPUTYPE} == "athlon-4"
+_CPUCFLAGS = -march=athlon-4
+.  elif ${CPUTYPE} == "athlon-tbird"
+_CPUCFLAGS = -march=athlon-tbird
+.  elif ${CPUTYPE} == "athlon"
 _CPUCFLAGS = -march=athlon
+.  elif ${CPUTYPE} == "k6-3"
+_CPUCFLAGS = -march=k6-3
 .  elif ${CPUTYPE} == "k6-2"
-_CPUCFLAGS = -march=k6
+_CPUCFLAGS = -march=k6-2
 .  elif ${CPUTYPE} == "k6"
 _CPUCFLAGS = -march=k6
 .  elif ${CPUTYPE} == "k5"
 _CPUCFLAGS = -march=pentium
 .  elif ${CPUTYPE} == "p4"
-_CPUCFLAGS = -march=pentiumpro
+_CPUCFLAGS = -march=pentium4
 .  elif ${CPUTYPE} == "p3"
-_CPUCFLAGS = -march=pentiumpro
+_CPUCFLAGS = -march=pentium3
 .  elif ${CPUTYPE} == "p2"
-_CPUCFLAGS = -march=pentiumpro
+_CPUCFLAGS = -march=pentium2
 .  elif ${CPUTYPE} == "i686"
 _CPUCFLAGS = -march=pentiumpro
 .  elif ${CPUTYPE} == "i586/mmx"
@@ -93,8 +103,18 @@ CFLAGS += ${_CPUCFLAGS}
 # presence of a CPU feature.
 
 .if ${MACHINE_ARCH} == "i386"
-. if ${CPUTYPE} == "k7"
+. if ${CPUTYPE} == "athlon-mp"
+MACHINE_CPU = sse k7 3dnow mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "athlon-xp"
+MACHINE_CPU = sse k7 3dnow mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "athlon-4"
+MACHINE_CPU = sse k7 3dnow mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "athlon-tbird"
 MACHINE_CPU = k7 3dnow mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "athlon"
+MACHINE_CPU = k7 3dnow mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "k6-3"
+MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
 . elif ${CPUTYPE} == "k6-2"
 MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
 . elif ${CPUTYPE} == "k6"
@@ -102,7 +122,7 @@ MACHINE_CPU = mmx k6 k5 i586 i486 i386
 . elif ${CPUTYPE} == "k5"
 MACHINE_CPU = k5 i586 i486 i386
 . elif ${CPUTYPE} == "p4"
-MACHINE_CPU = sse i686 mmx i586 i486 i386
+MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
 . elif ${CPUTYPE} == "p3"
 MACHINE_CPU = sse i686 mmx i586 i486 i386
 . elif ${CPUTYPE} == "p2"

--rQ2U398070+RC21q--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020907010823.GN86074>