SSL configure.ac
Interaktion und Portierbarkeitunbekannt
|
|
Spracherkennung für: .ac vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
dnl Process this file with autoconf to produce a configure script.
define(GMP_COPYRIGHT,[[
Copyright 1996-2022 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any
later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/.
]])
AC_COPYRIGHT(GMP_COPYRIGHT)
AH_TOP(/*GMP_COPYRIGHT*/)
AC_REVISION($Revision$)
AC_PREREQ(2.59)
AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org (see https://gmplib.org/manual/Reporting-Bugs.html)], gmp)
AC_CONFIG_SRCDIR(gmp-impl.h)
m4_pattern_forbid([^[ \t]*GMP_])
m4_pattern_allow(GMP_LDFLAGS)
m4_pattern_allow(GMP_LIMB_BITS)
m4_pattern_allow(GMP_MPARAM_H_SUGGEST)
m4_pattern_allow(GMP_NAIL_BITS)
m4_pattern_allow(GMP_NUMB_BITS)
m4_pattern_allow(GMP_NONSTD_ABI)
m4_pattern_allow(GMP_CPU_TYPE)
m4_pattern_allow(GMP_AVX_NOT_REALLY_AVAILABLE)
# If --target is not used then $target_alias is empty, but if say
# "./configure athlon-pc-freebsd3.5" is used, then all three of
# $build_alias, $host_alias and $target_alias are set to
# "athlon-pc-freebsd3.5".
#
if test -n "$target_alias" && test "$target_alias" != "$host_alias"; then
AC_MSG_ERROR([--target is not appropriate for GMP
Use --build=CPU-VENDOR-OS if you need to specify your CPU and/or system
explicitly. Use --host if cross-compiling (see "Installing GMP" in the
manual for more on this).])
fi
GMP_INIT(config.m4)
AC_CANONICAL_HOST
dnl Automake "no-dependencies" is used because include file dependencies
dnl are not useful to us. Pretty much everything depends just on gmp.h,
dnl gmp-impl.h and longlong.h, and yet only rarely does everything need to
dnl be rebuilt for changes to those files.
dnl
dnl "no-dependencies" also helps with the way we're setup to run
dnl AC_PROG_CXX only conditionally. If dependencies are used then recent
dnl automake (eg 1.7.2) appends an AM_CONDITIONAL to AC_PROG_CXX, and then
dnl gets upset if it's not actually executed.
dnl
dnl Note that there's a copy of these options in the top-level Makefile.am,
dnl so update there too if changing anything.
dnl
AM_INIT_AUTOMAKE([1.8 gnu no-dependencies subdir-objects])
AC_CONFIG_HEADERS(config.h:config.in)
AM_MAINTAINER_MODE
AC_ARG_ENABLE(assert,
AC_HELP_STRING([--enable-assert],[enable ASSERT checking [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-assert, need yes or no]) ;;
esac],
[enable_assert=no])
if test "$enable_assert" = "yes"; then
AC_DEFINE(WANT_ASSERT,1,
[Define to 1 to enable ASSERT checking, per --enable-assert])
want_assert_01=1
else
want_assert_01=0
fi
GMP_DEFINE_RAW(["define(<WANT_ASSERT>,$want_assert_01)"])
AC_ARG_ENABLE(alloca,
AC_HELP_STRING([--enable-alloca],[how to get temp memory [default=reentrant]]),
[case $enableval in
alloca|malloc-reentrant|malloc-notreentrant) ;;
yes|no|reentrant|notreentrant) ;;
debug) ;;
*)
AC_MSG_ERROR([bad value $enableval for --enable-alloca, need one of:
yes no reentrant notreentrant alloca malloc-reentrant malloc-notreentrant debug]) ;;
esac],
[enable_alloca=reentrant])
# IMPROVE ME: The default for C++ is disabled. The tests currently
# performed below for a working C++ compiler are not particularly strong,
# and in general can't be expected to get the right setup on their own. The
# most significant problem is getting the ABI the same. Defaulting CXXFLAGS
# to CFLAGS takes only a small step towards this. It's also probably worth
# worrying whether the C and C++ runtimes from say gcc and a vendor C++ can
# work together. Some rather broken C++ installations were encountered
# during testing, and though such things clearly aren't GMP's problem, if
# --enable-cxx=detect were to be the default then some careful checks of
# which, if any, C++ compiler on the system is up to scratch would be
# wanted.
#
AC_ARG_ENABLE(cxx,
AC_HELP_STRING([--enable-cxx],[enable C++ support [default=no]]),
[case $enableval in
yes|no|detect) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-cxx, need yes/no/detect]) ;;
esac],
[enable_cxx=no])
AC_ARG_ENABLE(assembly,
AC_HELP_STRING([--enable-assembly],[enable the use of assembly loops [default=yes]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-assembly, need yes or no]) ;;
esac],
[enable_assembly=yes])
AC_ARG_ENABLE(fft,
AC_HELP_STRING([--enable-fft],[enable FFTs for multiplication [default=yes]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-fft, need yes or no]) ;;
esac],
[enable_fft=yes])
if test "$enable_fft" = "yes"; then
AC_DEFINE(WANT_FFT,1,
[Define to 1 to enable FFTs for multiplication, per --enable-fft])
fi
AC_ARG_ENABLE(old-fft-full,
AC_HELP_STRING([--enable-old-fft-full],[enable old mpn_mul_fft_full for multiplicati on [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-old-fft-full, need yes or no]) ;;
esac],
[enable_old_fft_full=no])
if test "$enable_old_fft_full" = "yes"; then
AC_DEFINE(WANT_OLD_FFT_FULL,1,
[Define to 1 to enable old mpn_mul_fft_full for multiplication, per --enable-old-fft-full])
fi
AC_ARG_ENABLE(nails,
AC_HELP_STRING([--enable-nails],[use nails on limbs [default=no]]),
[case $enableval in
[yes|no|[02468]|[0-9][02468]]) ;;
[*[13579]])
AC_MSG_ERROR([bad value $enableval for --enable-nails, only even nail sizes supported]) ;;
*)
AC_MSG_ERROR([bad value $enableval for --enable-nails, need yes/no/number]) ;;
esac],
[enable_nails=no])
case $enable_nails in
yes) GMP_NAIL_BITS=2 ;;
no) GMP_NAIL_BITS=0 ;;
*) GMP_NAIL_BITS=$enable_nails ;;
esac
AC_SUBST(GMP_NAIL_BITS)
AC_ARG_ENABLE(profiling,
AC_HELP_STRING([--enable-profiling],
[build with profiler support [default=no]]),
[case $enableval in
no|prof|gprof|instrument) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-profiling, need no/prof/gprof/instrument]) ;;
esac],
[enable_profiling=no])
case $enable_profiling in
prof)
AC_DEFINE(WANT_PROFILING_PROF, 1,
[Define to 1 if --enable-profiling=prof])
;;
gprof)
AC_DEFINE(WANT_PROFILING_GPROF, 1,
[Define to 1 if --enable-profiling=gprof])
;;
instrument)
AC_DEFINE(WANT_PROFILING_INSTRUMENT, 1,
[Define to 1 if --enable-profiling=instrument])
;;
esac
GMP_DEFINE_RAW(["define(<WANT_PROFILING>,<\`$enable_profiling'>)"])
# -fomit-frame-pointer is incompatible with -pg on some chips
if test "$enable_profiling" = gprof; then
fomit_frame_pointer=
else
fomit_frame_pointer="-fomit-frame-pointer"
fi
AC_ARG_WITH(readline,
AC_HELP_STRING([--with-readline],
[readline support in demo programs [default=detect]]),
[case $withval in
yes|no|detect) ;;
*) AC_MSG_ERROR([bad value $withval for --with-readline, need yes/no/detect]) ;;
esac],
[with_readline=detect])
AC_ARG_ENABLE(fat,
AC_HELP_STRING([--enable-fat],
[build fat libraries on systems that support it [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-fat, need yes or no]) ;;
esac],
[enable_fat=no])
AC_ARG_ENABLE(minithres,
AC_HELP_STRING([--enable-minithres],
[choose minimal thresholds for testing [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-minithres, need yes or no]) ;;
esac],
[enable_minithres=no])
AC_ARG_ENABLE(fake-cpuid,
AC_HELP_STRING([--enable-fake-cpuid],[enable GMP_CPU_TYPE faking cpuid [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-fake-cpuid, need yes or no]) ;;
esac],
[enable_fake_cpuid=no])
if test "$enable_fake_cpuid" = "yes"; then
AC_DEFINE(WANT_FAKE_CPUID,1,
[Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid])
fi
if test $enable_fat = yes && test $enable_assembly = no ; then
AC_MSG_ERROR([when doing a fat build, disabling assembly will not work])
fi
if test $enable_fake_cpuid = yes && test $enable_fat = no ; then
AC_MSG_ERROR([--enable-fake-cpuid requires --enable-fat])
fi
tmp_host=`echo $host_cpu | sed 's/\./_/'`
AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_$tmp_host)
GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_HOST_CPU_$tmp_host')", POST)
dnl The HAVE_HOST_CPU_ list here only needs to have entries for those which
dnl are going to be tested, not everything that can possibly be selected.
dnl
dnl The HAVE_HOST_CPU_FAMILY_ list similarly, and note that the AC_DEFINEs
dnl for these are under the cpu specific setups below.
AH_VERBATIM([HAVE_HOST_CPU_1],
[/* Define one of these to 1 for the host CPU family.
If your CPU is not in any of these families, leave all undefined.
For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
#undef HAVE_HOST_CPU_FAMILY_alpha
#undef HAVE_HOST_CPU_FAMILY_m68k
#undef HAVE_HOST_CPU_FAMILY_power
#undef HAVE_HOST_CPU_FAMILY_powerpc
#undef HAVE_HOST_CPU_FAMILY_x86
#undef HAVE_HOST_CPU_FAMILY_x86_64
/* Define one of the following to 1 for the host CPU, as per the output of
./config.guess. If your CPU is not listed here, leave all undefined. */
#undef HAVE_HOST_CPU_alphaev67
#undef HAVE_HOST_CPU_alphaev68
#undef HAVE_HOST_CPU_alphaev7
#undef HAVE_HOST_CPU_m68020
#undef HAVE_HOST_CPU_m68030
#undef HAVE_HOST_CPU_m68040
#undef HAVE_HOST_CPU_m68060
#undef HAVE_HOST_CPU_m68360
#undef HAVE_HOST_CPU_powerpc604
#undef HAVE_HOST_CPU_powerpc604e
#undef HAVE_HOST_CPU_powerpc750
#undef HAVE_HOST_CPU_powerpc7400
#undef HAVE_HOST_CPU_supersparc
#undef HAVE_HOST_CPU_i386
#undef HAVE_HOST_CPU_i586
#undef HAVE_HOST_CPU_i686
#undef HAVE_HOST_CPU_pentium
#undef HAVE_HOST_CPU_pentiummmx
#undef HAVE_HOST_CPU_pentiumpro
#undef HAVE_HOST_CPU_pentium2
#undef HAVE_HOST_CPU_pentium3
#undef HAVE_HOST_CPU_pentium4
#undef HAVE_HOST_CPU_core2
#undef HAVE_HOST_CPU_nehalem
#undef HAVE_HOST_CPU_westmere
#undef HAVE_HOST_CPU_sandybridge
#undef HAVE_HOST_CPU_ivybridge
#undef HAVE_HOST_CPU_haswell
#undef HAVE_HOST_CPU_broadwell
#undef HAVE_HOST_CPU_skylake
#undef HAVE_HOST_CPU_silvermont
#undef HAVE_HOST_CPU_goldmont
#undef HAVE_HOST_CPU_tremont
#undef HAVE_HOST_CPU_k8
#undef HAVE_HOST_CPU_k10
#undef HAVE_HOST_CPU_bulldozer
#undef HAVE_HOST_CPU_piledriver
#undef HAVE_HOST_CPU_steamroller
#undef HAVE_HOST_CPU_excavator
#undef HAVE_HOST_CPU_zen
#undef HAVE_HOST_CPU_bobcat
#undef HAVE_HOST_CPU_jaguar
#undef HAVE_HOST_CPU_s390_z900
#undef HAVE_HOST_CPU_s390_z990
#undef HAVE_HOST_CPU_s390_z9
#undef HAVE_HOST_CPU_s390_z10
#undef HAVE_HOST_CPU_s390_z196
#undef HAVE_HOST_CPU_s390_z13
#undef HAVE_HOST_CPU_s390_z14
#undef HAVE_HOST_CPU_s390_z15
/* Define to 1 iff we have a s390 with 64-bit registers. */
#undef HAVE_HOST_CPU_s390_zarch])
# Table of compilers, options, and mpn paths. This code has various related
# purposes
#
# - better default CC/CFLAGS selections than autoconf otherwise gives
# - default CC/CFLAGS selections for extra CPU types specific to GMP
# - a few tests for known bad compilers
# - choice of ABIs on suitable systems
# - selection of corresponding mpn search path
#
# After GMP specific searches and tests, the standard autoconf AC_PROG_CC is
# called. User selections of CC etc are respected.
#
# Care is taken not to use macros like AC_TRY_COMPILE during the GMP
# pre-testing, since they of course depend on AC_PROG_CC, and also some of
# them cache their results, which is not wanted.
#
# The ABI selection mechanism is unique to GMP. All that reaches autoconf
# is a different selection of CC/CFLAGS according to the best ABI the system
# supports, and/or what the user selects. Naturally the mpn assembler code
# selected is very dependent on the ABI.
#
# The closest the standard tools come to a notion of ABI is something like
# "sparc64" which encodes a CPU and an ABI together. This doesn't seem to
# scale well for GMP, where exact CPU types like "ultrasparc2" are wanted,
# separate from the ABI used on them.
#
#
# The variables set here are
#
# cclist the compiler choices
# xx_cflags flags for compiler xx
# xx_cflags_maybe flags for compiler xx, if they work
# xx_cppflags cpp flags for compiler xx
# xx_cflags_optlist list of sets of optional flags
# xx_cflags_yyy set yyy of optional flags for compiler xx
# xx_ldflags -Wc,-foo flags for libtool linking with compiler xx
# ar_flags extra flags for $AR
# nm_flags extra flags for $NM
# limb limb size, can be "longlong"
# path mpn search path
# extra_functions extra mpn functions
# fat_path fat binary mpn search path [if fat binary desired]
# fat_functions fat functions
# fat_thresholds fat thresholds
#
# Suppose xx_cflags_optlist="arch", then flags from $xx_cflags_arch are
# tried, and the first flag that works will be used. An optlist like "arch
# cpu optimize" can be used to get multiple independent sets of flags tried.
# The first that works from each will be used. If no flag in a set works
# then nothing from that set is added.
#
# For multiple ABIs, the scheme extends as follows.
#
# abilist set of ABI choices
# cclist_aa compiler choices in ABI aa
# xx_aa_cflags flags for xx in ABI aa
# xx_aa_cflags_maybe flags for xx in ABI aa, if they work
# xx_aa_cppflags cpp flags for xx in ABI aa
# xx_aa_cflags_optlist list of sets of optional flags in ABI aa
# xx_aa_cflags_yyy set yyy of optional flags for compiler xx in ABI aa
# xx_aa_ldflags -Wc,-foo flags for libtool linking
# ar_aa_flags extra flags for $AR in ABI aa
# nm_aa_flags extra flags for $NM in ABI aa
# limb_aa limb size in ABI aa, can be "longlong"
# path_aa mpn search path in ABI aa
# extra_functions_aa extra mpn functions in ABI aa
#
# As a convenience, the unadorned xx_cflags (etc) are used for the last ABI
# in ablist, if an xx_aa_cflags for that ABI isn't given. For example if
# abilist="64 32" then $cc_64_cflags will be used for the 64-bit ABI, but
# for the 32-bit either $cc_32_cflags or $cc_cflags is used, whichever is
# defined. This makes it easy to add some 64-bit compilers and flags to an
# unadorned 32-bit set.
#
# limb=longlong (or limb_aa=longlong) applies to all compilers within that
# ABI. It won't work to have some needing long long and some not, since a
# single instantiated gmp.h will be used by both.
#
# SPEED_CYCLECOUNTER, cyclecounter_size and CALLING_CONVENTIONS_OBJS are
# also set here, with an ABI suffix.
#
#
#
# A table-driven approach like this to mapping cpu type to good compiler
# options is a bit of a maintenance burden, but there's not much uniformity
# between options specifications on different compilers. Some sort of
# separately updatable tool might be cute.
#
# The use of lots of variables like this, direct and indirect, tends to
# obscure when and how various things are done, but unfortunately it's
# pretty much the only way. If shell subroutines were portable then actual
# code like "if this .. do that" could be written, but attempting the same
# with full copies of GMP_PROG_CC_WORKS etc expanded at every point would
# hugely bloat the output.
AC_ARG_VAR(ABI, [desired ABI (for processors supporting more than one ABI)])
# abilist needs to be non-empty, "standard" is just a generic name here
abilist="standard"
# FIXME: We'd like to prefer an ANSI compiler, perhaps by preferring
# c89 over cc here. But note that on HP-UX c89 provides a castrated
# environment, and would want to be excluded somehow. Maybe
# AC_PROG_CC_STDC already does enough to stick cc into ANSI mode and
# we don't need to worry.
#
cclist="gcc cc"
gcc_cflags="-O2 -pedantic"
gcc_64_cflags="-O2 -pedantic"
cc_cflags="-O"
cc_64_cflags="-O"
SPEED_CYCLECOUNTER_OBJ=
cyclecounter_size=2
AC_SUBST(HAVE_HOST_CPU_FAMILY_power, 0)
AC_SUBST(HAVE_HOST_CPU_FAMILY_powerpc,0)
case $host in
alpha*-*-*)
AC_DEFINE(HAVE_HOST_CPU_FAMILY_alpha)
case $host_cpu in
alphaev5* | alphapca5*)
path="alpha/ev5 alpha" ;;
alphaev67 | alphaev68 | alphaev7*)
path="alpha/ev67 alpha/ev6 alpha" ;;
alphaev6)
path="alpha/ev6 alpha" ;;
*)
path="alpha" ;;
esac
if test "$enable_assembly" = "yes" ; then
extra_functions="cntlz"
fi
gcc_cflags_optlist="asm cpu oldas" # need asm ahead of cpu, see below
gcc_cflags_maybe="-mieee"
gcc_cflags_oldas="-Wa,-oldas" # see GMP_GCC_WA_OLDAS.
# gcc 2.7.2.3 doesn't know any -mcpu= for alpha, apparently.
# gcc 2.95 knows -mcpu= ev4, ev5, ev56, pca56, ev6.
# gcc 3.0 adds nothing.
# gcc 3.1 adds ev45, ev67 (but ev45 is the same as ev4).
# gcc 3.2 adds nothing.
#
# gcc version "2.9-gnupro-99r1" under "-O2 -mcpu=ev6" strikes internal
# compiler errors too easily and is rejected by GMP_PROG_CC_WORKS. Each
# -mcpu=ev6 below has a fallback to -mcpu=ev56 for this reason.
#
case $host_cpu in
alpha) gcc_cflags_cpu="-mcpu=ev4" ;;
alphaev5) gcc_cflags_cpu="-mcpu=ev5" ;;
alphaev56) gcc_cflags_cpu="-mcpu=ev56" ;;
alphapca56 | alphapca57)
gcc_cflags_cpu="-mcpu=pca56" ;;
alphaev6) gcc_cflags_cpu="-mcpu=ev6 -mcpu=ev56" ;;
alphaev67 | alphaev68 | alphaev7*)
gcc_cflags_cpu="-mcpu=ev67 -mcpu=ev6 -mcpu=ev56" ;;
esac
# gcc version "2.9-gnupro-99r1" on alphaev68-dec-osf5.1 has been seen
# accepting -mcpu=ev6, but not putting the assembler in the right mode
# for what it produces. We need to do this for it, and need to do it
# before testing the -mcpu options.
#
# On old versions of gcc, which don't know -mcpu=, we believe an
# explicit -Wa,-mev5 etc will be necessary to put the assembler in
# the right mode for our .asm files and longlong.h asm blocks.
#
# On newer versions of gcc, when -mcpu= is known, we must give a -Wa
# which is at least as high as the code gcc will generate. gcc
# establishes what it needs with a ".arch" directive, our command line
# option seems to override that.
#
# gas prior to 2.14 doesn't accept -mev67, but -mev6 seems enough for
# ctlz and cttz (in 2.10.0 at least).
#
# OSF `as' accepts ev68 but stupidly treats it as ev4. -arch only seems
# to affect insns like ldbu which are expanded as macros when necessary.
# Insns like ctlz which were never available as macros are always
# accepted and always generate their plain code.
#
case $host_cpu in
alpha) gcc_cflags_asm="-Wa,-arch,ev4 -Wa,-mev4" ;;
alphaev5) gcc_cflags_asm="-Wa,-arch,ev5 -Wa,-mev5" ;;
alphaev56) gcc_cflags_asm="-Wa,-arch,ev56 -Wa,-mev56" ;;
alphapca56 | alphapca57)
gcc_cflags_asm="-Wa,-arch,pca56 -Wa,-mpca56" ;;
alphaev6) gcc_cflags_asm="-Wa,-arch,ev6 -Wa,-mev6" ;;
alphaev67 | alphaev68 | alphaev7*)
gcc_cflags_asm="-Wa,-arch,ev67 -Wa,-mev67 -Wa,-arch,ev6 -Wa,-mev6" ;;
esac
# It might be better to ask "cc" whether it's Cray C or DEC C,
# instead of relying on the OS part of $host. But it's hard to
# imagine either of those compilers anywhere except their native
# systems.
#
GMP_INCLUDE_MPN(alpha/alpha-defs.m4)
case $host in
*-cray-unicos*)
cc_cflags="-O" # no -g, it silently disables all optimizations
GMP_INCLUDE_MPN(alpha/unicos.m4)
# Don't perform any assembly syntax tests on this beast.
gmp_asm_syntax_testing=no
;;
*-*-osf*)
GMP_INCLUDE_MPN(alpha/default.m4)
cc_cflags=""
cc_cflags_optlist="opt cpu"
# not sure if -fast works on old versions, so make it optional
cc_cflags_opt="-fast -O2"
# DEC C V5.9-005 knows ev4, ev5, ev56, pca56, ev6.
# Compaq C V6.3-029 adds ev67.
#
case $host_cpu in
alpha) cc_cflags_cpu="-arch~ev4~-tune~ev4" ;;
alphaev5) cc_cflags_cpu="-arch~ev5~-tune~ev5" ;;
alphaev56) cc_cflags_cpu="-arch~ev56~-tune~ev56" ;;
alphapca56 | alphapca57)
cc_cflags_cpu="-arch~pca56~-tune~pca56" ;;
alphaev6) cc_cflags_cpu="-arch~ev6~-tune~ev6" ;;
alphaev67 | alphaev68 | alphaev7*)
cc_cflags_cpu="-arch~ev67~-tune~ev67 -arch~ev6~-tune~ev6" ;;
esac
;;
*)
GMP_INCLUDE_MPN(alpha/default.m4)
;;
esac
case $host in
*-*-unicos*)
# tune/alpha.asm assumes int==4bytes but unicos uses int==8bytes
;;
*)
SPEED_CYCLECOUNTER_OBJ=alpha.lo
cyclecounter_size=1 ;;
esac
;;
# Cray vector machines.
# This must come after alpha* so that we can recognize present and future
# vector processors with a wildcard.
*-cray-unicos*)
gmp_asm_syntax_testing=no
cclist="cc"
# We used to have -hscalar0 here as a workaround for miscompilation of
# mpz/import.c, but let's hope Cray fixes their bugs instead, since
# -hscalar0 causes disastrously poor code to be generated.
cc_cflags="-O3 -hnofastmd -htask0 -Wa,-B"
path="cray"
;;
arm*-*-* | aarch64*-*-* | [applem[1-9]-*-*])
abilist="32"
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_cflags_optlist="arch fpmode neon tune"
gcc_64_cflags_optlist="arch tune"
gcc_testlist="gcc-arm-umodsi"
gcc_64_testlist=""
CALLING_CONVENTIONS_OBJS='arm32call.lo arm32check.lo'
CALLING_CONVENTIONS_OBJS_64=""
cclist_64="gcc cc"
any_32_testlist="sizeof-void*-4"
any_64_testlist="sizeof-void*-8"
# This is needed for clang, which is not content with flags like -mfpu=neon
# alone.
case $host in
*-*-*eabi)
gcc_cflags_fpmode="-mfloat-abi=softfp" ;;
*-*-*eabihf)
gcc_cflags_fpmode="-mfloat-abi=hard" ;;
*-*-mingw*)
limb_64=longlong ;;
esac
# FIXME: We make mandatory compiler options optional here. We should
# either enforce them, or organise to strip paths as the corresponding
# options fail.
case $host_cpu in
armxscale | arm7ej | arm9te | arm9e* | arm10* | armv5*)
path="arm/v5 arm"
gcc_cflags_arch="-march=armv5"
;;
armsa1 | arm7t* | arm9t* | armv4t*)
path="arm"
gcc_cflags_arch="-march=armv4"
;;
arm1156 | armv6t2*)
path="arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv6t2"
;;
arm11* | armv6*)
path="arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv6"
;;
armcortexa5 | armv7*)
path="arm/v7a/cora5 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a5"
;;
armcortexa5neon)
path="arm/neon arm/v7a/cora5 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a5"
;;
armcortexa7)
path="arm/v7a/cora7 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a7"
;;
armcortexa7neon)
path="arm/neon arm/v7a/cora7 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a7"
;;
armcortexa8)
path="arm/v7a/cora8 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a8"
;;
armcortexa8neon)
path="arm/neon arm/v7a/cora8 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a8"
;;
armcortexa9)
path="arm/v7a/cora9 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a9"
;;
armcortexa9neon)
path="arm/neon arm/v7a/cora9 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a9"
;;
armcortexa15)
path="arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
;;
armcortexa15neon)
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
;;
armcortexa12 | armcortexa17)
path="arm/v7a/cora17 arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
;;
armcortexa12neon | armcortexa17neon)
path="arm/v7a/cora17/neon arm/v7a/cora15/neon arm/neon arm/v7a/cora17 arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
;;
armcortexa53 | armcortexa53neon | armcortexa55 | armcortexa55neon)
abilist="64 32"
path="arm/neon arm/v7a/cora9 arm/v6t2 arm/v6 arm/v5 arm"
path_64="arm64/cora53 arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a53"
;;
armcortexa57 | armcortexa57neon)
abilist="64 32"
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
path_64="arm64/cora57 arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a57"
;;
[armcortexa7[2-9] | armcortexa7[2-9]neon])
abilist="64 32"
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
path_64="arm64/cora57 arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a72 -mtune=cortex-a57"
;;
armexynosm1)
abilist="64 32"
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
path_64="arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=exynosm1"
;;
armthunderx)
abilist="64 32"
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
path_64="arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=thunderx"
;;
armxgene1)
abilist="64 32"
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
path_64="arm64/xgene1 arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=xgene1"
;;
aarch64*)
abilist="64 32"
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
path_64="arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune=""
;;
[applem[1-9]*])
abilist="64"
path_64="arm64/applem1 arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune=""
CALLING_CONVENTIONS_OBJS=""
;;
*)
path="arm"
gcc_cflags_arch="-march=armv4"
GMP_DEFINE_RAW(["define(<NOTHUMB>,1)"])
;;
esac
;;
# Fujitsu
[f30[01]-fujitsu-sysv*])
cclist="gcc vcc"
# FIXME: flags for vcc?
vcc_cflags="-g"
path="fujitsu"
;;
hppa*-*-*)
# HP cc (the one sold separately) is K&R by default, but AM_C_PROTOTYPES
# will add "-Ae", or "-Aa -D_HPUX_SOURCE", to put it into ansi mode, if
# possible.
#
# gcc for hppa 2.0 can be built either for 2.0n (32-bit) or 2.0w
# (64-bit), but not both, so there's no option to choose the desired
# mode, we must instead detect which of the two it is. This is done by
# checking sizeof(long), either 4 or 8 bytes respectively. Do this in
# ABI=1.0 too, in case someone tries to build that with a 2.0w gcc.
#
gcc_cflags_optlist="arch"
gcc_testlist="sizeof-long-4"
SPEED_CYCLECOUNTER_OBJ=hppa.lo
cyclecounter_size=1
# FIXME: For hppa2.0*, path should be "pa32/hppa2_0 pa32/hppa1_1 pa32".
# (Can't remember why this isn't done already, have to check what .asm
# files are available in each and how they run on a typical 2.0 cpu.)
#
case $host_cpu in
hppa1.0*) path="pa32" ;;
hppa7000*) path="pa32/hppa1_1 pa32" ;;
hppa2.0* | hppa64)
path="pa32/hppa2_0 pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32" ;;
*) # default to 7100
path="pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32" ;;
esac
# gcc 2.7.2.3 knows -mpa-risc-1-0 and -mpa-risc-1-1
# gcc 2.95 adds -mpa-risc-2-0, plus synonyms -march=1.0, 1.1 and 2.0
#
# We don't use -mpa-risc-2-0 in ABI=1.0 because 64-bit registers may not
# be saved by the kernel on an old system. Actually gcc (as of 3.2)
# only adds a few float instructions with -mpa-risc-2-0, so it would
# probably be safe, but let's not take the chance. In any case, a
# configuration like --host=hppa2.0 ABI=1.0 is far from optimal.
#
case $host_cpu in
hppa1.0*) gcc_cflags_arch="-mpa-risc-1-0" ;;
*) # default to 7100
gcc_cflags_arch="-mpa-risc-1-1" ;;
esac
case $host_cpu in
hppa1.0*) cc_cflags="+O2" ;;
*) # default to 7100
cc_cflags="+DA1.1 +O2" ;;
esac
case $host in
hppa2.0*-*-* | hppa64-*-*)
cclist_20n="gcc cc"
abilist="2.0n 1.0"
path_20n="pa64"
limb_20n=longlong
any_20n_testlist="sizeof-long-4"
SPEED_CYCLECOUNTER_OBJ_20n=hppa2.lo
cyclecounter_size_20n=2
# -mpa-risc-2-0 is only an optional flag, in case an old gcc is
# used. Assembler support for 2.0 is essential though, for our asm
# files.
gcc_20n_cflags="$gcc_cflags"
gcc_20n_cflags_optlist="arch"
gcc_20n_cflags_arch="-mpa-risc-2-0 -mpa-risc-1-1"
gcc_20n_testlist="sizeof-long-4 hppa-level-2.0"
cc_20n_cflags="+DA2.0 +e +O2 -Wl,+vnocompatwarnings"
cc_20n_testlist="hpc-hppa-2-0"
# ABI=2.0w is available for hppa2.0w and hppa2.0, but not for
# hppa2.0n, on the assumption that that the latter indicates a
# desire for ABI=2.0n.
case $host in
hppa2.0n-*-*) ;;
*)
# HPUX 10 and earlier cannot run 2.0w. Not sure about other
# systems (GNU/Linux for instance), but lets assume they're ok.
case $host in
[*-*-hpux[1-9] | *-*-hpux[1-9].* | *-*-hpux10 | *-*-hpux10.*]) ;;
*) abilist="2.0w $abilist" ;;
esac
cclist_20w="gcc cc"
gcc_20w_cflags="$gcc_cflags -mpa-risc-2-0"
cc_20w_cflags="+DD64 +O2"
cc_20w_testlist="hpc-hppa-2-0"
path_20w="pa64"
any_20w_testlist="sizeof-long-8"
SPEED_CYCLECOUNTER_OBJ_20w=hppa2w.lo
cyclecounter_size_20w=2
;;
esac
;;
esac
;;
IA64_PATTERN)
abilist="64"
GMP_INCLUDE_MPN(ia64/ia64-defs.m4)
SPEED_CYCLECOUNTER_OBJ=ia64.lo
any_32_testlist="sizeof-long-4"
case $host_cpu in
itanium) path="ia64/itanium ia64" ;;
itanium2) path="ia64/itanium2 ia64" ;;
*) path="ia64" ;;
esac
gcc_64_cflags_optlist="tune"
gcc_32_cflags_optlist=$gcc_64_cflags_optlist
# gcc pre-release 3.4 adds -mtune itanium and itanium2
case $host_cpu in
itanium) gcc_cflags_tune="-mtune=itanium" ;;
itanium2) gcc_cflags_tune="-mtune=itanium2" ;;
esac
case $host in
*-*-linux*)
cclist="gcc icc"
icc_cflags="-no-gcc"
icc_cflags_optlist="opt"
# Don't use -O3, it is for "large data sets" and also miscompiles GMP.
# But icc miscompiles GMP at any optimization level, at higher levels
# it miscompiles more files...
icc_cflags_opt="-O2 -O1"
icc_cflags_opt_maybe="-fp-model~precise"
;;
*-*-hpux*)
# HP cc sometimes gets internal errors if the optimization level is
# too high. GMP_PROG_CC_WORKS detects this, the "_opt" fallbacks
# let us use whatever seems to work.
#
abilist="32 64"
any_64_testlist="sizeof-long-8"
cclist_32="gcc cc"
path_32="ia64"
cc_32_cflags=""
cc_32_cflags_optlist="opt"
cc_32_cflags_opt="+O2 +O1"
gcc_32_cflags="$gcc_cflags -milp32"
limb_32=longlong
SPEED_CYCLECOUNTER_OBJ_32=ia64.lo
cyclecounter_size_32=2
# Must have +DD64 in CPPFLAGS to get the right __LP64__ for headers,
# but also need it in CFLAGS for linking programs, since automake
# only uses CFLAGS when linking, not CPPFLAGS.
# FIXME: Maybe should use cc_64_ldflags for this, but that would
# need GMP_LDFLAGS used consistently by all the programs.
#
cc_64_cflags="+DD64"
cc_64_cppflags="+DD64"
cc_64_cflags_optlist="opt"
cc_64_cflags_opt="+O2 +O1"
gcc_64_cflags="$gcc_cflags -mlp64"
;;
esac
;;
# Motorola 68k
#
M68K_PATTERN)
AC_DEFINE(HAVE_HOST_CPU_FAMILY_m68k)
GMP_INCLUDE_MPN(m68k/m68k-defs.m4)
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_cflags_optlist="arch"
# gcc 2.7.2 knows -m68000, -m68020, -m68030, -m68040.
# gcc 2.95 adds -mcpu32, -m68060.
# FIXME: Maybe "-m68020 -mnobitfield" would suit cpu32 on 2.7.2.
#
case $host_cpu in
m68020) gcc_cflags_arch="-m68020" ;;
m68030) gcc_cflags_arch="-m68030" ;;
m68040) gcc_cflags_arch="-m68040" ;;
m68060) gcc_cflags_arch="-m68060 -m68000" ;;
m68360) gcc_cflags_arch="-mcpu32 -m68000" ;;
*) gcc_cflags_arch="-m68000" ;;
esac
# FIXME: m68k/mc68020 looks like it's ok for cpu32, but this wants to be
# tested. Will need to introduce an m68k/cpu32 if m68k/mc68020 ever uses
# the bitfield instructions.
case $host_cpu in
[m680[234]0 | m68360]) path="m68k/mc68020 m68k" ;;
*) path="m68k" ;;
esac
;;
# Motorola 88k
m88k*-*-*)
path="m88k"
;;
m88110*-*-*)
gcc_cflags="$gcc_cflags -m88110"
path="m88k/mc88110 m88k"
;;
loongarch64-*-*)
path="loongarch/64"
;;
# IRIX 5 and earlier can only run 32-bit o32.
#
# IRIX 6 and up always has a 64-bit mips CPU can run n32 or 64. n32 is
# preferred over 64, but only because that's been the default in past
# versions of GMP. The two are equally efficient.
#
# Linux kernel 2.2.13 arch/mips/kernel/irixelf.c has a comment about not
# supporting n32 or 64.
#
# For reference, libtool (eg. 1.5.6) recognises the n32 ABI and knows the
# right options to use when linking (both cc and gcc), so no need for
# anything special from us.
#
mips*-*-*)
abilist="o32"
gcc_cflags_optlist="abi"
gcc_cflags_abi="-mabi=32 -m32"
gcc_testlist="gcc-mips-o32"
path="mips32"
cc_cflags="-O2 -o32" # no -g, it disables all optimizations
# this suits both mips32 and mips64
GMP_INCLUDE_MPN(mips32/mips-defs.m4)
case $host in
[mips64*-*-* | mipsisa64*-*-* | mips*-*-irix[6789]*])
abilist="n32 64 o32"
cclist_n32="gcc cc"
gcc_n32_cflags_optlist="abi"
gcc_n32_cflags="$gcc_cflags"
gcc_n32_cflags_abi="-mabi=n32 -mn32"
cc_n32_cflags="-O2 -n32" # no -g, it disables all optimizations
limb_n32=longlong
cclist_64="gcc cc"
gcc_64_cflags_optlist="abi"
gcc_64_cflags="$gcc_cflags"
gcc_64_cflags_abi="-mabi=64 -m64"
gcc_64_ldflags="-Wc,-mabi=64"
cc_64_cflags="-O2 -64" # no -g, it disables all optimizations
cc_64_ldflags="-Wc,-64"
case $host_cpu in
[mips64r[6789]* | mipsisa64r[6789]*])
path_n32="mips64/r6 mips64"
path_64="mips64/r6 mips64"
;;
*)
path_n32="mips64/hilo mips64"
path_64="mips64/hilo mips64"
;;
esac
;;
esac
;;
# Darwin (powerpc-apple-darwin1.3) has it's hacked gcc installed as cc.
# Our usual "gcc in disguise" detection means gcc_cflags etc here gets
# used.
#
# The darwin pre-compiling preprocessor is disabled with -no-cpp-precomp
# since it doesn't like "__attribute__ ((mode (SI)))" etc in gmp-impl.h,
# and so always ends up running the plain preprocessor anyway. This could
# be done in CPPFLAGS rather than CFLAGS, but there's not many places
# preprocessing is done separately, and this is only a speedup, the normal
# preprocessor gets run if there's any problems.
#
# We used to use -Wa,-mppc with gcc, but can't remember exactly why.
# Presumably it was for old versions of gcc where -mpowerpc doesn't put
# the assembler in the right mode. In any case -Wa,-mppc is not good, for
# instance -mcpu=604 makes recent gcc use -m604 to get access to the
# "fsel" instruction, but a -Wa,-mppc overrides that, making code that
# comes out with fsel fail.
#
# (Note also that the darwin assembler doesn't accept "-mppc", so any
# -Wa,-mppc was used only if it worked. The right flag on darwin would be
# "-arch ppc" or some such, but that's already the default.)
#
[powerpc*-*-* | power[3-9]-*-* | power1[0-9]-*-*])
AC_DEFINE(HAVE_HOST_CPU_FAMILY_powerpc)
HAVE_HOST_CPU_FAMILY_powerpc=1
abilist="32"
cclist="gcc cc"
cc_cflags="-O2"
gcc_32_cflags_maybe="-m32"
gcc_cflags_optlist="precomp subtype asm cpu"
gcc_cflags_precomp="-no-cpp-precomp"
gcc_cflags_subtype="-force_cpusubtype_ALL" # for vmx on darwin
gcc_cflags_asm=""
gcc_cflags_cpu=""
vmx_path=""
# grab this object, though it's not a true cycle counter routine
SPEED_CYCLECOUNTER_OBJ=powerpc.lo
cyclecounter_size=0
case $host_cpu in
powerpc740 | powerpc750)
path="powerpc32/750 powerpc32" ;;
powerpc7400 | powerpc7410)
path="powerpc32/vmx powerpc32/750 powerpc32" ;;
[powerpc74[45]?])
path="powerpc32/vmx powerpc32" ;;
*)
path="powerpc32" ;;
esac
case $host_cpu in
powerpc401) gcc_cflags_cpu="-mcpu=401" ;;
powerpc403) gcc_cflags_cpu="-mcpu=403"
xlc_cflags_arch="-qarch=403 -qarch=ppc" ;;
powerpc405) gcc_cflags_cpu="-mcpu=405" ;;
powerpc505) gcc_cflags_cpu="-mcpu=505" ;;
powerpc601) gcc_cflags_cpu="-mcpu=601"
xlc_cflags_arch="-qarch=601 -qarch=ppc" ;;
powerpc602) gcc_cflags_cpu="-mcpu=602"
xlc_cflags_arch="-qarch=602 -qarch=ppc" ;;
powerpc603) gcc_cflags_cpu="-mcpu=603"
xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
powerpc603e) gcc_cflags_cpu="-mcpu=603e -mcpu=603"
xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
powerpc604) gcc_cflags_cpu="-mcpu=604"
xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
powerpc604e) gcc_cflags_cpu="-mcpu=604e -mcpu=604"
xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
powerpc620) gcc_cflags_cpu="-mcpu=620" ;;
powerpc630) gcc_cflags_cpu="-mcpu=630"
xlc_cflags_arch="-qarch=pwr3"
cpu_path="p3 p3-p7" ;;
powerpc740) gcc_cflags_cpu="-mcpu=740" ;;
powerpc7400 | powerpc7410)
gcc_cflags_asm="-Wa,-maltivec"
gcc_cflags_cpu="-mcpu=7400 -mcpu=750" ;;
[powerpc74[45]?])
gcc_cflags_asm="-Wa,-maltivec"
gcc_cflags_cpu="-mcpu=7450" ;;
powerpc750) gcc_cflags_cpu="-mcpu=750" ;;
powerpc801) gcc_cflags_cpu="-mcpu=801" ;;
powerpc821) gcc_cflags_cpu="-mcpu=821" ;;
powerpc823) gcc_cflags_cpu="-mcpu=823" ;;
powerpc860) gcc_cflags_cpu="-mcpu=860" ;;
powerpc970) gcc_cflags_cpu="-mtune=970"
xlc_cflags_arch="-qarch=970 -qarch=pwr3"
vmx_path="powerpc64/vmx"
cpu_path="p4 p3-p7" ;;
power4) gcc_cflags_cpu="-mcpu=power4"
xlc_cflags_arch="-qarch=pwr4"
cpu_path="p4 p3-p7" ;;
power5) gcc_cflags_cpu="-mcpu=power5 -mcpu=power4"
xlc_cflags_arch="-qarch=pwr5"
cpu_path="p5 p4 p3-p7" ;;
power6) gcc_cflags_cpu="-mcpu=power6"
xlc_cflags_arch="-qarch=pwr6"
cpu_path="p6 p3-p7" ;;
power7) gcc_cflags_cpu="-mcpu=power7 -mcpu=power5"
xlc_cflags_arch="-qarch=pwr7 -qarch=pwr5"
cpu_path="p7 p5 p4 p3-p7" ;;
power8) gcc_cflags_cpu="-mcpu=power8 -mcpu=power7 -mcpu=power5"
xlc_cflags_arch="-qarch=pwr8 -qarch=pwr7 -qarch=pwr5"
cpu_path="p8 p7 p5 p4 p3-p7" ;;
power9) gcc_cflags_cpu="-mcpu=power9 -mcpu=power8 -mcpu=power7 -mcpu=power5"
xlc_cflags_arch="-qarch=pwr9 -qarch=pwr8 -qarch=pwr7 -qarch=pwr5"
cpu_path="p9 p8 p7 p5 p4 p3-p7" ;;
power10) gcc_cflags_cpu="-mcpu=power10 -mcpu=power9 -mcpu=power8 -mcpu=power7 -mcpu=power5"
xlc_cflags_arch="-qarch=pwr10 -qarch=pwr9 -qarch=pwr8 -qarch=pwr7 -qarch=pwr5"
cpu_path="p9 p8 p7 p5 p4 p3-p7" ;;
esac
case $host in
*-*-aix*)
cclist="gcc xlc cc"
gcc_32_cflags_maybe="-maix32"
xlc_cflags="-O2 -qmaxmem=20000"
xlc_cflags_optlist="arch"
xlc_32_cflags_maybe="-q32"
ar_32_flags="-X32"
nm_32_flags="-X32"
esac
case $host in
POWERPC64_PATTERN)
case $host in
*-*-aix*)
# On AIX a true 64-bit ABI is available.
# Need -Wc to pass object type flags through to the linker.
abilist="mode64 $abilist"
cclist_mode64="gcc xlc"
gcc_mode64_cflags="$gcc_cflags -maix64 -mpowerpc64"
gcc_mode64_cflags_optlist="cpu"
gcc_mode64_ldflags="-Wc,-maix64"
xlc_mode64_cflags="-O2 -q64 -qmaxmem=20000"
xlc_mode64_cflags_optlist="arch"
xlc_mode64_ldflags="-Wc,-q64"
# Must indicate object type to ar and nm
ar_mode64_flags="-X64"
nm_mode64_flags="-X64"
path_mode64=""
p=""
for i in $cpu_path
do path_mode64="${path_mode64}powerpc64/mode64/$i "
path_mode64="${path_mode64}powerpc64/$i "
p="${p} powerpc32/$i "
done
path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
path="$p $path"
# grab this object, though it's not a true cycle counter routine
SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
cyclecounter_size_mode64=0
;;
*-*-darwin*)
# On Darwin we can use 64-bit instructions with a longlong limb,
# but the chip still in 32-bit mode.
# In theory this can be used on any OS which knows how to save
# 64-bit registers in a context switch.
#
# Note that we must use -mpowerpc64 with gcc, since the
# longlong.h macros expect limb operands in a single 64-bit
# register, not two 32-bit registers as would be given for a
# long long without -mpowerpc64. In theory we could detect and
# accommodate both styles, but the proper 64-bit registers will
# be fastest and are what we really want to use.
#
# One would think -mpowerpc64 would set the assembler in the right
# mode to handle 64-bit instructions. But for that, also
# -force_cpusubtype_ALL is needed.
#
# Do not use -fast for Darwin, it actually adds options
# incompatible with a shared library.
#
abilist="mode64 mode32 $abilist"
gcc_cflags_opt="-O2 -O1" # will this become used?
cclist_mode32="gcc"
gcc_mode32_cflags_maybe="-m32"
gcc_mode32_cflags="-mpowerpc64"
gcc_mode32_cflags_optlist="subtype cpu opt"
gcc_mode32_cflags_subtype="-force_cpusubtype_ALL"
gcc_mode32_cflags_opt="-O2 -O1"
limb_mode32=longlong
cclist_mode64="gcc"
gcc_mode64_cflags="-m64"
gcc_mode64_cflags_optlist="cpu opt"
gcc_mode64_cflags_opt="-O2 -O1"
path_mode64=""
path_mode32=""
p=""
for i in $cpu_path
do path_mode64="${path_mode64}powerpc64/mode64/$i "
path_mode64="${path_mode64}powerpc64/$i "
path_mode32="${path_mode32}powerpc64/mode32/$i "
path_mode32="${path_mode32}powerpc64/$i "
p="${p} powerpc32/$i "
done
path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
path_mode32="${path_mode32}powerpc64/mode32 $vmx_path powerpc64"
path="$p $path"
SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
cyclecounter_size_mode64=0
any_mode64_testlist="sizeof-long-8"
;;
*-*-linux* | *-*-*bsd*)
# On GNU/Linux, assume the processor is in 64-bit mode. Some
# environments have a gcc that is always in 64-bit mode, while
# others require -m64, hence the use of cflags_maybe. The
# sizeof-long-8 test checks the mode is right (for the no option
# case).
#
# -mpowerpc64 is not used, since it should be the default in
# 64-bit mode. (We need its effect for the various longlong.h
# asm macros to be right of course.)
#
# gcc64 was an early port of gcc to 64-bit mode, but should be
# obsolete before too long. We prefer plain gcc when it knows
# 64-bits.
#
abilist="mode64 mode32 $abilist"
cclist_mode32="gcc"
gcc_mode32_cflags_maybe="-m32"
gcc_mode32_cflags="-mpowerpc64"
gcc_mode32_cflags_optlist="cpu opt"
gcc_mode32_cflags_opt="-O2 -O1"
limb_mode32=longlong
cclist_mode64="gcc gcc64"
gcc_mode64_cflags_maybe="-m64"
gcc_mode64_cflags_optlist="cpu opt"
gcc_mode64_cflags_opt="-O2 -O1"
path_mode64=""
path_mode32=""
p=""
for i in $cpu_path
do path_mode64="${path_mode64}powerpc64/mode64/$i "
path_mode64="${path_mode64}powerpc64/$i "
path_mode32="${path_mode32}powerpc64/mode32/$i "
path_mode32="${path_mode32}powerpc64/$i "
p="${p} powerpc32/$i "
done
path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
path_mode32="${path_mode32}powerpc64/mode32 $vmx_path powerpc64"
path="$p $path"
SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
cyclecounter_size_mode64=0
any_mode64_testlist="sizeof-long-8"
;;
esac
;;
esac
;;
# POWER 32-bit
[power-*-* | power[12]-*-* | power2sc-*-*])
AC_DEFINE(HAVE_HOST_CPU_FAMILY_power)
HAVE_HOST_CPU_FAMILY_power=1
cclist="gcc"
if test "$enable_assembly" = "yes" ; then
extra_functions="udiv_w_sdiv"
fi
path="power"
# gcc 2.7.2 knows rios1, rios2, rsc
#
# -mcpu=rios2 can tickle an AIX assembler bug (see GMP_PROG_CC_WORKS) so
# there needs to be a fallback to just -mpower.
#
gcc_cflags_optlist="cpu"
case $host in
power-*-*) gcc_cflags_cpu="-mcpu=power -mpower" ;;
power1-*-*) gcc_cflags_cpu="-mcpu=rios1 -mpower" ;;
power2-*-*) gcc_cflags_cpu="-mcpu=rios2 -mpower" ;;
power2sc-*-*) gcc_cflags_cpu="-mcpu=rsc -mpower" ;;
esac
case $host in
*-*-aix*)
cclist="gcc xlc"
xlc_cflags="-O2 -qarch=pwr -qmaxmem=20000"
;;
esac
;;
# RISC-V
[riscv64-*-*])
cclist="gcc"
path="riscv/64"
;;
# IBM System/390 and z/Architecture
S390_PATTERN | S390X_PATTERN)
abilist="32"
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_cflags_optlist="arch"
path="s390_32"
path_64="s390_64"
if test "$enable_assembly" = "yes" ; then
extra_functions="udiv_w_sdiv"
fi
gcc_32_cflags_maybe="-m31"
unset cpu
case $host_cpu in
s390)
;;
z900 | z900esa)
cpu="z900"
gcc_cflags_arch="-march=$cpu"
extra_functions=""
;;
z990 | z990esa)
cpu="z990"
gcc_cflags_arch="-march=$cpu"
extra_functions=""
;;
z9 | z9esa)
cpu="z9"
gcc_cflags_arch="-march=$cpu"
extra_functions=""
;;
z10 | z10esa)
cpu="z10"
gcc_cflags_arch="-march=$cpu"
extra_functions=""
;;
z196 | z196esa)
cpu="z196"
gcc_cflags_arch="-march=$cpu"
extra_functions=""
;;
z13 | z13esa)
cpu="z13"
gcc_cflags_arch="-march=$cpu"
extra_functions=""
path_64="s390_64/z13 $path_64"
;;
z14 | z14esa)
cpu="z14"
gcc_cflags_arch="-march=$cpu -march=z13"
extra_functions=""
path_64="s390_64/z14 s390_64/z13 $path_64"
;;
z15 | z15esa)
cpu="z15"
gcc_cflags_arch="-march=$cpu -march=arch13 -march=z14 -march=z13"
extra_functions=""
path_64="s390_64/z15 s390_64/z14 s390_64/z13 $path_64"
;;
z16 | z16esa)
cpu="z16"
gcc_cflags_arch="-march=$cpu -march=arch14 -march=z15 -march=arch13 -march=z14 -march=z13"
extra_functions=""
path_64="s390_64/z16 s390_64/z15 s390_64/z14 s390_64/z13 $path_64"
;;
esac
if test x"$cpu" != x ; then
AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_s390_$cpu)
AC_DEFINE(HAVE_HOST_CPU_s390_zarch)
path="s390_32/esame s390_32"
fi
case $host in
S390X_PATTERN)
abilist="64 32"
cclist_64="gcc"
gcc_64_cflags_optlist="arch"
gcc_64_cflags="$gcc_cflags -m64"
extra_functions=""
;;
esac
;;
sh-*-*) path="sh" ;;
[sh[2-4]-*-*]) path="sh/sh2 sh" ;;
*sparc*-*-*)
# sizeof(long)==4 or 8 is tested, to ensure we get the right ABI. We've
# had various bug reports where users have set CFLAGS for their desired
# mode, but not set our ABI. For some reason it's sparc where this
# keeps coming up, presumably users there are accustomed to driving the
# compiler mode that way. The effect of our testlist setting is to
# reject ABI=64 in favour of ABI=32 if the user has forced the flags to
# 32-bit mode.
#
abilist="32"
cclist="gcc acc cc"
any_testlist="sizeof-long-4"
GMP_INCLUDE_MPN(sparc32/sparc-defs.m4)
case $host_cpu in
sparcv8 | microsparc | turbosparc)
path="sparc32/v8 sparc32" ;;
supersparc)
path="sparc32/v8/supersparc sparc32/v8 sparc32" ;;
[sparc64 | sparcv9* | ultrasparc | ultrasparc[234]*])
path="sparc32/v9 sparc32/v8 sparc32" ;;
[ultrasparct[12345]])
path="sparc32/ultrasparct1 sparc32/v8 sparc32" ;;
*)
path="sparc32" ;;
esac
# gcc 2.7.2 doesn't know about v9 and doesn't pass -xarch=v8plus to the
# assembler. Add it explicitly since the solaris assembler won't accept
# our sparc32/v9 asm code without it. gas accepts -xarch=v8plus too, so
# it can be in the cflags unconditionally (though gas doesn't need it).
#
# gcc -m32 is needed to force 32-bit mode on a dual-ABI system, but past
# gcc doesn't know that flag, hence cflags_maybe. Note that -m32 cannot
# be done through the optlist since the plain cflags would be run first
# and we don't want to require the default mode (whatever it is) works.
#
# Note it's gcc_32_cflags_maybe and not gcc_cflags_maybe because the
# latter would be used in the 64-bit ABI on systems like "*bsd" where
# abilist="64" only.
#
gcc_32_cflags_maybe="-m32"
gcc_cflags_optlist="cpu asm"
# gcc 2.7.2 knows -mcypress, -msupersparc, -mv8, -msparclite.
# gcc 2.95 knows -mcpu= v7, hypersparc, sparclite86x, f930, f934,
# sparclet, tsc701, v9, ultrasparc. A warning is given that the
# plain -m forms will disappear.
# gcc 3.3 adds ultrasparc3.
#
case $host_cpu in
supersparc*)
gcc_cflags_cpu="-mcpu=supersparc -msupersparc"
gcc_cflags_asm="-Wa,-Av8 -Wa,-xarch=v8";;
sparcv8 | microsparc* | turbosparc | hypersparc*)
gcc_cflags_cpu="-mcpu=v8 -mv8"
gcc_cflags_asm="-Wa,-Av8 -Wa,-xarch=v8";;
sparc64 | sparcv9*)
gcc_cflags_cpu="-mcpu=v9"
gcc_32_cflags_asm="-Wa,-Av8 -Wa,-xarch=v8plus"
gcc_64_cflags_asm="-Wa,-Av9 -Wa,-xarch=v9";;
ultrasparc1 | ultrasparc2*)
gcc_cflags_cpu="-mcpu=ultrasparc -mcpu=v9"
gcc_32_cflags_asm="-Wa,-Av8plusa -Wa,-xarch=v8plusa"
gcc_64_cflags_asm="-Wa,-Av9a -Wa,-xarch=v9a";;
[ultrasparc[34]])
gcc_cflags_cpu="-mcpu=ultrasparc3 -mcpu=ultrasparc -mcpu=v9"
gcc_32_cflags_asm="-Wa,-Av8plusb -Wa,-xarch=v8plusb"
gcc_64_cflags_asm="-Wa,-Av9b -Wa,-xarch=v9b";;
[ultrasparct[12]])
gcc_cflags_cpu="-mcpu=niagara -mcpu=v9"
gcc_32_cflags_asm="-Wa,-Av8plusc -Wa,-xarch=v8plusc"
gcc_64_cflags_asm="-Wa,-Av9c -Wa,-xarch=v9c";;
ultrasparct3)
gcc_cflags_cpu="-mcpu=niagara3 -mcpu=niagara -mcpu=v9"
gcc_32_cflags_asm="-Wa,-Av8plusd -Wa,-xarch=v8plusd"
gcc_64_cflags_asm="-Wa,-Av9d -Wa,-xarch=v9d";;
[ultrasparct[45]])
gcc_cflags_cpu="-mcpu=niagara4 -mcpu=niagara3 -mcpu=niagara -mcpu=v9"
gcc_32_cflags_asm="-Wa,-Av8plusd -Wa,-xarch=v8plusd"
gcc_64_cflags_asm="-Wa,-Av9d -Wa,-xarch=v9d";;
*)
gcc_cflags_cpu="-mcpu=v7 -mcypress"
gcc_cflags_asm="";;
esac
# SunPRO cc and acc, and SunOS bundled cc
case $host in
*-*-solaris* | *-*-sunos*)
# Note no -g, it disables all optimizations.
cc_cflags=
cc_cflags_optlist="opt arch cpu"
# SunOS <= 4 cc doesn't know -xO3, fallback to -O2.
cc_cflags_opt="-xO3 -O2"
# SunOS cc doesn't know -xarch, apparently always generating v7
# code, so make this optional
case $host_cpu in
sparcv8 | microsparc* | supersparc* | turbosparc | hypersparc*)
cc_cflags_arch="-xarch=v8";;
[ultrasparct[345]])
cc_cflags_arch="-xarch=v8plusd" ;;
sparc64 | sparcv9* | ultrasparc*)
cc_cflags_arch="-xarch=v8plus" ;;
*)
cc_cflags_arch="-xarch=v7" ;;
esac
# SunOS cc doesn't know -xchip and doesn't seem to have an equivalent.
# SunPRO cc 5 recognises -xchip=generic, old, super, super2, micro,
# micro2, hyper, hyper2, powerup, ultra, ultra2, ultra2i.
# SunPRO cc 6 adds -xchip=ultra2e, ultra3cu.
#
case $host_cpu in
supersparc*) cc_cflags_cpu="-xchip=super" ;;
microsparc*) cc_cflags_cpu="-xchip=micro" ;;
turbosparc) cc_cflags_cpu="-xchip=micro2" ;;
hypersparc*) cc_cflags_cpu="-xchip=hyper" ;;
ultrasparc) cc_cflags_cpu="-xchip=ultra" ;;
ultrasparc2) cc_cflags_cpu="-xchip=ultra2 -xchip=ultra" ;;
ultrasparc2i) cc_cflags_cpu="-xchip=ultra2i -xchip=ultra2 -xchip=ultra" ;;
ultrasparc3) cc_cflags_cpu="-xchip=ultra3 -xchip=ultra" ;;
ultrasparc4) cc_cflags_cpu="-xchip=ultra4 -xchip=ultra3 -xchip=ultra" ;;
ultrasparct1) cc_cflags_cpu="-xchip=ultraT1" ;;
ultrasparct2) cc_cflags_cpu="-xchip=ultraT2 -xchip=ultraT1" ;;
ultrasparct3) cc_cflags_cpu="-xchip=ultraT3 -xchip=ultraT2" ;;
ultrasparct4) cc_cflags_cpu="-xchip=T4" ;;
ultrasparct5) cc_cflags_cpu="-xchip=T5 -xchip=T4" ;;
*) cc_cflags_cpu="-xchip=generic" ;;
esac
esac
case $host_cpu in
sparc64 | sparcv9* | ultrasparc*)
case $host in
# Solaris 6 and earlier cannot run ABI=64 since it doesn't save
# registers properly, so ABI=32 is left as the only choice.
#
[*-*-solaris2.[0-6] | *-*-solaris2.[0-6].*]) ;;
# BSD sparc64 ports are 64-bit-only systems, so ABI=64 is the only
# choice. In fact they need no special compiler flags, gcc -m64
# is the default, but it doesn't hurt to add it. v9 CPUs always
# use the sparc64 port, since the plain 32-bit sparc ports don't
# run on a v9.
#
*-*-*bsd*) abilist="64" ;;
# For all other systems, we try both 64 and 32.
#
# GNU/Linux sparc64 has only recently gained a 64-bit user mode.
# In the past sparc64 meant a v9 cpu, but there were no 64-bit
# operations in user mode. We assume that if "gcc -m64" works
# then the system is suitable. Hopefully even if someone attempts
# to put a new gcc and/or glibc on an old system it won't run.
#
*) abilist="64 32" ;;
esac
case $host_cpu in
ultrasparc | ultrasparc2 | ultrasparc2i)
path_64="sparc64/ultrasparc1234 sparc64" ;;
[ultrasparc[34]])
path_64="sparc64/ultrasparc34 sparc64/ultrasparc1234 sparc64" ;;
[ultrasparct[12]])
path_64="sparc64/ultrasparct1 sparc64" ;;
[ultrasparct3])
path_64="sparc64/ultrasparct3 sparc64" ;;
[ultrasparct[45]])
path_64="sparc64/ultrasparct45 sparc64/ultrasparct3 sparc64" ;;
*)
path_64="sparc64"
esac
cclist_64="gcc"
any_64_testlist="sizeof-long-8"
# gcc -mptr64 is probably implied by -m64, but we're not sure if
# this was always so. On Solaris in the past we always used both
# "-m64 -mptr64".
#
# gcc -Wa,-xarch=v9 is thought to be necessary in some cases on
# solaris, but it would seem likely that if gcc is going to generate
# 64-bit code it will have to add that option itself where needed.
# An extra copy of this option should be harmless though, but leave
# it until we're sure. (Might want -xarch=v9a or -xarch=v9b for the
# higher cpu types instead.)
#
gcc_64_cflags="$gcc_cflags -m64"
gcc_64_cflags_maybe="-mptr64"
gcc_64_ldflags="-Wc,-m64"
gcc_64_cflags_optlist="cpu asm"
case $host in
*-*-solaris*)
# Sun cc.
#
# We used to have -fast and some fixup options here, but it
# recurrently caused problems with miscompilation. Of course,
# -fast is documented as miscompiling things for the sake of speed.
#
cclist_64="$cclist_64 cc"
cc_64_cflags_optlist="cpu"
case $host_cpu in
[ultrasparct[345]])
cc_64_cflags="$cc_64_cflags -xO3 -xarch=v9d" ;;
*)
cc_64_cflags="-xO3 -xarch=v9" ;;
esac
;;
esac
# using the v9 %tick register
SPEED_CYCLECOUNTER_OBJ_32=sparcv9.lo
SPEED_CYCLECOUNTER_OBJ_64=sparcv9.lo
cyclecounter_size_32=2
cyclecounter_size_64=2
;;
esac
;;
# VAX
vax*-*-*elf*)
# Use elf conventions (i.e., '%' register prefix, no global prefix)
#
GMP_INCLUDE_MPN(vax/elf.m4)
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
path="vax"
if test "$enable_assembly" = "yes" ; then
extra_functions="udiv_w_sdiv"
fi
;;
vax*-*-*)
# Default to aout conventions (i.e., no register prefix, '_' global prefix)
#
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
path="vax"
if test "$enable_assembly" = "yes" ; then
extra_functions="udiv_w_sdiv"
fi
;;
# AMD and Intel x86 configurations, including AMD64
#
# Rumour has it gcc -O2 used to give worse register allocation than just
# -O, but lets assume that's no longer true.
#
# -m32 forces 32-bit mode on a bi-arch 32/64 amd64 build of gcc. -m64 is
# the default in such a build (we think), so -m32 is essential for ABI=32.
# This is, of course, done for any $host_cpu, not just x86_64, so we can
# get such a gcc into the right mode to cross-compile to say i486-*-*.
#
# -m32 is not available in gcc 2.95 and earlier, hence cflags_maybe to use
# it when it works. We check sizeof(long)==4 to ensure we get the right
# mode, in case -m32 has failed not because it's an old gcc, but because
# it's a dual 32/64-bit gcc without a 32-bit libc, or whatever.
#
X86_PATTERN | X86_64_PATTERN)
abilist="32"
cclist="gcc icc cc"
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_32_cflags_maybe="-m32"
icc_cflags="-no-gcc"
icc_cflags_optlist="opt"
icc_cflags_opt="-O3 -O2 -O1"
icc_cflags_opt_maybe="-fp-model~precise"
any_32_testlist="sizeof-long-4"
gcc_cflags_optlist="cpu arch noavx"
CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
# Availability of rdtsc is checked at run-time.
SPEED_CYCLECOUNTER_OBJ=pentium.lo
# Set to "yes" below on a per-cpu basis. We do that in order to allow for
# a relevant warning to be output when using a CPU with mulx on a system
# which cannot assemble it.
x86_have_mulx=no
# gcc 2.7.2 only knows i386 and i486, using -m386 or -m486. These
# represent -mcpu= since -m486 doesn't generate 486 specific insns.
# gcc 2.95 adds k6, pentium and pentiumpro, and takes -march= and -mcpu=.
# gcc 3.0 adds athlon.
# gcc 3.1 adds k6-2, k6-3, pentium-mmx, pentium2, pentium3, pentium4,
# athlon-tbird, athlon-4, athlon-xp, athlon-mp.
# gcc 3.2 adds winchip2.
# gcc 3.3 adds winchip-c6.
# gcc 3.3.1 from mandrake adds k8 and knows -mtune.
# gcc 3.4 adds c3, c3-2, k8, and deprecates -mcpu in favour of -mtune.
#
# In gcc 2.95.[0123], -march=pentiumpro provoked a stack slot bug in an
# old version of mpz/powm.c. Seems to be fine with the current code, so
# no need for any restrictions on that option.
#
# -march=pentiumpro can fail if the assembler doesn't know "cmov"
# (eg. solaris 2.8 native "as"), so always have -march=pentium after
# that as a fallback.
#
# -march=pentium4 and -march=k8 enable SSE2 instructions, which may or
# may not be supported by the assembler and/or the OS, and is bad in gcc
# prior to 3.3. The tests will reject these if no good, so fallbacks
# like "-march=pentium4 -mno-sse2" are given to try also without SSE2.
# Note the relevant -march types are listed in the optflags handling
# below, be sure to update there if adding new types emitting SSE2.
#
# -mtune is used at the start of each cpu option list to give something
# gcc 3.4 will use, thereby avoiding warnings from -mcpu. -mcpu forms
# are retained for use by prior gcc. For example pentium has
# "-mtune=pentium -mcpu=pentium ...", the -mtune is for 3.4 and the
# -mcpu for prior. If there's a brand new choice in 3.4 for a chip,
# like k8 for x86_64, then it can be the -mtune at the start, no need to
# duplicate anything.
#
case $host_cpu in
i386*)
gcc_cflags_cpu="-mtune=i386 -mcpu=i386 -m386"
gcc_cflags_arch="-march=i386"
path="x86"
;;
i486*)
gcc_cflags_cpu="-mtune=i486 -mcpu=i486 -m486"
gcc_cflags_arch="-march=i486"
path="x86/i486 x86"
;;
i586 | pentium)
gcc_cflags_cpu="-mtune=pentium -mcpu=pentium -m486"
gcc_cflags_arch="-march=pentium"
path="x86/pentium x86"
;;
pentiummmx)
gcc_cflags_cpu="-mtune=pentium-mmx -mcpu=pentium-mmx -mcpu=pentium -m486"
gcc_cflags_arch="-march=pentium-mmx -march=pentium"
path="x86/pentium/mmx x86/pentium x86/mmx x86"
;;
i686 | pentiumpro)
gcc_cflags_cpu="-mtune=pentiumpro -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentiumpro -march=pentium"
path="x86/p6 x86"
;;
pentium2)
gcc_cflags_cpu="-mtune=pentium2 -mcpu=pentium2 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium2 -march=pentiumpro -march=pentium"
path="x86/p6/mmx x86/p6 x86/mmx x86"
;;
pentium3)
gcc_cflags_cpu="-mtune=pentium3 -mcpu=pentium3 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium3 -march=pentiumpro -march=pentium"
path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
;;
pentiumm)
gcc_cflags_cpu="-mtune=pentium3 -mcpu=pentium3 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium3 -march=pentiumpro -march=pentium"
path="x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
;;
k6)
gcc_cflags_cpu="-mtune=k6 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6"
path="x86/k6/mmx x86/k6 x86/mmx x86"
;;
k62)
gcc_cflags_cpu="-mtune=k6-2 -mcpu=k6-2 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6-2 -march=k6"
path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
;;
k63)
gcc_cflags_cpu="-mtune=k6-3 -mcpu=k6-3 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6-3 -march=k6"
path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
;;
geode)
gcc_cflags_cpu="-mtune=k6-3 -mcpu=k6-3 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6-3 -march=k6"
path="x86/geode x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
;;
athlon)
# Athlon instruction costs are close to P6 (3 cycle load latency,
# 4-6 cycle mul, 40 cycle div, pairable adc, etc) so if gcc doesn't
# know athlon (eg. 2.95.2 doesn't) then fall back on pentiumpro.
gcc_cflags_cpu="-mtune=athlon -mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=athlon -march=pentiumpro -march=pentium"
path="x86/k7/mmx x86/k7 x86/mmx x86"
;;
i786 | pentium4)
# pentiumpro is the primary fallback when gcc doesn't know pentium4.
# This gets us cmov to eliminate branches. Maybe "athlon" would be
# a possibility on gcc 3.0.
#
gcc_cflags_cpu="-mtune=pentium4 -mcpu=pentium4 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium4 -march=pentium4~-mno-sse2 -march=pentiumpro -march=pentium"
gcc_64_cflags_cpu="-mtune=nocona"
path="x86/pentium4/sse2 x86/pentium4/mmx x86/pentium4 x86/mmx x86"
path_64="x86_64/pentium4 x86_64"
;;
viac32)
# Not sure of the best fallbacks here for -mcpu.
# c3-2 has sse and mmx, so pentium3 is good for -march.
gcc_cflags_cpu="-mtune=c3-2 -mcpu=c3-2 -mcpu=i486 -m486"
gcc_cflags_arch="-march=c3-2 -march=pentium3 -march=pentiumpro -march=pentium"
path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
;;
viac3*)
# Not sure of the best fallbacks here.
gcc_cflags_cpu="-mtune=c3 -mcpu=c3 -mcpu=i486 -m486"
gcc_cflags_arch="-march=c3 -march=pentium-mmx -march=pentium"
path="x86/pentium/mmx x86/pentium x86/mmx x86"
;;
athlon64 | k8 | x86_64)
--> --------------------
--> maximum size reached
--> --------------------
[ Verzeichnis aufwärts0.84unsichere Verbindung
]
|
2026-04-02
|