1# $FreeBSD: head/share/mk/bsd.cpu.mk 136211 2004-10-07 09:56:48Z des $
| 1# $FreeBSD: head/share/mk/bsd.cpu.mk 136606 2004-10-17 05:08:29Z obrien $
|
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)
| 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. if ${MACHINE_ARCH} == "i386"
| |
9_CPUCFLAGS =
| 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"
| 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"
|
17_CPUCFLAGS =
| |
18MACHINE_CPU = itanium 19. elif ${MACHINE_ARCH} == "sparc64"
| 17MACHINE_CPU = itanium 18. elif ${MACHINE_ARCH} == "sparc64"
|
20_CPUCFLAGS =
| |
21. elif ${MACHINE_ARCH} == "arm"
| 19. elif ${MACHINE_ARCH} == "arm"
|
22_CPUCFLAGS =
| |
23MACHINE_CPU = arm 24. endif 25.else 26 27# Handle aliases (not documented in make.conf to avoid user confusion 28# between e.g. i586 and pentium) 29 30. if ${MACHINE_ARCH} == "i386"
| 20MACHINE_CPU = arm 21. endif 22.else 23 24# Handle aliases (not documented in make.conf to avoid user confusion 25# between e.g. i586 and pentium) 26 27. if ${MACHINE_ARCH} == "i386"
|
31. if ${CPUTYPE} == "pentium4" 32CPUTYPE = p4 33. elif ${CPUTYPE} == "pentium4m" 34CPUTYPE = p4m 35. elif ${CPUTYPE} == "pentium3" 36CPUTYPE = p3 37. elif ${CPUTYPE} == "pentium3m" 38CPUTYPE = p3m 39. elif ${CPUTYPE} == "pentium-m" 40CPUTYPE = p-m 41. elif ${CPUTYPE} == "pentiumpro" 42CPUTYPE = i686 43. elif ${CPUTYPE} == "pentium" 44CPUTYPE = i586
| 28. if ${CPUTYPE} == "p4" 29CPUTYPE = pentium4 30. elif ${CPUTYPE} == "p4m" 31CPUTYPE = pentium4m 32. elif ${CPUTYPE} == "p3" 33CPUTYPE = pentium3 34. elif ${CPUTYPE} == "p3m" 35CPUTYPE = pentium3m 36. elif ${CPUTYPE} == "p-m" 37CPUTYPE = pentium-m 38. elif ${CPUTYPE} == "p2" 39CPUTYPE = pentium2 40. elif ${CPUTYPE} == "i686" 41CPUTYPE = pentiumpro 42. elif ${CPUTYPE} == "i586/mmx" 43CPUTYPE = pentium-mmx 44. elif ${CPUTYPE} == "i586" 45CPUTYPE = pentium
|
45. elif ${CPUTYPE} == "opteron" 46CPUTYPE = athlon-mp 47. elif ${CPUTYPE} == "athlon64" 48CPUTYPE = athlon-xp 49. elif ${CPUTYPE} == "k7" 50CPUTYPE = athlon 51. endif 52. endif 53
| 46. elif ${CPUTYPE} == "opteron" 47CPUTYPE = athlon-mp 48. elif ${CPUTYPE} == "athlon64" 49CPUTYPE = athlon-xp 50. elif ${CPUTYPE} == "k7" 51CPUTYPE = athlon 52. endif 53. endif 54
|
| 55###############################################################################
|
54# Logic to set up correct gcc optimization flag. This must be included 55# after /etc/make.conf so it can react to the local value of CPUTYPE 56# defined therein. Consult: 57# http://gcc.gnu.org/onlinedocs/gcc/DEC-Alpha-Options.html 58# http://gcc.gnu.org/onlinedocs/gcc/IA-64-Options.html 59# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html 60# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html 61# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html 62 63. if ${MACHINE_ARCH} == "i386" 64. if ${CPUTYPE} == "crusoe" 65_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
| 56# Logic to set up correct gcc optimization flag. This must be included 57# after /etc/make.conf so it can react to the local value of CPUTYPE 58# defined therein. Consult: 59# http://gcc.gnu.org/onlinedocs/gcc/DEC-Alpha-Options.html 60# http://gcc.gnu.org/onlinedocs/gcc/IA-64-Options.html 61# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html 62# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html 63# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html 64 65. if ${MACHINE_ARCH} == "i386" 66. if ${CPUTYPE} == "crusoe" 67_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
|
| 68. elif ${CPUTYPE} == "k5" 69_CPUCFLAGS = -march=pentium 70. else 71_CPUCFLAGS = -march=${CPUTYPE} 72. endif # GCC on 'i386' 73. if ${CPUTYPE} == "crusoe"
|
66_ICC_CPUCFLAGS = -tpp6 -xiM 67. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ 68 ${CPUTYPE} == "athlon-4"
| 74_ICC_CPUCFLAGS = -tpp6 -xiM 75. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ 76 ${CPUTYPE} == "athlon-4"
|
69_CPUCFLAGS = -march=${CPUTYPE}
| |
70_ICC_CPUCFLAGS = -tpp6 -xiMK 71. elif ${CPUTYPE} == "athlon-tbird" || ${CPUTYPE} == "athlon"
| 77_ICC_CPUCFLAGS = -tpp6 -xiMK 78. elif ${CPUTYPE} == "athlon-tbird" || ${CPUTYPE} == "athlon"
|
72_CPUCFLAGS = -march=${CPUTYPE}
| |
73_ICC_CPUCFLAGS = -tpp6 -xiM 74. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "k6"
| 79_ICC_CPUCFLAGS = -tpp6 -xiM 80. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "k6"
|
75_CPUCFLAGS = -march=${CPUTYPE}
| |
76_ICC_CPUCFLAGS = -tpp6 -xi 77. elif ${CPUTYPE} == "k5"
| 81_ICC_CPUCFLAGS = -tpp6 -xi 82. elif ${CPUTYPE} == "k5"
|
78_CPUCFLAGS = -march=pentium
| |
79_ICC_CPUCFLAGS = -tpp5
| 83_ICC_CPUCFLAGS = -tpp5
|
80. elif ${CPUTYPE} == "p4" 81_CPUCFLAGS = -march=pentium4
| 84. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m"
|
82_ICC_CPUCFLAGS = -tpp7 -xiMKW
| 85_ICC_CPUCFLAGS = -tpp7 -xiMKW
|
83. elif ${CPUTYPE} == "p4m" 84_CPUCFLAGS = -march=pentium4m 85. elif ${CPUTYPE} == "p3" 86_CPUCFLAGS = -march=pentium3
| 86. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" || \ 87 ${CPUTYPE} == "pentium-m"
|
87_ICC_CPUCFLAGS = -tpp6 -xiMK
| 88_ICC_CPUCFLAGS = -tpp6 -xiMK
|
88. elif ${CPUTYPE} == "p3m" 89_CPUCFLAGS = -march=pentium3m 90. elif ${CPUTYPE} == "p-m" 91_CPUCFLAGS = -march=pentium-m 92. elif ${CPUTYPE} == "p2" 93_CPUCFLAGS = -march=pentium2
| 89. elif ${CPUTYPE} == "pentium2" || ${CPUTYPE} == "pentiumpro"
|
94_ICC_CPUCFLAGS = -tpp6 -xiM
| 90_ICC_CPUCFLAGS = -tpp6 -xiM
|
95. elif ${CPUTYPE} == "i686" 96_CPUCFLAGS = -march=pentiumpro 97_ICC_CPUCFLAGS = -tpp6 -xiM 98. elif ${CPUTYPE} == "i586/mmx" 99_CPUCFLAGS = -march=pentium-mmx
| 91. elif ${CPUTYPE} == "pentium-mmx"
|
100_ICC_CPUCFLAGS = -tpp5 -xM
| 92_ICC_CPUCFLAGS = -tpp5 -xM
|
101. elif ${CPUTYPE} == "i586" 102_CPUCFLAGS = -march=pentium
| 93. elif ${CPUTYPE} == "pentium"
|
103_ICC_CPUCFLAGS = -tpp5
| 94_ICC_CPUCFLAGS = -tpp5
|
104. elif ${CPUTYPE} == "i486" 105_CPUCFLAGS = -march=i486
| 95. else
|
106_ICC_CPUCFLAGS =
| 96_ICC_CPUCFLAGS =
|
107. endif
| 97. endif # ICC on 'i386'
|
108. elif ${MACHINE_ARCH} == "alpha"
| 98. elif ${MACHINE_ARCH} == "alpha"
|
109. if ${CPUTYPE} == "ev67" 110_CPUCFLAGS = -mcpu=ev67 111. elif ${CPUTYPE} == "ev6" 112_CPUCFLAGS = -mcpu=ev6 113. elif ${CPUTYPE} == "pca56" 114_CPUCFLAGS = -mcpu=pca56 115. elif ${CPUTYPE} == "ev56" 116_CPUCFLAGS = -mcpu=ev56 117. elif ${CPUTYPE} == "ev5" 118_CPUCFLAGS = -mcpu=ev5 119. elif ${CPUTYPE} == "ev45" 120_CPUCFLAGS = -mcpu=ev45 121. elif ${CPUTYPE} == "ev4" 122_CPUCFLAGS = -mcpu=ev4 123. endif
| 99_CPUCFLAGS = -mcpu=${CPUTYPE}
|
124. elif ${MACHINE_ARCH} == "arm"
| 100. elif ${MACHINE_ARCH} == "arm"
|
125. if ${CPUTYPE} == "strongarm" 126_CPUCFLAGS = -mcpu=strongarm 127. elif ${CPUTYPE} == "xscale"
| 101. if ${CPUTYPE} == "xscale"
|
128#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself 129#_CPUCFLAGS = -mcpu=xscale 130_CPUCFLAGS = -D__XSCALE__
| 102#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself 103#_CPUCFLAGS = -mcpu=xscale 104_CPUCFLAGS = -D__XSCALE__
|
| 105. else 106_CPUCFLAGS = -mcpu=${CPUTYPE}
|
131. endif 132. endif 133 134# Set up the list of CPU features based on the CPU type. This is an 135# unordered list to make it easy for client makefiles to test for the 136# presence of a CPU feature. 137 138. if ${MACHINE_ARCH} == "i386" 139. if ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ 140 ${CPUTYPE} == "athlon-4"
| 107. endif 108. endif 109 110# Set up the list of CPU features based on the CPU type. This is an 111# unordered list to make it easy for client makefiles to test for the 112# presence of a CPU feature. 113 114. if ${MACHINE_ARCH} == "i386" 115. if ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ 116 ${CPUTYPE} == "athlon-4"
|
141MACHINE_CPU = athlon-xp k7 3dnow sse mmx k6 k5 i586 i486 i386
| 117MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386
|
142. elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird" 143MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386 144. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" 145MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386 146. elif ${CPUTYPE} == "k6" 147MACHINE_CPU = mmx k6 k5 i586 i486 i386 148. elif ${CPUTYPE} == "k5" 149MACHINE_CPU = k5 i586 i486 i386
| 118. elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird" 119MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386 120. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" 121MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386 122. elif ${CPUTYPE} == "k6" 123MACHINE_CPU = mmx k6 k5 i586 i486 i386 124. elif ${CPUTYPE} == "k5" 125MACHINE_CPU = k5 i586 i486 i386
|
150. elif ${CPUTYPE} == "p4" || ${CPUTYPE} == "p4m" || ${CPUTYPE} == "p-m"
| 126. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || \ 127 ${CPUTYPE} == "pentium-m"
|
151MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
| 128MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
|
152. elif ${CPUTYPE} == "p3" || ${CPUTYPE} == "p3m"
| 129. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m"
|
153MACHINE_CPU = sse i686 mmx i586 i486 i386
| 130MACHINE_CPU = sse i686 mmx i586 i486 i386
|
154. elif ${CPUTYPE} == "p2"
| 131. elif ${CPUTYPE} == "pentium2"
|
155MACHINE_CPU = i686 mmx i586 i486 i386
| 132MACHINE_CPU = i686 mmx i586 i486 i386
|
156. elif ${CPUTYPE} == "i686"
| 133. elif ${CPUTYPE} == "pentiumpro"
|
157MACHINE_CPU = i686 i586 i486 i386
| 134MACHINE_CPU = i686 i586 i486 i386
|
158. elif ${CPUTYPE} == "i586/mmx"
| 135. elif ${CPUTYPE} == "pentium-mmx"
|
159MACHINE_CPU = mmx i586 i486 i386
| 136MACHINE_CPU = mmx i586 i486 i386
|
160. elif ${CPUTYPE} == "i586"
| 137. elif ${CPUTYPE} == "pentium"
|
161MACHINE_CPU = i586 i486 i386 162. elif ${CPUTYPE} == "i486" 163MACHINE_CPU = i486 i386 164. elif ${CPUTYPE} == "i386" 165MACHINE_CPU = i386 166. endif 167. elif ${MACHINE_ARCH} == "alpha" 168. if ${CPUTYPE} == "ev6"
--- 34 unchanged lines hidden --- | 138MACHINE_CPU = i586 i486 i386 139. elif ${CPUTYPE} == "i486" 140MACHINE_CPU = i486 i386 141. elif ${CPUTYPE} == "i386" 142MACHINE_CPU = i386 143. endif 144. elif ${MACHINE_ARCH} == "alpha" 145. if ${CPUTYPE} == "ev6"
--- 34 unchanged lines hidden --- |