aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2010-02-26 02:37:40 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2010-02-25 18:37:40 -0800
commit3fd776303163de053c566665a13de141e3852286 (patch)
tree08d866590657d351c8cd0672eed0cf6c89c79e89 /gcc
parent4b9c60758401aedf9e992c588f595e7ecf1a5235 (diff)
downloadgcc-3fd776303163de053c566665a13de141e3852286.zip
gcc-3fd776303163de053c566665a13de141e3852286.tar.gz
gcc-3fd776303163de053c566665a13de141e3852286.tar.bz2
Set default arch/cpu for i[34567]86-*-*|x86_64-*-* targets.
2010-02-25 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Set arch/cpu for i[34567]86-*-*|x86_64-*-* targets. Set the default with_cpu/with_arch from arch/cpu. Allow x86-64 and native for with_cpu/with_arch. From-SVN: r157081
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config.gcc290
2 files changed, 190 insertions, 106 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 62885ce..8f04378 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config.gcc: Set arch/cpu for i[34567]86-*-*|x86_64-*-*
+ targets. Set the default with_cpu/with_arch from arch/cpu.
+ Allow x86-64 and native for with_cpu/with_arch.
+
2010-02-25 Nicolas Benoit <nbenoit@tuxfamily.org>
* ebitmap.c: Change calls to verify_popcount with calls to
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 62ef6b0..65578f3 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2621,105 +2621,151 @@ case ${with_cpu} in
;;
esac
+# Set arch and cpu from ${target} and ${target_noncanonical}. Set cpu
+# to generic if there is no processor scheduler model for the target.
+arch=
+cpu=
+case ${target} in
+ i386-*-*)
+ arch=i386
+ cpu=i386
+ ;;
+ i486-*-*)
+ arch=i486
+ cpu=i486
+ ;;
+ i586-*-*)
+ case ${target_noncanonical} in
+ k6_2-*)
+ arch=k6-2
+ cpu=k6-2
+ ;;
+ k6_3-*)
+ arch=k6-3
+ cpu=k6-3
+ ;;
+ k6-*)
+ arch=k6
+ cpu=k6
+ ;;
+ pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
+ arch=pentium-mmx
+ cpu=pentium-mmx
+ ;;
+ *)
+ arch=pentium
+ cpu=pentium
+ ;;
+ esac
+ ;;
+ i686-*-* | i786-*-*)
+ case ${target_noncanonical} in
+ amdfam10-*|barcelona-*)
+ arch=amdfam10
+ cpu=amdfam10
+ ;;
+ k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
+ arch=k8-sse3
+ cpu=k8-sse3
+ ;;
+ k8-*|opteron-*|athlon64-*|athlon_fx-*)
+ arch=k8
+ cpu=k8
+ ;;
+ athlon_xp-*|athlon_mp-*|athlon_4-*)
+ arch=athlon-4
+ cpu=athlon-4
+ ;;
+ athlon_tbird-*|athlon-*)
+ arch=athlon
+ cpu=athlon
+ ;;
+ geode-*)
+ arch=geode
+ cpu=geode
+ ;;
+ pentium2-*)
+ arch=pentium2
+ cpu=pentium2
+ ;;
+ pentium3-*|pentium3m-*)
+ arch=pentium3
+ cpu=pentium3
+ ;;
+ pentium4-*|pentium4m-*)
+ arch=pentium4
+ cpu=pentium4
+ ;;
+ prescott-*)
+ arch=prescott
+ cpu=prescott
+ ;;
+ nocona-*)
+ arch=nocona
+ cpu=nocona
+ ;;
+ atom-*)
+ arch=atom
+ cpu=atom
+ ;;
+ core2-*)
+ arch=core2
+ cpu=core2
+ ;;
+ pentium_m-*)
+ arch=pentium-m
+ cpu=pentium-m
+ ;;
+ pentiumpro-*)
+ arch=pentiumpro
+ cpu=pentiumpro
+ ;;
+ *)
+ arch=pentiumpro
+ cpu=generic
+ ;;
+ esac
+ ;;
+ x86_64-*-*)
+ case ${target_noncanonical} in
+ amdfam10-*|barcelona-*)
+ arch=amdfam10
+ cpu=amdfam10
+ ;;
+ k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
+ arch=k8-sse3
+ cpu=k8-sse3
+ ;;
+ k8-*|opteron-*|athlon_64-*)
+ arch=k8
+ cpu=k8
+ ;;
+ nocona-*)
+ arch=nocona
+ cpu=nocona
+ ;;
+ atom-*)
+ arch=atom
+ cpu=atom
+ ;;
+ core2-*)
+ arch=core2
+ cpu=core2
+ ;;
+ *)
+ arch=x86-64
+ cpu=generic
+ ;;
+ esac
+ ;;
+esac
+
# If there is no $with_cpu option, try to infer one from ${target}.
# This block sets nothing except for with_cpu.
if test x$with_cpu = x ; then
case ${target} in
- i386-*-*)
- with_cpu=i386
- ;;
- i486-*-*)
- with_cpu=i486
- ;;
- i586-*-*)
- case ${target_noncanonical} in
- k6_2-*)
- with_cpu=k6-2
- ;;
- k6_3-*)
- with_cpu=k6-3
- ;;
- k6-*)
- with_cpu=k6
- ;;
- pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
- with_cpu=pentium-mmx
- ;;
- *)
- with_cpu=pentium
- ;;
- esac
- ;;
- i686-*-* | i786-*-*)
- case ${target_noncanonical} in
- amdfam10-*|barcelona-*)
- with_cpu=amdfam10
- ;;
- k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
- with_cpu=k8-sse3
- ;;
- k8-*|opteron-*|athlon64-*|athlon_fx-*)
- with_cpu=k8
- ;;
- athlon_xp-*|athlon_mp-*|athlon_4-*)
- with_cpu=athlon-4
- ;;
- athlon_tbird-*|athlon-*)
- with_cpu=athlon
- ;;
- geode-*)
- with_cpu=geode
- ;;
- pentium2-*)
- with_cpu=pentium2
- ;;
- pentium3-*|pentium3m-*)
- with_cpu=pentium3
- ;;
- pentium4-*|pentium4m-*)
- with_cpu=pentium4
- ;;
- prescott-*)
- with_cpu=prescott
- ;;
- nocona-*)
- with_cpu=nocona
- ;;
- core2-*)
- with_cpu=core2
- ;;
- pentium_m-*)
- with_cpu=pentium-m
- ;;
- pentiumpro-*)
- with_cpu=pentiumpro
- ;;
- *)
- with_cpu=generic
- ;;
- esac
- ;;
- x86_64-*-*)
- case ${target_noncanonical} in
- amdfam10-*|barcelona-*)
- with_cpu=amdfam10
- ;;
- k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
- with_cpu=k8-sse3
- ;;
- k8-*|opteron-*|athlon64-*|athlon_fx-*)
- with_cpu=k8
- ;;
- nocona-*)
- with_cpu=nocona
- ;;
- core2-*)
- with_cpu=core2
- ;;
- *)
- with_cpu=generic
- ;;
- esac
+ i[34567]86-*-*|x86_64-*-*)
+ with_cpu=$cpu
;;
alphaev6[78]*-*-*)
with_cpu=ev67
@@ -2763,16 +2809,48 @@ if test x$with_cpu = x ; then
# Avoid overriding --with-cpu-32 and --with-cpu-64 values.
case ${target} in
i[34567]86-*-*|x86_64-*-*)
- if test x$with_cpu != x; then
- if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
- if test x$with_cpu_32 = x; then
- with_cpu_32=$with_cpu
- fi
- if test x$with_cpu_64 = x; then
- with_cpu_64=$with_cpu
- fi
- with_cpu=
- fi
+ if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
+ if test x$with_cpu_32 = x; then
+ with_cpu_32=$with_cpu
+ fi
+ if test x$with_cpu_64 = x; then
+ with_cpu_64=$with_cpu
+ fi
+ with_cpu=
+ fi
+ ;;
+ esac
+fi
+
+# Support for --with-arch and related options (and a few unrelated options,
+# too).
+case ${with_arch} in
+ yes | no)
+ echo "--with-arch must be passed a value" 1>&2
+ exit 1
+ ;;
+esac
+
+# If there is no $with_arch option, try to infer one from ${target}.
+# This block sets nothing except for with_arch.
+if test x$with_arch = x ; then
+ case ${target} in
+ i[34567]86-*-*|x86_64-*-*)
+ with_arch=$arch
+ ;;
+ esac
+
+ # Avoid overriding --with-arch-32 and --with-arch-64 values.
+ case ${target} in
+ i[34567]86-*-*|x86_64-*-*)
+ if test x$with_arch_32 != x || test x$with_arch_64 != x; then
+ if test x$with_arch_32 = x; then
+ with_arch_32=$arch
+ fi
+ if test x$with_arch_64 = x; then
+ with_arch_64=$arch
+ fi
+ with_arch=
fi
;;
esac
@@ -3001,7 +3079,7 @@ case "${target}" in
esac
# OK
;;
- "" | amdfam10 | barcelona | k8-sse3 | opteron-sse3 | athlon64-sse3 | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | atom | generic)
+ "" | amdfam10 | barcelona | k8-sse3 | opteron-sse3 | athlon64-sse3 | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | atom | x86-64 | generic | native)
# OK
;;
*)