1 # Set default CPU compile flags and baseline CPUTYPE for each arch. The
2 # compile flags must support the minimum CPU type for each architecture but
3 # may tune support for more advanced processors.
5 .if !defined(CPUTYPE) || empty(CPUTYPE)
6 . if ${MACHINE_ARCH} == "i386"
8 . elif ${MACHINE_ARCH} == "amd64"
13 # Handle aliases (not documented in make.conf to avoid user confusion
14 # between e.g. i586 and pentium)
16 .if ${CPUTYPE} == "core"
18 .elif ${CPUTYPE} == "p4"
20 .elif ${CPUTYPE} == "p4m"
22 .elif ${CPUTYPE} == "p3"
24 .elif ${CPUTYPE} == "p3m"
26 .elif ${CPUTYPE} == "p-m"
28 .elif ${CPUTYPE} == "p2"
30 .elif ${CPUTYPE} == "i586/mmx"
32 .elif ${CPUTYPE} == "i586"
34 .elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "k8"
36 .elif ${CPUTYPE} == "k7"
40 ###############################################################################
41 # Logic to set up correct gcc optimization flag. This must be included
42 # after /etc/make.conf so it can react to the local value of CPUTYPE
43 # defined therein. Consult:
44 # http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
45 # http://gcc.gnu.org/onlinedocs/gcc/IA-64-Options.html
46 # http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
47 # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
48 # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
50 .if ${MACHINE_ARCH} == "i386"
51 . if ${CPUTYPE} == "crusoe"
52 _CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
53 . elif ${CPUTYPE} == "k5"
54 _CPUCFLAGS = -march=pentium
56 _CPUCFLAGS = -march=${CPUTYPE}
57 . endif # GCC on 'i386'
58 .elif ${MACHINE_ARCH} == "amd64"
59 _CPUCFLAGS = -march=${CPUTYPE}
62 # Set up the list of CPU features based on the CPU type. This is an
63 # unordered list to make it easy for client makefiles to test for the
64 # presence of a CPU feature.
66 .if ${MACHINE_ARCH} == "i386"
67 . if ${CPUTYPE} == "athlon64-sse"
68 MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 i486 i386
69 . elif ${CPUTYPE} == "athlon64"
70 MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
71 . elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || ${CPUTYPE} == "athlon-4"
72 MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386
73 . elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird"
74 MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386
75 . elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2"
76 MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
77 . elif ${CPUTYPE} == "k6"
78 MACHINE_CPU = mmx k6 k5 i586 i486 i386
79 . elif ${CPUTYPE} == "k5"
80 MACHINE_CPU = k5 i586 i486 i386
81 . elif ${CPUTYPE} == "c3"
82 MACHINE_CPU = 3dnow mmx i586 i486 i386
83 . elif ${CPUTYPE} == "c3-2"
84 MACHINE_CPU = sse mmx i586 i486 i386
85 . elif ${CPUTYPE} == "core2"
86 MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 i486 i386
87 . elif ${CPUTYPE} == "prescott" || ${CPUTYPE} == "nocona"
88 MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386
89 . elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m"
90 MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
91 . elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m"
92 MACHINE_CPU = sse i686 mmx i586 i486 i386
93 . elif ${CPUTYPE} == "pentium2"
94 MACHINE_CPU = i686 mmx i586 i486 i386
95 . elif ${CPUTYPE} == "pentiumpro"
96 MACHINE_CPU = i686 i586 i486 i386
97 . elif ${CPUTYPE} == "pentium-mmx"
98 MACHINE_CPU = mmx i586 i486 i386
99 . elif ${CPUTYPE} == "pentium"
100 MACHINE_CPU = i586 i486 i386
101 . elif ${CPUTYPE} == "i486"
102 MACHINE_CPU = i486 i386
103 . elif ${CPUTYPE} == "i386"
106 .elif ${MACHINE_ARCH} == "amd64"
107 . if ${CPUTYPE} == "athlon64-sse3"
108 MACHINE_CPU = k8 3dnow sse3
109 . elif ${CPUTYPE} == "athlon64"
110 MACHINE_CPU = k8 3dnow
111 . elif ${CPUTYPE} == "nocona"
113 . elif ${CPUTYPE} == "core2"
114 MACHINE_CPU = ssse3 sse3
116 MACHINE_CPU += amd64 sse2 sse mmx