+2008-06-11 Joseph Myers <joseph@codesourcery.com>
+
+ * config.gcc (all_defaults): Add arch_32 arch_64 cpu_32 cpu_64
+ tune_32 tune_64.
+ (i[34567]86-*-* | x86_64-*-*): Add arch_32 arch_64 cpu_32 cpu_64
+ tune_32 tune_64 to supported_defaults. Allow values not
+ supporting 64-bit mode for arch_32, cpu_32 and tune_32 for
+ x86_64. Do not override cpu_32 or cpu_64 values from target name.
+ (i[34567]86-*-linux*, i[34567]86-*-solaris2.1[0-9]*): Only default
+ with_cpu_64 to generic for 64-bit-supporting configurations, not
+ with_cpu. Remove FIXMEs.
+ * doc/install.texi (--with-cpu-32, --with-cpu-64, --with-arch-32,
+ --with-arch-64, --with-tune-32, --with-tune-64): Document.
+ * config/i386/i386.h (OPT_ARCH32, OPT_ARCH64): Define.
+ (OPTION_DEFAULT_SPECS): Add tune_32, tune_64, cpu_32, cpu_64,
+ arch_32 and arch_64.
+
2008-06-11 Eric Botcazou <ebotcazou@adacore.com>
Olivier Hainque <hainque@adacore.com>
tm_defines="${tm_defines} TARGET_BI_ARCH=1"
tmake_file="${tmake_file} i386/t-linux64 i386/t-fprules-softfp64 soft-fp/t-softfp"
need_64bit_hwint=yes
- # FIXME: -m64 for i[34567]86-*-* should be allowed just
- # like -m32 for x86_64-*-*.
case X"${with_cpu}" in
Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx)
;;
X)
- with_cpu=generic
+ if test x$with_cpu_64 = x; then
+ with_cpu_64=generic
+ fi
;;
*)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
tm_defines="${tm_defines} TARGET_BI_ARCH=1"
tmake_file="$tmake_file i386/t-crtstuff i386/t-sol2-10"
need_64bit_hwint=yes
- # FIXME: -m64 for i[34567]86-*-* should be allowed just
- # like -m32 for x86_64-*-*.
case X"${with_cpu}" in
Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx)
;;
X)
- with_cpu=generic
+ if test x$with_cpu_64 = x; then
+ with_cpu_64=generic
+ fi
;;
*)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
with_cpu="`echo ${target} | sed 's/-.*$//'`"
;;
esac
+
+ # 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
+ fi
+ ;;
+ esac
fi
# Similarly for --with-schedule.
;;
i[34567]86-*-* | x86_64-*-*)
- supported_defaults="arch cpu tune"
- for which in arch cpu tune; do
+ supported_defaults="arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
+ for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
eval "val=\$with_$which"
case ${val} in
i386 | i486 \
| prescott | pentium-m | pentium4m | pentium3m)
case "${target}" in
x86_64-*-*)
- echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
- exit 1
+ case "x$which" in
+ *_32)
+ ;;
+ *)
+ echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# OK
esac
t=
-all_defaults="abi cpu arch tune schedule float mode fpu divide llsc"
+all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu divide llsc"
for option in $all_defaults
do
eval "val=\$with_$option"
#define HAVE_LOCAL_CPU_DETECT
#endif
+#if TARGET_64BIT_DEFAULT
+#define OPT_ARCH64 "!m32"
+#define OPT_ARCH32 "m32"
+#else
+#define OPT_ARCH64 "m64"
+#define OPT_ARCH32 "!m64"
+#endif
+
/* Support for configure-time defaults of some command line options.
The order here is important so that -march doesn't squash the
tune or cpu values. */
#define OPTION_DEFAULT_SPECS \
{"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
+ {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
+ {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
{"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
- {"arch", "%{!march=*:-march=%(VALUE)}"}
+ {"cpu_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
+ {"cpu_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
+ {"arch", "%{!march=*:-march=%(VALUE)}"}, \
+ {"arch_32", "%{" OPT_ARCH32 ":%{!march=*:-march=%(VALUE)}}"}, \
+ {"arch_64", "%{" OPT_ARCH64 ":%{!march=*:-march=%(VALUE)}}"},
/* Specs for the compiler proper */
This is an alias for @option{--enable-tls=no}.
@item --with-cpu=@var{cpu}
+@itemx --with-cpu-32=@var{cpu}
+@itemx --with-cpu-64=@var{cpu}
Specify which cpu variant the compiler should generate code for by default.
@var{cpu} will be used as the default value of the @option{-mcpu=} switch.
This option is only supported on some targets, including ARM, i386, M68k,
-PowerPC, and SPARC@.
+PowerPC, and SPARC@. The @option{--with-cpu-32} and
+@option{--with-cpu-64} options specify separate default CPUs for
+32-bit and 64-bit modes; these options are only supported for i386 and
+x86-64.
@item --with-schedule=@var{cpu}
@itemx --with-arch=@var{cpu}
+@itemx --with-arch-32=@var{cpu}
+@itemx --with-arch-64=@var{cpu}
@itemx --with-tune=@var{cpu}
+@itemx --with-tune-32=@var{cpu}
+@itemx --with-tune-64=@var{cpu}
@itemx --with-abi=@var{abi}
@itemx --with-fpu=@var{type}
@itemx --with-float=@var{type}