From owner-p4-projects@FreeBSD.ORG Mon Aug 23 23:52:56 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BBF5716A4D0; Mon, 23 Aug 2004 23:52:55 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 656D416A4CE for ; Mon, 23 Aug 2004 23:52:55 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3DD8143D70 for ; Mon, 23 Aug 2004 23:52:55 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i7NNqtp2098661 for ; Mon, 23 Aug 2004 23:52:55 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i7NNqs7K098658 for perforce@freebsd.org; Mon, 23 Aug 2004 23:52:54 GMT (envelope-from peter@freebsd.org) Date: Mon, 23 Aug 2004 23:52:54 GMT Message-Id: <200408232352.i7NNqs7K098658@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 60333 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2004 23:52:56 -0000 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