blob: 5e1f71dba95ddfa89f0179e0e7ef28d7232607ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
# $NetBSD: subr_x86,v 1.13 2009/03/30 21:02:25 abs Exp $
# Apparently the only way to reliably determine the architecture of a recent
# Intel CPU is to use the cpu brand string - as they reused family and
# extended family bitflags... annoying
# Even better, they appear to have reused brand strings between Northwood
# and Prescott pentium4s. Thats just... special.
# AMD, in contrast decided to keep things simple:
# (thanks to Christoph Egger for this list)
# Family 0x6: AMD K7
# Family 0xf: AMD K8
# Family 0x10: AMD Barcelona/Phenom
# Family 0x11: AMD Turion Ultra
map_x86_brand_string()
{
case "$cpu_brand" in
"AMD*")
case "$cpu_family-$cpu_model" in
5-6 | 5-7 ) echo '-march=k6' ;;
5-8 ) echo '-march=k6-2' ;;
5-9 ) echo '-march=k6-3' ;;
6-1 | 6-2 | 6-3 ) echo '-march=athlon' ;;
6-4 | 6-6 | 6-7 | 6-8 | 6-a ) echo '-march=athlon-4' ;;
esac
;;
"VIA Nehemiah"*) echo '-march=c3' ;;
"Genuine Intel(R) CPU T2400"*) echo '-march=core2' ;;
"Genuine Intel(R) CPU T2500"*) echo '-march=core2' ;;
"Intel(R) Atom(TM) CPU "*) echo '-march=core2 -mtune=pentium' ;;#So far
"Intel(R) Celeron(R) CPU E1400"*) echo '-march=core2' ;;
"Intel(R) Celeron(R) CPU 2.40GHz") echo '-march=pentium4' ;;
"Intel(R) Celeron(R) M processor "*) echo '-march=pentium-m' ;;
"Intel(R) Celeron(TM) CPU 1400MHz") echo '-march=pentium3' ;;
"Intel(R) Core 2 "*) echo '-march=core2' ;;
"Intel(R) Core(TM)2 "*) echo '-march=core2' ;;
"Intel(R) Pentium(R) 4 CPU"*)
if [ -n "$cpu_feature_SSE3" ] ; then
echo '-march=prescott'
else
echo '-march=pentium4'
fi ;;
"Intel(R) Pentium(R) M processor "*) echo '-march=pentium-m' ;;
"Intel(R) Xeon(R) CPU 3040"*) echo '-march=core2' ;;
"Intel(R) Xeon(R) CPU 3050"*) echo '-march=core2' ;;
"Intel(R) Xeon(R) CPU E5310"*) echo '-march=core2' ;;
"Intel(r) Xeon(r) CPU E5430"*) echo '-march=core2' ;;
"Pentium(R) Dual-Core CPU E5200"*) echo '-march=core2' ;;
esac
}
flags_fixup_x86arch()
{
arch=$1
features=$2
# Fixup ARCH for x86
#
# The format of table is
# feature:lowend_arch:fix_arch
#
$AWK -v "arch=${arch#-march=}" -v "features=$features" '
BEGIN { split(features,ar); FS=":" }
{ for (af in ar)
{ if ((ar[af] == $1) && (arch == $3)) { print $2; exit;} }
}
' <<EOD
-msse:pentium3:i386
-msse:pentium3:i486
-msse:pentium3:i586
-msse:pentium3:i686
-msse:pentium3:pentium
-msse:pentium3:pentium-mmx
-msse:pentium3:pentiumpro
-msse:pentium3:pentium2
-msse:athlon:k6
-msse:athlon:k6-2
-msse:athlon:k6-3
-msse2:pentium4:i386
-msse2:pentium4:i386
-msse2:pentium4:i486
-msse2:pentium4:i586
-msse2:pentium4:i686
-msse2:pentium4:pentium
-msse2:pentium4:pentium-mmx
-msse2:pentium4:pentiumpro
-msse2:pentium4:pentium2
-msse2:pentium4:pentium3
-msse2:pentium4:pentium3m
-msse2:k8:k6
-msse2:k8:k6-2
-msse2:k8:k6-3
-msse2:k8:athlon
-msse2:k8:athlon-tbird
-msse2:k8:athlon-4
-msse2:k8:athlon-xp
-msse2:k8:athlon-mp
-msse3:prescott:i386
-msse3:prescott:i386
-msse3:prescott:i486
-msse3:prescott:i586
-msse3:prescott:i686
-msse3:prescott:pentium
-msse3:prescott:pentium-mmx
-msse3:prescott:pentiumpro
-msse3:prescott:pentium2
-msse3:prescott:pentium3
-msse3:prescott:pentium3m
-msse3:prescott:pentium-m
-msse3:prescott:pentium4
-msse3:prescott:pentium4m
-msse3:k8:k6
-msse3:k8:k6-2
-msse3:k8:k6-3
-msse3:k8:athlon
-msse3:k8:athlon-tbird
-msse3:k8:athlon-4
-msse3:k8:athlon-xp
-msse3:k8:athlon-mp
-m3dnow:athlon:k6
-m3dnow:athlon:k6-2
-m3dnow:athlon:k6-3
EOD
## in future
#-mssse3:nocona:prescott ...
#-msse4:nehalem:nocona ...
}
|