rename amd64 architecture to x86_64
[dragonfly.git] / share / mk / bsd.cpu.gcc44.mk
CommitLineData
cdefb602
SS
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.
4
5.if !defined(CPUTYPE) || empty(CPUTYPE)
6. if ${MACHINE_ARCH} == "i386"
7CPUTYPE = i686
c1543a89 8. elif ${MACHINE_ARCH} == "x86_64"
cdefb602
SS
9CPUTYPE = athlon64
10. endif
11.endif
12
13# Handle aliases (not documented in make.conf to avoid user confusion
14# between e.g. i586 and pentium)
15
16.if ${CPUTYPE} == "core"
17CPUTYPE = nocona
18.elif ${CPUTYPE} == "p4"
19CPUTYPE = pentium4
20.elif ${CPUTYPE} == "p4m"
21CPUTYPE = pentium4m
22.elif ${CPUTYPE} == "p3"
23CPUTYPE = pentium3
24.elif ${CPUTYPE} == "p3m"
25CPUTYPE = pentium3m
26.elif ${CPUTYPE} == "p-m"
27CPUTYPE = pentium-m
28.elif ${CPUTYPE} == "p2"
29CPUTYPE = pentium2
de607877
SS
30.elif ${CPUTYPE} == "i686"
31CPUTYPE = pentiumpro
cdefb602
SS
32.elif ${CPUTYPE} == "i586/mmx"
33CPUTYPE = pentium-mmx
34.elif ${CPUTYPE} == "i586"
35CPUTYPE = pentium
36.elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "k8"
37CPUTYPE = athlon64
38.elif ${CPUTYPE} == "k7"
39CPUTYPE = athlon
40.endif
41
42###############################################################################
43# Logic to set up correct gcc optimization flag. This must be included
44# after /etc/make.conf so it can react to the local value of CPUTYPE
45# defined therein. Consult:
46# http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
47# http://gcc.gnu.org/onlinedocs/gcc/IA-64-Options.html
48# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
49# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
50# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
51
52.if ${MACHINE_ARCH} == "i386"
53. if ${CPUTYPE} == "crusoe"
54_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
55. elif ${CPUTYPE} == "k5"
56_CPUCFLAGS = -march=pentium
57. else
58_CPUCFLAGS = -march=${CPUTYPE}
59. endif # GCC on 'i386'
c1543a89 60.elif ${MACHINE_ARCH} == "x86_64"
cdefb602
SS
61_CPUCFLAGS = -march=${CPUTYPE}
62.endif
63
64# Set up the list of CPU features based on the CPU type. This is an
65# unordered list to make it easy for client makefiles to test for the
66# presence of a CPU feature.
67
68.if ${MACHINE_ARCH} == "i386"
69. if ${CPUTYPE} == "athlon64-sse"
70MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 i486 i386
71. elif ${CPUTYPE} == "athlon64"
72MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
73. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || ${CPUTYPE} == "athlon-4"
74MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386
75. elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird"
76MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386
77. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2"
78MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
79. elif ${CPUTYPE} == "k6"
80MACHINE_CPU = mmx k6 k5 i586 i486 i386
81. elif ${CPUTYPE} == "k5"
82MACHINE_CPU = k5 i586 i486 i386
83. elif ${CPUTYPE} == "c3"
84MACHINE_CPU = 3dnow mmx i586 i486 i386
85. elif ${CPUTYPE} == "c3-2"
86MACHINE_CPU = sse mmx i586 i486 i386
87. elif ${CPUTYPE} == "core2"
88MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 i486 i386
89. elif ${CPUTYPE} == "prescott" || ${CPUTYPE} == "nocona"
90MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386
91. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m"
92MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
93. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m"
94MACHINE_CPU = sse i686 mmx i586 i486 i386
95. elif ${CPUTYPE} == "pentium2"
96MACHINE_CPU = i686 mmx i586 i486 i386
97. elif ${CPUTYPE} == "pentiumpro"
98MACHINE_CPU = i686 i586 i486 i386
99. elif ${CPUTYPE} == "pentium-mmx"
100MACHINE_CPU = mmx i586 i486 i386
101. elif ${CPUTYPE} == "pentium"
102MACHINE_CPU = i586 i486 i386
103. elif ${CPUTYPE} == "i486"
104MACHINE_CPU = i486 i386
105. elif ${CPUTYPE} == "i386"
106MACHINE_CPU = i386
107. endif
c1543a89 108.elif ${MACHINE_ARCH} == "x86_64"
cdefb602
SS
109. if ${CPUTYPE} == "athlon64-sse3"
110MACHINE_CPU = k8 3dnow sse3
111. elif ${CPUTYPE} == "athlon64"
112MACHINE_CPU = k8 3dnow
113. elif ${CPUTYPE} == "nocona"
114MACHINE_CPU = sse3
115. elif ${CPUTYPE} == "core2"
116MACHINE_CPU = ssse3 sse3
117. endif
c1543a89 118MACHINE_CPU += x86_64 sse2 sse mmx
cdefb602 119.endif