3 # Set default baseline values of CPUTYPE based on MACHINE_ARCH -- this is
4 # the minimum CPU type we support for each architecture
6 .if ${MACHINE_ARCH} == "i386"
8 .elif ${MACHINE_ARCH} == "alpha"
10 .elif ${MACHINE_ARCH} == "ia64"
12 .elif ${MACHINE_ARCH} == "sparc64"
16 # Handle aliases (not documented in make.conf to avoid user confusion
17 # between e.g. i586 and pentium)
19 .if ${MACHINE_ARCH} == "i386"
20 . if ${CPUTYPE} == "pentiumpro"
22 . elif ${CPUTYPE} == "pentium"
24 . elif ${CPUTYPE} == "athlon"
29 # Logic to set up correct gcc optimization flag. This must be included
30 # after /etc/make.conf so it can react to the local value of CPUTYPE
31 # defined therein. Consult:
32 # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
33 # http://gcc.gnu.org/onlinedocs/gcc/DEC-Alpha-Options.html
34 # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
35 # http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
37 .if !defined(NO_CPU_CFLAGS) || !defined(NO_CPU_COPTFLAGS)
38 . if ${MACHINE_ARCH} == "i386"
39 . if ${CPUTYPE} == "k7"
40 . if defined(BOOTSTRAPPING)
41 _CPUCFLAGS = -march=k6 # gcc 2.95.x didn't support athlon
43 _CPUCFLAGS = -march=athlon
45 . elif ${CPUTYPE} == "k6-2"
46 _CPUCFLAGS = -march=k6
47 . elif ${CPUTYPE} == "k6"
48 _CPUCFLAGS = -march=k6
49 . elif ${CPUTYPE} == "k5"
50 _CPUCFLAGS = -march=pentium
51 . elif ${CPUTYPE} == "p4"
52 _CPUCFLAGS = -march=pentiumpro
53 . elif ${CPUTYPE} == "p3"
54 _CPUCFLAGS = -march=pentiumpro
55 . elif ${CPUTYPE} == "p2"
56 _CPUCFLAGS = -march=pentiumpro
57 . elif ${CPUTYPE} == "i686"
58 _CPUCFLAGS = -march=pentiumpro
59 . elif ${CPUTYPE} == "i586/mmx"
60 _CPUCFLAGS = -march=pentium-mmx
61 . elif ${CPUTYPE} == "i586"
62 _CPUCFLAGS = -march=pentium
63 . elif ${CPUTYPE} == "i486"
64 _CPUCFLAGS = -march=i486
66 . elif ${MACHINE_ARCH} == "alpha"
67 . if ${CPUTYPE} == "ev6"
68 _CPUCFLAGS = -mcpu=ev6
69 . elif ${CPUTYPE} == "pca56"
70 _CPUCFLAGS = -mcpu=pca56
71 . elif ${CPUTYPE} == "ev56"
72 _CPUCFLAGS = -mcpu=ev56
73 . elif ${CPUTYPE} == "ev5"
74 _CPUCFLAGS = -mcpu=ev5
75 . elif ${CPUTYPE} == "ev45"
76 _CPUCFLAGS = -mcpu=ev4 # No -mcpu=ev45 for gcc
77 . elif ${CPUTYPE} == "ev4"
78 _CPUCFLAGS = -mcpu=ev4
83 # NB: COPTFLAGS is handled in /usr/src/sys/conf/Makefile.<arch>
85 .if !defined(NO_CPU_CFLAGS)
86 CFLAGS += ${_CPUCFLAGS}
89 # Set up the list of CPU features based on the CPU type. This is an
90 # unordered list to make it easy for client makefiles to test for the
91 # presence of a CPU feature.
93 .if ${MACHINE_ARCH} == "i386"
94 . if ${CPUTYPE} == "k7"
95 MACHINE_CPU = k7 3dnow mmx k6 k5 i586 i486 i386
96 . elif ${CPUTYPE} == "k6-2"
97 MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
98 . elif ${CPUTYPE} == "k6"
99 MACHINE_CPU = mmx k6 k5 i586 i486 i386
100 . elif ${CPUTYPE} == "k5"
101 MACHINE_CPU = k5 i586 i486 i386
102 . elif ${CPUTYPE} == "p4"
103 MACHINE_CPU = sse i686 mmx i586 i486 i386
104 . elif ${CPUTYPE} == "p3"
105 MACHINE_CPU = sse i686 mmx i586 i486 i386
106 . elif ${CPUTYPE} == "p2"
107 MACHINE_CPU = i686 mmx i586 i486 i386
108 . elif ${CPUTYPE} == "i686"
109 MACHINE_CPU = i686 i586 i486 i386
110 . elif ${CPUTYPE} == "i586/mmx"
111 MACHINE_CPU = mmx i586 i486 i386
112 . elif ${CPUTYPE} == "i586"
113 MACHINE_CPU = i586 i486 i386
114 . elif ${CPUTYPE} == "i486"
115 MACHINE_CPU = i486 i386
116 . elif ${CPUTYPE} == "i386"
119 .elif ${MACHINE_ARCH} == "alpha"
120 . if ${CPUTYPE} == "ev6"
121 MACHINE_CPU = ev6 ev56 pca56 ev5 ev45 ev4
122 . elif ${CPUTYPE} == "pca56"
123 MACHINE_CPU = pca56 ev56 ev5 ev45 ev4
124 . elif ${CPUTYPE} == "ev56"
125 MACHINE_CPU = ev56 ev5 ev45 ev4
126 . elif ${CPUTYPE} == "ev5"
127 MACHINE_CPU = ev5 ev45 ev4
128 . elif ${CPUTYPE} == "ev45"
129 MACHINE_CPU = ev45 ev4
130 . elif ${CPUTYPE} == "ev4"
133 .elif ${MACHINE_ARCH} == "ia64"
134 . if ${CPUTYPE} == "itanium"
135 MACHINE_CPU = itanium