bsd.cpu.mk (26e03c2f92371bc4bd221493722fd3d03cb14c29) bsd.cpu.mk (2b46c64c9c1bf1cb194e0f2b7c478f61a0e10cd9)
1# $FreeBSD$
2
3# Set default CPU compile flags and baseline CPUTYPE for each arch. The
4# compile flags must support the minimum CPU type for each architecture but
5# may tune support for more advanced processors.
6
7.if !defined(CPUTYPE) || empty(CPUTYPE)
8_CPUCFLAGS =
9. if ${MACHINE_ARCH} == "i386"
10MACHINE_CPU = i486
1# $FreeBSD$
2
3# Set default CPU compile flags and baseline CPUTYPE for each arch. The
4# compile flags must support the minimum CPU type for each architecture but
5# may tune support for more advanced processors.
6
7.if !defined(CPUTYPE) || empty(CPUTYPE)
8_CPUCFLAGS =
9. if ${MACHINE_ARCH} == "i386"
10MACHINE_CPU = i486
11. elif ${MACHINE_ARCH} == "alpha"
12_CPUCFLAGS = -mcpu=ev4 -mtune=ev5
13MACHINE_CPU = ev4
14. elif ${MACHINE_ARCH} == "amd64"
15MACHINE_CPU = amd64 sse2 sse
16. elif ${MACHINE_ARCH} == "ia64"
17MACHINE_CPU = itanium
18. elif ${MACHINE_ARCH} == "sparc64"
19. elif ${MACHINE_ARCH} == "arm"
20MACHINE_CPU = arm
21. endif

--- 73 unchanged lines hidden (view full) ---

95_ICC_CPUCFLAGS = -tpp6 -xiM
96. elif ${CPUTYPE} == "pentium-mmx"
97_ICC_CPUCFLAGS = -tpp5 -xM
98. elif ${CPUTYPE} == "pentium"
99_ICC_CPUCFLAGS = -tpp5
100. else
101_ICC_CPUCFLAGS =
102. endif # ICC on 'i386'
11. elif ${MACHINE_ARCH} == "amd64"
12MACHINE_CPU = amd64 sse2 sse
13. elif ${MACHINE_ARCH} == "ia64"
14MACHINE_CPU = itanium
15. elif ${MACHINE_ARCH} == "sparc64"
16. elif ${MACHINE_ARCH} == "arm"
17MACHINE_CPU = arm
18. endif

--- 73 unchanged lines hidden (view full) ---

92_ICC_CPUCFLAGS = -tpp6 -xiM
93. elif ${CPUTYPE} == "pentium-mmx"
94_ICC_CPUCFLAGS = -tpp5 -xM
95. elif ${CPUTYPE} == "pentium"
96_ICC_CPUCFLAGS = -tpp5
97. else
98_ICC_CPUCFLAGS =
99. endif # ICC on 'i386'
103. elif ${MACHINE_ARCH} == "alpha"
104_CPUCFLAGS = -mcpu=${CPUTYPE}
105. elif ${MACHINE_ARCH} == "amd64"
106_CPUCFLAGS = -march=${CPUTYPE}
107. elif ${MACHINE_ARCH} == "arm"
108. if ${CPUTYPE} == "xscale"
109#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself
110#_CPUCFLAGS = -mcpu=xscale
111_CPUCFLAGS = -march=armv5te -D__XSCALE__
112. else

--- 35 unchanged lines hidden (view full) ---

148MACHINE_CPU = mmx i586 i486 i386
149. elif ${CPUTYPE} == "pentium"
150MACHINE_CPU = i586 i486 i386
151. elif ${CPUTYPE} == "i486"
152MACHINE_CPU = i486 i386
153. elif ${CPUTYPE} == "i386"
154MACHINE_CPU = i386
155. endif
100. elif ${MACHINE_ARCH} == "amd64"
101_CPUCFLAGS = -march=${CPUTYPE}
102. elif ${MACHINE_ARCH} == "arm"
103. if ${CPUTYPE} == "xscale"
104#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself
105#_CPUCFLAGS = -mcpu=xscale
106_CPUCFLAGS = -march=armv5te -D__XSCALE__
107. else

--- 35 unchanged lines hidden (view full) ---

143MACHINE_CPU = mmx i586 i486 i386
144. elif ${CPUTYPE} == "pentium"
145MACHINE_CPU = i586 i486 i386
146. elif ${CPUTYPE} == "i486"
147MACHINE_CPU = i486 i386
148. elif ${CPUTYPE} == "i386"
149MACHINE_CPU = i386
150. endif
156. elif ${MACHINE_ARCH} == "alpha"
157. if ${CPUTYPE} == "ev67"
158MACHINE_CPU = ev67 ev6 ev56 pca56 ev5 ev45 ev4
159. elif ${CPUTYPE} == "ev6"
160MACHINE_CPU = ev6 ev56 pca56 ev5 ev45 ev4
161. elif ${CPUTYPE} == "pca56"
162MACHINE_CPU = pca56 ev56 ev5 ev45 ev4
163. elif ${CPUTYPE} == "ev56"
164MACHINE_CPU = ev56 ev5 ev45 ev4
165. elif ${CPUTYPE} == "ev5"
166MACHINE_CPU = ev5 ev45 ev4
167. elif ${CPUTYPE} == "ev45"
168MACHINE_CPU = ev45 ev4
169. elif ${CPUTYPE} == "ev4"
170MACHINE_CPU = ev4
171. endif
172. elif ${MACHINE_ARCH} == "amd64"
173. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
174MACHINE_CPU = k8 3dnow
175. elif ${CPUTYPE} == "nocona"
176MACHINE_CPU = sse3
177. endif
178MACHINE_CPU += amd64 sse2 sse mmx
179. elif ${MACHINE_ARCH} == "ia64"
180. if ${CPUTYPE} == "itanium"
181MACHINE_CPU = itanium
182. endif
183. endif
184.endif
185
151. elif ${MACHINE_ARCH} == "amd64"
152. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
153MACHINE_CPU = k8 3dnow
154. elif ${CPUTYPE} == "nocona"
155MACHINE_CPU = sse3
156. endif
157MACHINE_CPU += amd64 sse2 sse mmx
158. elif ${MACHINE_ARCH} == "ia64"
159. if ${CPUTYPE} == "itanium"
160MACHINE_CPU = itanium
161. endif
162. endif
163.endif
164
186.if ${MACHINE_ARCH} == "alpha"
187_CPUCFLAGS += -mieee
188.endif
189
190.if ${MACHINE_ARCH} == "arm" && defined(ARM_BIG_ENDIAN)
191CFLAGS += -mbig-endian
192LDFLAGS += -mbig-endian
193LD += -EB
194.endif
195
196# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk
197
198.if !defined(NO_CPU_CFLAGS)
199. if ${CC} == "icc"
200CFLAGS += ${_ICC_CPUCFLAGS}
201. else
202CFLAGS += ${_CPUCFLAGS}
203. endif
204.endif
165.if ${MACHINE_ARCH} == "arm" && defined(ARM_BIG_ENDIAN)
166CFLAGS += -mbig-endian
167LDFLAGS += -mbig-endian
168LD += -EB
169.endif
170
171# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk
172
173.if !defined(NO_CPU_CFLAGS)
174. if ${CC} == "icc"
175CFLAGS += ${_ICC_CPUCFLAGS}
176. else
177CFLAGS += ${_CPUCFLAGS}
178. endif
179.endif