Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Aug 2004 23:52:54 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 60333 for review
Message-ID:  <200408232352.i7NNqs7K098658@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=60333

Change 60333 by peter@peter_daintree on 2004/08/23 23:52:19

	Put on peril senstitive sunglasses and add the two key CPUTYPES for
	the amd64 platform.  Note that there is no minimum common switch.  For
	example, -march=nocona assumes sse3, while -march=k8 assumes ffreep etc.
	Perhaps the default no-CPUTYPE case should be
	"-march=nocona -mno-sse3 -mtune=k8" (since there are several orders of
	magnitude more k8 cores out there right now, but that code should even run
	on all the prescott/noconas out there too.)
	Note that this needs to be done on RELENG_5 too. :-(
	While here, add the i386's prescott/nocona support.  Treat them
	both as prescott since the 64 bit instructions are irrelevant.
	Likewise, alias prescott for nocona for the amd64 side of the fence.

Affected files ...

.. //depot/projects/hammer/share/mk/bsd.cpu.mk#19 edit

Differences ...

==== //depot/projects/hammer/share/mk/bsd.cpu.mk#19 (text+ko) ====

@@ -12,6 +12,7 @@
 _CPUCFLAGS = -mcpu=ev4 -mtune=ev5
 MACHINE_CPU = ev4
 . elif ${MACHINE_ARCH} == "amd64"
+_CPUCFLAGS =
 MACHINE_CPU = amd64 sse2 sse
 . elif ${MACHINE_ARCH} == "ia64"
 _CPUCFLAGS =
@@ -28,7 +29,9 @@
 # between e.g. i586 and pentium)
 
 . if ${MACHINE_ARCH} == "i386"
-.  if ${CPUTYPE} == "pentium4"
+.  if ${CPUTYPE} == "nocona"
+CPUTYPE = prescott
+.  elif ${CPUTYPE} == "pentium4"
 CPUTYPE = p4
 .  elif ${CPUTYPE} == "pentium3"
 CPUTYPE = p3
@@ -43,6 +46,12 @@
 .  elif ${CPUTYPE} == "k7"
 CPUTYPE = athlon
 .  endif
+. elif ${MACHINE_ARCH} == "amd64"
+.  if ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "opteron"
+CPUTYPE = k8
+.  elif ${CPUTYPE} == "prescott"
+CPUTYPE = nocona
+.  endif
 . endif
 
 # Logic to set up correct gcc optimization flag.  This must be included
@@ -71,6 +80,9 @@
 .  elif ${CPUTYPE} == "k5"
 _CPUCFLAGS = -march=pentium
 _ICC_CPUCFLAGS = -tpp5
+.  elif ${CPUTYPE} == "prescott"
+_CPUCFLAGS = -march=prescott
+_ICC_CPUCFLAGS = -tpp7 -xiMKW
 .  elif ${CPUTYPE} == "p4"
 _CPUCFLAGS = -march=pentium4
 _ICC_CPUCFLAGS = -tpp7 -xiMKW
@@ -109,6 +121,12 @@
 .  elif ${CPUTYPE} == "ev4"
 _CPUCFLAGS = -mcpu=ev4
 .  endif
+. elif ${MACHINE_ARCH} == "amd64"
+.  if ${CPUTYPE} == "k8"
+_CPUCFLAGS = -march=k8
+.  elif ${CPUTYPE} == "nocona"
+_CPUCFLAGS = -march=nocona
+.  endif
 . endif
 
 # Set up the list of CPU features based on the CPU type.  This is an
@@ -127,6 +145,8 @@
 MACHINE_CPU = mmx k6 k5 i586 i486 i386
 .  elif ${CPUTYPE} == "k5"
 MACHINE_CPU = k5 i586 i486 i386
+.  elif ${CPUTYPE} == "prescott"
+MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386
 .  elif ${CPUTYPE} == "p4"
 MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
 .  elif ${CPUTYPE} == "p3"
@@ -159,7 +179,13 @@
 MACHINE_CPU = ev4
 .  endif
 . elif ${MACHINE_ARCH} == "amd64"
-MACHINE_CPU = amd64 sse2 sse
+.  if ${CPUTYPE} == "k8"
+MACHINE_CPU = amd64 3dnow sse2 sse i686 mmx i586 i486 i386
+.  elif ${CPUTYPE} == "nocona"
+MACHINE_CPU = amd64 sse3 sse2 sse i686 mmx i586 i486 i386
+.  else
+MACHINE_CPU = amd64 sse2 sse i686 mmx i586 i486 i386
+.  endif
 . elif ${MACHINE_ARCH} == "ia64"
 .  if ${CPUTYPE} == "itanium"
 MACHINE_CPU = itanium



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