- Add CPUTYPE support for sparc64. The net result is that it's now possible

to let the compiler optimize for the famility of UltraSPARC-III CPUs as the
  default already was to optimize for UltraSPARC-I/II and generating generic
  64-bit V9 is mainly for reference purposes. At least for SPARC64-V CPUs
  code optimized for UltraSPARC-I/II still is the most performant one.
  Thanks go to Michael Moll for testing SPARC64-V.
- Move a booke MACHINE_CPU bit into the right section.
This commit is contained in:
Marius Strobl 2010-12-30 15:58:23 +00:00
parent b0aecb3d03
commit aab88d9da4
2 changed files with 30 additions and 2 deletions
share
examples/etc
mk

@ -38,6 +38,8 @@
# (Via CPUs) c3 c3-2 # (Via CPUs) c3 c3-2
# AMD64 architecture: opteron, athlon64, nocona, prescott, core2 # AMD64 architecture: opteron, athlon64, nocona, prescott, core2
# Intel ia64 architecture: itanium2, itanium # Intel ia64 architecture: itanium2, itanium
# SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default
# if omitted), ultrasparc3
# #
# (?= allows to buildworld for a different CPUTYPE.) # (?= allows to buildworld for a different CPUTYPE.)
# #

@ -15,6 +15,7 @@ MACHINE_CPU = itanium
. elif ${MACHINE_CPUARCH} == "powerpc" . elif ${MACHINE_CPUARCH} == "powerpc"
MACHINE_CPU = aim MACHINE_CPU = aim
. elif ${MACHINE_CPUARCH} == "sparc64" . elif ${MACHINE_CPUARCH} == "sparc64"
MACHINE_CPU = ultrasparc
. elif ${MACHINE_CPUARCH} == "arm" . elif ${MACHINE_CPUARCH} == "arm"
MACHINE_CPU = arm MACHINE_CPU = arm
. elif ${MACHINE_CPUARCH} == "mips" . elif ${MACHINE_CPUARCH} == "mips"
@ -58,6 +59,12 @@ CPUTYPE = athlon
. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" . if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2"
CPUTYPE = nocona CPUTYPE = nocona
. endif . endif
. elif ${MACHINE_ARCH} == "sparc64"
. if ${CPUTYPE} == "us"
CPUTYPE = ultrasparc
. elif ${CPUTYPE} == "us3"
CPUTYPE = ultrasparc3
. endif
. endif . endif
############################################################################### ###############################################################################
@ -116,7 +123,6 @@ _CPUCFLAGS = -mcpu=${CPUTYPE}
. endif . endif
. elif ${MACHINE_ARCH} == "powerpc" . elif ${MACHINE_ARCH} == "powerpc"
. if ${CPUTYPE} == "e500" . if ${CPUTYPE} == "e500"
MACHINE_CPU = booke
_CPUCFLAGS = -Wa,-me500 -msoft-float _CPUCFLAGS = -Wa,-me500 -msoft-float
. else . else
_CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64 _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64
@ -137,6 +143,14 @@ _CPUCFLAGS = -march=4kc
. elif ${CPUTYPE} == "mips24kc" . elif ${CPUTYPE} == "mips24kc"
_CPUCFLAGS = -march=24kc _CPUCFLAGS = -march=24kc
. endif . endif
. elif ${MACHINE_ARCH} == "sparc64"
. if ${CPUTYPE} == "v9"
_CPUCFLAGS = -mcpu=v9
. elif ${CPUTYPE} == "ultrasparc"
_CPUCFLAGS = -mcpu=ultrasparc
. elif ${CPUTYPE} == "ultrasparc3"
_CPUCFLAGS = -mcpu=ultrasparc3
. endif
. endif . endif
# Set up the list of CPU features based on the CPU type. This is an # Set up the list of CPU features based on the CPU type. This is an
@ -193,10 +207,22 @@ MACHINE_CPU += amd64 sse2 sse mmx
. if ${CPUTYPE} == "itanium" . if ${CPUTYPE} == "itanium"
MACHINE_CPU = itanium MACHINE_CPU = itanium
. endif . endif
. elif ${MACHINE_ARCH} == "powerpc"
. if ${CPUTYPE} == "e500"
MACHINE_CPU = booke
. endif
. elif ${MACHINE_ARCH} == "sparc64"
. if ${CPUTYPE} == "v9"
MACHINE_CPU = v9
. elif ${CPUTYPE} == "ultrasparc"
MACHINE_CPU = v9 ultrasparc
. elif ${CPUTYPE} == "ultrasparc3"
MACHINE_CPU = v9 ultrasparc ultrasparc3
. endif
. endif . endif
.endif .endif
.if ${MACHINE_CPUARCH} == "mips" .if ${MACHINE_CPUARCH} == "mips"
CFLAGS += -G0 CFLAGS += -G0
.endif .endif