diff --git a/configure.ac b/configure.ac
index b9cfcc2c6c..306c2f44b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,294 +163,6 @@ dnl AC_CANONICAL_HOST
AC_CONFIG_HEADERS(src/config.h src/flint-config.h)
-################################################################################
-# architecture specifics
-################################################################################
-
-gcc_cflags="-O3 -pedantic -std=c11"
-gcc_warnings="-Werror=implicit-function-declaration -Wall -Wno-stringop-overread -Wno-stringop-overflow -Wno-maybe-uninitialized"
-
-dnl We only try to provide specifics for those systems that currently supports
-dnl our assembly routines. If more combinations are wished for than what is
-dnl specified, please open up an issue at
-dnl and we will consider it.
-dnl
-dnl For these systems we aim to provide:
-dnl
-dnl gcc_cflags flags for GCC-compatible compilers
-dnl
-dnl asm_path directory for assembly, relative to src/mpn_extras
-dnl param_path directory for flint-mparam.h, relative to src/mpn_extras
-dnl
-dnl For x86_64 systems, we can also set:
-dnl
-dnl have_avx512 system has AVX512F and AVX512DQ (we assume this implies have_avx2)
-dnl have_avx2 system has AVX2 and FMA
-
-case $host in
-
- ARM64_PATTERN)
- gcc_cflags="$gcc_cflags"
- gcc_cflags_optlist="arch tune"
- asm_path="arm64"
- param_path="arm64"
- flint_cv_have_fft_small_arm_i="yes"
-
- # NOTE: Cortex values where taken from
- # https://developer.arm.com/Processors/Cortex-XXX
- case $host_cpu in
- armcortexa35 | armcortexa35neon)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=cortex-a35"
- ;;
- armcortexa53 | armcortexa53neon)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=cortex-a53"
- ;;
- armcortexa55 | armcortexa55neon)
- gcc_cflags_arch="-march=armv8.2-a"
- gcc_cflags_tune="-mtune=cortex-a55"
- ;;
- armcortexa57 | armcortexa57neon)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=cortex-a57"
- ;;
- armcortexa72 | armcortexa72neon)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=cortex-a72"
- ;;
- armcortexa73 | armcortexa73neon)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=cortex-a73"
- ;;
- armcortexa75 | armcortexa75neon)
- gcc_cflags_arch="-march=armv8.2-a"
- gcc_cflags_tune="-mtune=cortex-a75"
- ;;
- armcortexa76 | armcortexa76neon)
- gcc_cflags_arch="-march=armv8.2-a"
- gcc_cflags_tune="-mtune=cortex-a76"
- ;;
- armcortexa77 | armcortexa77neon)
- gcc_cflags_arch="-march=armv8.2-a"
- gcc_cflags_tune="-mtune=cortex-a77"
- ;;
- armcortexa65 | armcortexa65neon)
- gcc_cflags_arch="-march=armv8.2-a"
- gcc_cflags_tune="-mtune=cortex-a65"
- ;;
- armcortexa34 | armcortexa34neon)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=cortex-a34"
- ;;
- armcortexa78 | armcortexa78neon)
- gcc_cflags_arch="-march=armv8.2-a"
- gcc_cflags_tune="-mtune=cortex-a78"
- ;;
- armexynosm1)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=exynos-m1"
- ;;
- armthunderx)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=thunderx"
- ;;
- armxgene1)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune="-mtune=xgene1"
- ;;
- applem1*)
- gcc_cflags_arch="-march=armv8.5-a"
- gcc_cflags_tune=""
- ;;
- applem2*)
- gcc_cflags_arch="-march=armv8.6-a"
- gcc_cflags_tune=""
- ;;
- applem3*)
- gcc_cflags_arch="-march=armv8.6-a"
- gcc_cflags_tune=""
- ;;
- aarch64* | armv8*)
- gcc_cflags_arch="-march=armv8-a"
- gcc_cflags_tune=""
- ;;
- *)
- AC_MSG_ERROR([Error in deciding flags for $host.
-Please report at ])
- ;;
- esac
- ;;
-
-
- X86_64_ADX_PATTERN)
- gcc_cflags="$gcc_cflags"
- gcc_cflags_optlist="arch"
- asm_path="x86_64/broadwell"
- param_path="x86_64/broadwell"
-
- have_avx512="no"
- have_avx2="yes"
-
- case $host_cpu in
- zen)
- gcc_cflags_arch="-march=znver1"
- param_path="x86_64/zen3"
- ;;
- zen2)
- gcc_cflags_arch="-march=znver2"
- param_path="x86_64/zen3"
- ;;
- zen3)
- gcc_cflags_arch="-march=znver3"
- param_path="x86_64/zen3"
- ;;
- zen4)
- gcc_cflags_arch="-march=znver4 -march=znver3"
- param_path="x86_64/zen3"
- have_avx512="yes"
- ;;
- coreibwl | broadwell)
- gcc_cflags_arch="-march=broadwell"
- param_path="x86_64/skylake"
- ;;
- skylake)
- gcc_cflags_arch="-march=skylake"
- param_path="x86_64/skylake"
- ;;
- skylake_server)
- gcc_cflags_arch="-march=skylake-avx512"
- param_path="x86_64/skylake"
- have_avx512="yes"
- ;;
- cannonlake)
- gcc_cflags_arch="-march=cannonlake"
- param_path="x86_64/skylake"
- have_avx512="yes"
- ;;
- kabylake)
- gcc_cflags_arch="-march=skylake"
- param_path="x86_64/skylake"
- ;;
- icelake)
- gcc_cflags_arch="-march=icelake-client"
- param_path="x86_64/skylake"
- have_avx512="yes"
- ;;
- icelake_server)
- gcc_cflags_arch="-march=icelake-server"
- param_path="x86_64/skylake"
- have_avx512="yes"
- ;;
- rocketlake)
- gcc_cflags_arch="-march=rocketlake"
- param_path="x86_64/skylake"
- have_avx512="yes"
- ;;
- tigerlake)
- gcc_cflags_arch="-march=tigerlake"
- param_path="x86_64/skylake"
- have_avx512="yes"
- ;;
- alderlake)
- gcc_cflags_arch="-march=alderlake"
- param_path="x86_64/skylake"
- ;;
- raptorlake)
- gcc_cflags_arch="-march=alderlake"
- param_path="x86_64/skylake"
- ;;
- knightslanding)
- gcc_cflags_arch="-march=knl"
- param_path="x86_64/skylake"
- ;;
- sapphirerapids)
- gcc_cflags_arch="-march=sapphirerapids"
- param_path="x86_64/skylake"
- have_avx512="yes"
- ;;
- cometlake)
- gcc_cflags_arch="-march=kabylake"
- param_path="x86_64/skylake"
- ;;
- *)
- AC_MSG_ERROR([Error in deciding flags for $host.
-Please report at ])
- ;;
- esac
-
- case $host in
- *-*-mingw* | *-*-msys | *-*-cygwin)
- flint_nonstd_abi="yes"
- asm_path=""
- param_path="x86_64"
- ;;
- esac
-
- if test "$have_avx512" = "yes";
- then
- have_avx2="yes"
- fi
-
- if test "$have_avx2" = "yes";
- then
- flint_cv_have_fft_small_x86_i="yes"
- fi
- ;;
-
- X86_64_PATTERN)
- # NOTE: We do not care if the user specifies noavx!
- gcc_cflags="$gcc_cflags"
- gcc_cflags_optlist="arch"
- asm_path=""
- param_path="x86_64"
-
- case $host_cpu in
- coreiibr | ivybridge)
- gcc_cflags_arch="-march=ivybridge"
- ;;
- coreihwl | haswell)
- gcc_cflags_arch="-march=haswell"
- ;;
- piledriver | bd2)
- gcc_cflags_arch="-march=bdver2"
- ;;
- steamroller | bd3)
- gcc_cflags_arch="-march=bdver3"
- ;;
- excavator | bd4)
- gcc_cflags_arch="-march=bdver4"
- have_avx2="yes"
- ;;
- x86_64v3)
- gcc_cflags_arch="-march=x86-64-v3"
- have_avx2="yes"
- ;;
- x86_64v4)
- gcc_cflags_arch="-march=x86-64-v4"
- have_avx512="yes"
- ;;
- esac
-
- if test "$have_avx512" = "yes";
- then
- have_avx2="yes"
- fi
-
- if test "$have_avx2" = "yes";
- then
- flint_cv_have_fft_small_x86_i="yes"
- fi
- ;;
-
- *)
- asm_path=""
- param_path="generic"
- gcc_cflags="$gcc_cflags"
- ;;
-
-esac
-
################################################################################
# features
################################################################################
@@ -477,8 +189,6 @@ yes|no)
esac],
enable_reentrant="no")
-# Synonym for thread-safe. Only here for say to users that it is deprecated.
-AC_ARG_ENABLE(tls)
AC_ARG_ENABLE(thread-safe,
[AS_HELP_STRING([--enable-thread-safe],[Enable thread-local storage [default=yes]])],
[case $enableval in
@@ -598,7 +308,7 @@ yes|no)
esac],
enable_avx512="no")
-# Note: This is maintainer level only. Currently only used for Nemo CI.
+# NOTE: This is maintainer level only. Currently only used for Nemo CI.
AC_ARG_ENABLE(mpfr-check,[],
[case $enableval in
yes|no)
@@ -607,7 +317,19 @@ yes|no)
AC_MSG_ERROR([Bad value $enableval for --enable-mpfr-check. Need yes or no.])
;;
esac],
-enable_mpfr_check="yes")
+enable_mpfr_check="yes")
+
+# NOTE: Maintainer level only. Avoids any sort of optimization to speed up
+# builds.
+AC_ARG_ENABLE(fast-build,[],
+[case $enableval in
+yes|no)
+ ;;
+*)
+ AC_MSG_ERROR([Bad value $enableval for --enable-fast-build. Need yes or no.])
+ ;;
+esac],
+enable_fast_build="no")
################################################################################
# packages
@@ -679,130 +401,422 @@ fi,
with_mpfr="yes"
)
-AC_ARG_WITH(blas_include,
-[AS_HELP_STRING([--with-blas-include=DIR],[Use BLAS and specify its include directory])],
-CPPFLAGS="$CPPFLAGS -I$withval"
-blas_include_path="$withval"
-)
+AC_ARG_WITH(blas_include,
+[AS_HELP_STRING([--with-blas-include=DIR],[Use BLAS and specify its include directory])],
+CPPFLAGS="$CPPFLAGS -I$withval"
+blas_include_path="$withval"
+)
+
+AC_ARG_WITH(blas_lib,
+[AS_HELP_STRING([--with-blas-lib=DIR],[Use BLAS and specify its library directory])],
+LDFLAGS="$LDFLAGS -L$withval"
+blas_lib_path="$withval"
+)
+
+AC_ARG_WITH(blas,
+[AS_HELP_STRING([--with-blas[[=DIR]]],[Use BLAS and specify its install directory])],
+if test "$with_blas" = "yes";
+then
+ :
+elif test "$with_blas" = "no";
+then
+ if test -n "$blas_include_path" || test -n "$blas_lib_path";
+ then
+ AC_MSG_FAILURE([--with-blas-include or --with-blas-lib was specified but --with-blas=no.])
+ fi
+elif test -z "$blas_include_path" && test -z "$blas_lib_path";
+then
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ blas_include_path="$withval/include"
+ blas_lib_path="$withval/lib"
+ with_blas="yes"
+else
+ AC_MSG_FAILURE([Cannot use --with-blas along with --with-blas-include or --with-blas-lib.])
+fi,
+with_blas="no"
+)
+
+if test "$with_blas" != "no" || test -n "$blas_include_path" || test -n "$blas_lib_path";
+then
+ with_blas="yes"
+fi
+
+AC_ARG_WITH(gc_include,
+[AS_HELP_STRING([--with-gc-include=DIR],[Use GC and specify its include directory])],
+CPPFLAGS="$CPPFLAGS -I$withval"
+gc_include_path="$withval",
+with_gc_include="no"
+)
+
+AC_ARG_WITH(gc_lib,
+[AS_HELP_STRING([--with-gc-lib=DIR],[Use GC and specify its library directory])],
+LDFLAGS="$LDFLAGS -L$withval"
+gc_lib_path="$withval",
+with_gc_lib="no"
+)
+
+AC_ARG_WITH(gc,
+[AS_HELP_STRING([--with-gc[[=DIR]]],[Use GC and optionally specify its install directory])],
+if test "$with_gc" = "yes";
+then
+ :
+elif test "$with_gc" = "no";
+then
+ if test -n "$gc_include_path" || test -n "$gc_lib_path";
+ then
+ AC_MSG_FAILURE([--with-gc-include or --with-gc-lib was specified but --with-gc=no.])
+ fi
+elif test -z "$gc_include_path" && test -z "$gc_lib_path";
+then
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ gc_include_path="$withval/include"
+ gc_lib_path="$withval/lib"
+ with_gc="yes"
+else
+ AC_MSG_FAILURE([Cannot use --with-gc along with --with-gc-include or --with-gc-lib.])
+fi,
+with_gc="no"
+)
+
+if test "$with_gc" != "no" || test -n "$gc_include_path" || test -n "$gc_lib_path";
+then
+ with_gc="yes"
+fi
+
+AC_ARG_WITH(ntl_include,
+[AS_HELP_STRING([--with-ntl-include=DIR],[Use NTL (in tests) and specify its include directory])],
+CPPFLAGS="$CPPFLAGS -I$withval"
+ntl_include_path="$withval"
+)
+
+AC_ARG_WITH(ntl_lib,
+[AS_HELP_STRING([--with-ntl-lib=DIR],[Use NTL (in tests) and specify its library directory])],
+LDFLAGS="$LDFLAGS -L$withval"
+ntl_lib_path="$withval"
+)
+
+AC_ARG_WITH(ntl,
+[AS_HELP_STRING([--with-ntl[[=DIR]]],[Use NTL (in tests) and optionally specify its install directory])],
+if test "$with_ntl" = "yes";
+then
+ :
+elif test "$with_ntl" = "no";
+then
+ if test -n "$ntl_include_path" || test -n "$ntl_lib_path";
+ then
+ AC_MSG_FAILURE([--with-ntl-include or --with-ntl-lib was specified but --with-ntl=no.])
+ fi
+elif test -z "$ntl_include_path" && test -z "$ntl_lib_path";
+then
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ ntl_include_path="$withval/include"
+ ntl_lib_path="$withval/lib"
+ with_ntl="yes"
+else
+ AC_MSG_FAILURE([Cannot use --with-ntl along with --with-ntl-include or --with-ntl-lib.])
+fi,
+with_ntl="no"
+)
+
+if test "$with_ntl" != "no" || test -n "$ntl_include_path" || test -n "$ntl_lib_path";
+then
+ with_ntl="yes"
+fi
+
+################################################################################
+# architecture specifics
+################################################################################
+
+if test "$enable_fast_build" = "no";
+then
+ gcc_cflags="-O3 "
+fi
+gcc_cflags="$gcc_cflags-pedantic -std=c11"
+gcc_warnings="-Werror=implicit-function-declaration -Wall -Wno-stringop-overread -Wno-stringop-overflow -Wno-maybe-uninitialized"
+
+dnl We only try to provide specifics for those systems that currently supports
+dnl our assembly routines. If more combinations are wished for than what is
+dnl specified, please open up an issue at
+dnl and we will consider it.
+dnl
+dnl For these systems we aim to provide:
+dnl
+dnl gcc_cflags flags for GCC-compatible compilers
+dnl
+dnl asm_path directory for assembly, relative to src/mpn_extras
+dnl param_path directory for flint-mparam.h, relative to src/mpn_extras
+dnl
+dnl For x86_64 systems, we can also set:
+dnl
+dnl have_avx512 system has AVX512F and AVX512DQ (we assume this implies have_avx2)
+dnl have_avx2 system has AVX2 and FMA
+
+case $host in
+
+ ARM64_PATTERN)
+ gcc_cflags="$gcc_cflags"
+ gcc_cflags_optlist="arch tune"
+ asm_path="arm64"
+ param_path="arm64"
+ flint_cv_have_fft_small_arm_i="yes"
+
+ # NOTE: Cortex values where taken from
+ # https://developer.arm.com/Processors/Cortex-XXX
+ case $host_cpu in
+ armcortexa35 | armcortexa35neon)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=cortex-a35"
+ ;;
+ armcortexa53 | armcortexa53neon)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=cortex-a53"
+ ;;
+ armcortexa55 | armcortexa55neon)
+ gcc_cflags_arch="-march=armv8.2-a"
+ gcc_cflags_tune="-mtune=cortex-a55"
+ ;;
+ armcortexa57 | armcortexa57neon)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=cortex-a57"
+ ;;
+ armcortexa72 | armcortexa72neon)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=cortex-a72"
+ ;;
+ armcortexa73 | armcortexa73neon)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=cortex-a73"
+ ;;
+ armcortexa75 | armcortexa75neon)
+ gcc_cflags_arch="-march=armv8.2-a"
+ gcc_cflags_tune="-mtune=cortex-a75"
+ ;;
+ armcortexa76 | armcortexa76neon)
+ gcc_cflags_arch="-march=armv8.2-a"
+ gcc_cflags_tune="-mtune=cortex-a76"
+ ;;
+ armcortexa77 | armcortexa77neon)
+ gcc_cflags_arch="-march=armv8.2-a"
+ gcc_cflags_tune="-mtune=cortex-a77"
+ ;;
+ armcortexa65 | armcortexa65neon)
+ gcc_cflags_arch="-march=armv8.2-a"
+ gcc_cflags_tune="-mtune=cortex-a65"
+ ;;
+ armcortexa34 | armcortexa34neon)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=cortex-a34"
+ ;;
+ armcortexa78 | armcortexa78neon)
+ gcc_cflags_arch="-march=armv8.2-a"
+ gcc_cflags_tune="-mtune=cortex-a78"
+ ;;
+ armexynosm1)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=exynos-m1"
+ ;;
+ armthunderx)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=thunderx"
+ ;;
+ armxgene1)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune="-mtune=xgene1"
+ ;;
+ applem1*)
+ gcc_cflags_arch="-march=armv8.5-a"
+ gcc_cflags_tune=""
+ ;;
+ applem2*)
+ gcc_cflags_arch="-march=armv8.6-a"
+ gcc_cflags_tune=""
+ ;;
+ applem3*)
+ gcc_cflags_arch="-march=armv8.6-a"
+ gcc_cflags_tune=""
+ ;;
+ aarch64* | armv8*)
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_tune=""
+ ;;
+ *)
+ AC_MSG_ERROR([Error in deciding flags for $host.
+Please report at ])
+ ;;
+ esac
+ ;;
+
+
+ X86_64_ADX_PATTERN)
+ gcc_cflags="$gcc_cflags"
+ gcc_cflags_optlist="arch"
+ asm_path="x86_64/broadwell"
+ param_path="x86_64/broadwell"
+
+ have_avx512="no"
+ have_avx2="yes"
+
+ case $host_cpu in
+ zen)
+ gcc_cflags_arch="-march=znver1"
+ param_path="x86_64/zen3"
+ ;;
+ zen2)
+ gcc_cflags_arch="-march=znver2"
+ param_path="x86_64/zen3"
+ ;;
+ zen3)
+ gcc_cflags_arch="-march=znver3"
+ param_path="x86_64/zen3"
+ ;;
+ zen4)
+ gcc_cflags_arch="-march=znver4 -march=znver3"
+ param_path="x86_64/zen3"
+ have_avx512="yes"
+ ;;
+ coreibwl | broadwell)
+ gcc_cflags_arch="-march=broadwell"
+ param_path="x86_64/skylake"
+ ;;
+ skylake)
+ gcc_cflags_arch="-march=skylake"
+ param_path="x86_64/skylake"
+ ;;
+ skylake_server)
+ gcc_cflags_arch="-march=skylake-avx512"
+ param_path="x86_64/skylake"
+ have_avx512="yes"
+ ;;
+ cannonlake)
+ gcc_cflags_arch="-march=cannonlake"
+ param_path="x86_64/skylake"
+ have_avx512="yes"
+ ;;
+ kabylake)
+ gcc_cflags_arch="-march=skylake"
+ param_path="x86_64/skylake"
+ ;;
+ icelake)
+ gcc_cflags_arch="-march=icelake-client"
+ param_path="x86_64/skylake"
+ have_avx512="yes"
+ ;;
+ icelake_server)
+ gcc_cflags_arch="-march=icelake-server"
+ param_path="x86_64/skylake"
+ have_avx512="yes"
+ ;;
+ rocketlake)
+ gcc_cflags_arch="-march=rocketlake"
+ param_path="x86_64/skylake"
+ have_avx512="yes"
+ ;;
+ tigerlake)
+ gcc_cflags_arch="-march=tigerlake"
+ param_path="x86_64/skylake"
+ have_avx512="yes"
+ ;;
+ alderlake)
+ gcc_cflags_arch="-march=alderlake"
+ param_path="x86_64/skylake"
+ ;;
+ raptorlake)
+ gcc_cflags_arch="-march=alderlake"
+ param_path="x86_64/skylake"
+ ;;
+ knightslanding)
+ gcc_cflags_arch="-march=knl"
+ param_path="x86_64/skylake"
+ ;;
+ sapphirerapids)
+ gcc_cflags_arch="-march=sapphirerapids"
+ param_path="x86_64/skylake"
+ have_avx512="yes"
+ ;;
+ cometlake)
+ gcc_cflags_arch="-march=kabylake"
+ param_path="x86_64/skylake"
+ ;;
+ *)
+ AC_MSG_ERROR([Error in deciding flags for $host.
+Please report at ])
+ ;;
+ esac
-AC_ARG_WITH(blas_lib,
-[AS_HELP_STRING([--with-blas-lib=DIR],[Use BLAS and specify its library directory])],
-LDFLAGS="$LDFLAGS -L$withval"
-blas_lib_path="$withval"
-)
+ case $host in
+ *-*-mingw* | *-*-msys | *-*-cygwin)
+ flint_nonstd_abi="yes"
+ asm_path=""
+ param_path="x86_64"
+ ;;
+ esac
-AC_ARG_WITH(blas,
-[AS_HELP_STRING([--with-blas[[=DIR]]],[Use BLAS and specify its install directory])],
-if test "$with_blas" = "yes";
-then
- :
-elif test "$with_blas" = "no";
-then
- if test -n "$blas_include_path" || test -n "$blas_lib_path";
+ if test "$have_avx512" = "yes";
then
- AC_MSG_FAILURE([--with-blas-include or --with-blas-lib was specified but --with-blas=no.])
+ have_avx2="yes"
fi
-elif test -z "$blas_include_path" && test -z "$blas_lib_path";
-then
- CPPFLAGS="$CPPFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"
- blas_include_path="$withval/include"
- blas_lib_path="$withval/lib"
- with_blas="yes"
-else
- AC_MSG_FAILURE([Cannot use --with-blas along with --with-blas-include or --with-blas-lib.])
-fi,
-with_blas="no"
-)
-
-if test "$with_blas" != "no" || test -n "$blas_include_path" || test -n "$blas_lib_path";
-then
- with_blas="yes"
-fi
-
-AC_ARG_WITH(gc_include,
-[AS_HELP_STRING([--with-gc-include=DIR],[Use GC and specify its include directory])],
-CPPFLAGS="$CPPFLAGS -I$withval"
-gc_include_path="$withval",
-with_gc_include="no"
-)
-
-AC_ARG_WITH(gc_lib,
-[AS_HELP_STRING([--with-gc-lib=DIR],[Use GC and specify its library directory])],
-LDFLAGS="$LDFLAGS -L$withval"
-gc_lib_path="$withval",
-with_gc_lib="no"
-)
-AC_ARG_WITH(gc,
-[AS_HELP_STRING([--with-gc[[=DIR]]],[Use GC and optionally specify its install directory])],
-if test "$with_gc" = "yes";
-then
- :
-elif test "$with_gc" = "no";
-then
- if test -n "$gc_include_path" || test -n "$gc_lib_path";
+ if test "$have_avx2" = "yes";
then
- AC_MSG_FAILURE([--with-gc-include or --with-gc-lib was specified but --with-gc=no.])
+ flint_cv_have_fft_small_x86_i="yes"
fi
-elif test -z "$gc_include_path" && test -z "$gc_lib_path";
-then
- CPPFLAGS="$CPPFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"
- gc_include_path="$withval/include"
- gc_lib_path="$withval/lib"
- with_gc="yes"
-else
- AC_MSG_FAILURE([Cannot use --with-gc along with --with-gc-include or --with-gc-lib.])
-fi,
-with_gc="no"
-)
+ ;;
-if test "$with_gc" != "no" || test -n "$gc_include_path" || test -n "$gc_lib_path";
-then
- with_gc="yes"
-fi
+ X86_64_PATTERN)
+ # NOTE: We do not care if the user specifies noavx!
+ gcc_cflags="$gcc_cflags"
+ gcc_cflags_optlist="arch"
+ asm_path=""
+ param_path="x86_64"
-AC_ARG_WITH(ntl_include,
-[AS_HELP_STRING([--with-ntl-include=DIR],[Use NTL (in tests) and specify its include directory])],
-CPPFLAGS="$CPPFLAGS -I$withval"
-ntl_include_path="$withval"
-)
+ case $host_cpu in
+ coreiibr | ivybridge)
+ gcc_cflags_arch="-march=ivybridge"
+ ;;
+ coreihwl | haswell)
+ gcc_cflags_arch="-march=haswell"
+ ;;
+ piledriver | bd2)
+ gcc_cflags_arch="-march=bdver2"
+ ;;
+ steamroller | bd3)
+ gcc_cflags_arch="-march=bdver3"
+ ;;
+ excavator | bd4)
+ gcc_cflags_arch="-march=bdver4"
+ have_avx2="yes"
+ ;;
+ x86_64v3)
+ gcc_cflags_arch="-march=x86-64-v3"
+ have_avx2="yes"
+ ;;
+ x86_64v4)
+ gcc_cflags_arch="-march=x86-64-v4"
+ have_avx512="yes"
+ ;;
+ esac
-AC_ARG_WITH(ntl_lib,
-[AS_HELP_STRING([--with-ntl-lib=DIR],[Use NTL (in tests) and specify its library directory])],
-LDFLAGS="$LDFLAGS -L$withval"
-ntl_lib_path="$withval"
-)
+ if test "$have_avx512" = "yes";
+ then
+ have_avx2="yes"
+ fi
-AC_ARG_WITH(ntl,
-[AS_HELP_STRING([--with-ntl[[=DIR]]],[Use NTL (in tests) and optionally specify its install directory])],
-if test "$with_ntl" = "yes";
-then
- :
-elif test "$with_ntl" = "no";
-then
- if test -n "$ntl_include_path" || test -n "$ntl_lib_path";
+ if test "$have_avx2" = "yes";
then
- AC_MSG_FAILURE([--with-ntl-include or --with-ntl-lib was specified but --with-ntl=no.])
+ flint_cv_have_fft_small_x86_i="yes"
fi
-elif test -z "$ntl_include_path" && test -z "$ntl_lib_path";
-then
- CPPFLAGS="$CPPFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"
- ntl_include_path="$withval/include"
- ntl_lib_path="$withval/lib"
- with_ntl="yes"
-else
- AC_MSG_FAILURE([Cannot use --with-ntl along with --with-ntl-include or --with-ntl-lib.])
-fi,
-with_ntl="no"
-)
+ ;;
-if test "$with_ntl" != "no" || test -n "$ntl_include_path" || test -n "$ntl_lib_path";
-then
- with_ntl="yes"
-fi
+ *)
+ asm_path=""
+ param_path="generic"
+ gcc_cflags="$gcc_cflags"
+ ;;
+
+esac
################################################################################
# programs
@@ -1248,7 +1262,10 @@ then
fi
done
done
- AX_CHECK_COMPILE_FLAG([-funroll-loops],[unroll_loops="yes"])
+ if test "$enable_fast_build" = no;
+ then
+ AX_CHECK_COMPILE_FLAG([-funroll-loops],[unroll_loops="yes"])
+ fi
if test "$unroll_loops" = "yes";
then
AC_SUBST(UNROLL_LOOPS,1)
diff --git a/doc/source/arith.rst b/doc/source/arith.rst
index 536b079107..e311f69ecc 100644
--- a/doc/source/arith.rst
+++ b/doc/source/arith.rst
@@ -6,16 +6,6 @@
This module implements arithmetic functions, number-theoretic and
combinatorial special number sequences and polynomials.
-Primorials
---------------------------------------------------------------------------------
-
-
-.. function:: void arith_primorial(fmpz_t res, slong n)
-
- Sets ``res`` to ``n`` primorial or `n \#`, the product of all prime
- numbers less than or equal to `n`.
-
-
Harmonic numbers
--------------------------------------------------------------------------------
@@ -343,12 +333,6 @@ Multiplicative functions
--------------------------------------------------------------------------------
-.. function:: void arith_euler_phi(fmpz_t res, const fmpz_t n)
- int arith_moebius_mu(const fmpz_t n)
- void arith_divisor_sigma(fmpz_t res, ulong k, const fmpz_t n)
-
- These are aliases for the functions in the fmpz module.
-
.. function:: void arith_divisors(fmpz_poly_t res, const fmpz_t n)
Set the coefficients of the polynomial ``res`` to the divisors of `n`,
@@ -409,21 +393,6 @@ Landau's function
`O(n^{3/2} / \sqrt{\log n})`.
-
-Dedekind sums
---------------------------------------------------------------------------------
-
-
-.. function:: void arith_dedekind_sum_naive(fmpq_t s, const fmpz_t h, const fmpz_t k)
- double arith_dedekind_sum_coprime_d(double h, double k)
- void arith_dedekind_sum_coprime_large(fmpq_t s, const fmpz_t h, const fmpz_t k)
- void arith_dedekind_sum_coprime(fmpq_t s, const fmpz_t h, const fmpz_t k)
- void arith_dedekind_sum(fmpq_t s, const fmpz_t h, const fmpz_t k)
-
-
- These are aliases for the functions in the fmpq module.
-
-
Number of partitions
--------------------------------------------------------------------------------
diff --git a/examples/poly_roots.c b/examples/poly_roots.c
index cb3dfceadc..4c52ffaba9 100644
--- a/examples/poly_roots.c
+++ b/examples/poly_roots.c
@@ -85,13 +85,13 @@ int main(int argc, char *argv[])
}
else if (!strcmp(argv[i], "t"))
{
- arith_chebyshev_t_polynomial(g, atol(argv[i+1]));
+ fmpz_poly_chebyshev_t(g, atol(argv[i+1]));
fmpz_poly_mul(f, f, g);
i++;
}
else if (!strcmp(argv[i], "u"))
{
- arith_chebyshev_u_polynomial(g, atol(argv[i+1]));
+ fmpz_poly_chebyshev_u(g, atol(argv[i+1]));
fmpz_poly_mul(f, f, g);
i++;
}
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
{
fmpq_poly_t h;
fmpq_poly_init(h);
- arith_legendre_polynomial(h, atol(argv[i+1]));
+ fmpq_poly_legendre_p(h, atol(argv[i+1]));
fmpq_poly_get_numerator(g, h);
fmpz_poly_mul(f, f, g);
fmpq_poly_clear(h);
@@ -107,13 +107,13 @@ int main(int argc, char *argv[])
}
else if (!strcmp(argv[i], "c"))
{
- arith_cyclotomic_polynomial(g, atol(argv[i+1]));
+ fmpz_poly_cyclotomic(g, atol(argv[i+1]));
fmpz_poly_mul(f, f, g);
i++;
}
else if (!strcmp(argv[i], "s"))
{
- arith_swinnerton_dyer_polynomial(g, atol(argv[i+1]));
+ fmpz_poly_swinnerton_dyer(g, atol(argv[i+1]));
fmpz_poly_mul(f, f, g);
i++;
}
diff --git a/src/acb_modular/test/t-epsilon_arg.c b/src/acb_modular/test/t-epsilon_arg.c
index f2dfe4141f..ddb59adb7c 100644
--- a/src/acb_modular/test/t-epsilon_arg.c
+++ b/src/acb_modular/test/t-epsilon_arg.c
@@ -39,7 +39,7 @@ acb_modular_epsilon_arg_naive(fmpq_t arg, const psl2z_t g)
fmpz_mul_ui(fmpq_denref(arg), c, 12);
fmpq_canonicalise(arg);
- arith_dedekind_sum(t, d, c);
+ fmpq_dedekind_sum(t, d, c);
fmpq_sub(arg, arg, t);
fmpq_clear(t);
diff --git a/src/arb_fmpz_poly/test/t-complex_roots.c b/src/arb_fmpz_poly/test/t-complex_roots.c
index 81c37ae415..72e73434f4 100644
--- a/src/arb_fmpz_poly/test/t-complex_roots.c
+++ b/src/arb_fmpz_poly/test/t-complex_roots.c
@@ -130,20 +130,20 @@ TEST_FUNCTION_START(arb_fmpz_poly_complex_roots, state)
fmpz_poly_set_coeff_ui(g, j, j+1);
break;
case 1:
- arith_chebyshev_t_polynomial(g, n);
+ fmpz_poly_chebyshev_t(g, n);
break;
case 2:
- arith_chebyshev_u_polynomial(g, n);
+ fmpz_poly_chebyshev_u(g, n);
break;
case 3:
- arith_legendre_polynomial(h, n);
+ fmpq_poly_legendre_p(h, n);
fmpq_poly_get_numerator(g, h);
break;
case 4:
- arith_cyclotomic_polynomial(g, n);
+ fmpz_poly_cyclotomic(g, n);
break;
case 5:
- arith_swinnerton_dyer_polynomial(g, n % 4);
+ fmpz_poly_swinnerton_dyer(g, n % 4);
break;
case 6:
arith_bernoulli_polynomial(h, n);
diff --git a/src/arb_hypgeom/test/t-legendre_p_ui_root.c b/src/arb_hypgeom/test/t-legendre_p_ui_root.c
index bf66598eb1..26f23b1263 100644
--- a/src/arb_hypgeom/test/t-legendre_p_ui_root.c
+++ b/src/arb_hypgeom/test/t-legendre_p_ui_root.c
@@ -52,7 +52,7 @@ TEST_FUNCTION_START(arb_hypgeom_legendre_p_ui_root, state)
arb_poly_product_roots(pol, roots, n, prec);
/* fmpq_poly_legendre_p(pol2, n); */
- arith_legendre_polynomial(pol2, n);
+ fmpq_poly_legendre_p(pol2, n);
arb_set_fmpz(s, pol2->coeffs + n);
arb_div_fmpz(s, s, pol2->den, prec);
arb_poly_scalar_mul(pol, pol, s, prec);
diff --git a/src/arith.h b/src/arith.h
index ce3c9d054d..598cff4e24 100644
--- a/src/arith.h
+++ b/src/arith.h
@@ -20,8 +20,6 @@
/* Various arithmetic functions **********************************************/
-#define arith_primorial fmpz_primorial
-
void _arith_harmonic_number(fmpz_t num, fmpz_t den, slong n);
void arith_harmonic_number(fmpq_t x, slong n);
@@ -30,10 +28,6 @@ void arith_ramanujan_tau_series(fmpz_poly_t res, slong n);
void arith_divisors(fmpz_poly_t res, const fmpz_t n);
-#define arith_divisor_sigma fmpz_divisor_sigma
-#define arith_moebius_mu fmpz_moebius_mu
-#define arith_euler_phi fmpz_euler_phi
-
/* Stirling numbers **********************************************************/
void arith_stirling_number_1u(fmpz_t s, ulong n, ulong k);
@@ -136,34 +130,10 @@ void arith_bernoulli_polynomial(fmpq_poly_t poly, ulong n);
void _arith_bernoulli_number_vec_multi_mod(fmpz * num, fmpz * den, slong n);
void _arith_bernoulli_number_vec_recursive(fmpz * num, fmpz * den, slong n);
-/* Cyclotomic polynomials ****************************************************/
-
-#define _arith_cyclotomic_polynomial _fmpz_poly_cyclotomic
-#define arith_cyclotomic_polynomial fmpz_poly_cyclotomic
-
-/* Hypergeometric polynomials ************************************************/
-
-#define _arith_chebyshev_t_polynomial _fmpz_poly_chebyshev_t
-#define arith_chebyshev_t_polynomial fmpz_poly_chebyshev_t
-#define _arith_chebyshev_u_polynomial _fmpz_poly_chebyshev_u
-#define arith_chebyshev_u_polynomial fmpz_poly_chebyshev_u
-
-#define arith_legendre_polynomial fmpq_poly_legendre_p
-
-/* Swinnerton-Dyer polynomials ***********************************************/
-
-#define _arith_swinnerton_dyer_polynomial _fmpz_poly_swinnerton_dyer
-#define arith_swinnerton_dyer_polynomial fmpz_poly_swinnerton_dyer
-
/* Landau function ***********************************************************/
void arith_landau_function_vec(fmpz * res, slong len);
-/* Dedekind sums *************************************************************/
-
-#define arith_dedekind_sum_naive fmpq_dedekind_sum_naive
-#define arith_dedekind_sum fmpq_dedekind_sum
-
/* Exponential sums **********************************************************/
typedef struct
@@ -202,6 +172,24 @@ void arith_number_of_partitions(fmpz_t x, ulong n);
void arith_sum_of_squares(fmpz_t r, ulong k, const fmpz_t n);
void arith_sum_of_squares_vec(fmpz * r, ulong k, slong n);
+/* to be deprecated **********************************************************/
+
+#define arith_primorial fmpz_primorial
+#define arith_divisor_sigma fmpz_divisor_sigma
+#define arith_moebius_mu fmpz_moebius_mu
+#define arith_euler_phi fmpz_euler_phi
+#define _arith_cyclotomic_polynomial _fmpz_poly_cyclotomic
+#define arith_cyclotomic_polynomial fmpz_poly_cyclotomic
+#define _arith_chebyshev_t_polynomial _fmpz_poly_chebyshev_t
+#define arith_chebyshev_t_polynomial fmpz_poly_chebyshev_t
+#define _arith_chebyshev_u_polynomial _fmpz_poly_chebyshev_u
+#define arith_chebyshev_u_polynomial fmpz_poly_chebyshev_u
+#define arith_legendre_polynomial fmpq_poly_legendre_p
+#define _arith_swinnerton_dyer_polynomial _fmpz_poly_swinnerton_dyer
+#define arith_swinnerton_dyer_polynomial fmpz_poly_swinnerton_dyer
+#define arith_dedekind_sum_naive fmpq_dedekind_sum_naive
+#define arith_dedekind_sum fmpq_dedekind_sum
+
#ifdef __cplusplus
}
#endif
diff --git a/src/arith/bernoulli_number_vec_recursive.c b/src/arith/bernoulli_number_vec_recursive.c
index 48976ff8ce..ecc2a70cb2 100644
--- a/src/arith/bernoulli_number_vec_recursive.c
+++ b/src/arith/bernoulli_number_vec_recursive.c
@@ -28,7 +28,7 @@ __ramanujan_even_common_denom(fmpz * num, fmpz * den, slong start, slong n)
fmpz_init(cden);
/* Common denominator */
- arith_primorial(cden, n + 1);
+ fmpz_primorial(cden, n + 1);
start += start % 2;
diff --git a/src/arith/bernoulli_polynomial.c b/src/arith/bernoulli_polynomial.c
index 149ae30f0f..3f9ed5b23d 100644
--- a/src/arith/bernoulli_polynomial.c
+++ b/src/arith/bernoulli_polynomial.c
@@ -47,7 +47,7 @@ void arith_bernoulli_polynomial(fmpq_poly_t poly, ulong n)
}
/* Convert to common denominator */
- arith_primorial(poly->den, n + 2);
+ fmpz_primorial(poly->den, n + 2);
for (k = 0; k <= n; k++)
{
fmpz_mul(poly->coeffs + k, poly->coeffs+k, poly->den);
diff --git a/src/arith/sum_of_squares.c b/src/arith/sum_of_squares.c
index 7ada431efb..f4f444b61b 100644
--- a/src/arith/sum_of_squares.c
+++ b/src/arith/sum_of_squares.c
@@ -54,13 +54,13 @@ sum_of_four_squares(fmpz_t r, const fmpz_t n)
if (v == 0)
{
- arith_divisor_sigma(r, 1, n);
+ fmpz_divisor_sigma(r, 1, n);
fmpz_mul_ui(r, r, 8);
}
else
{
fmpz_tdiv_q_2exp(r, n, v);
- arith_divisor_sigma(r, 1, r);
+ fmpz_divisor_sigma(r, 1, r);
fmpz_mul_ui(r, r, 24);
}
}
diff --git a/src/arith/test/main.c b/src/arith/test/main.c
index d31cb19772..19e975f9aa 100644
--- a/src/arith/test/main.c
+++ b/src/arith/test/main.c
@@ -22,8 +22,6 @@
#include "t-bernoulli_number_denom.c"
#include "t-bernoulli_number_vec.c"
#include "t-bernoulli_polynomial.c"
-#include "t-chebyshev_t_polynomial.c"
-#include "t-chebyshev_u_polynomial.c"
#include "t-divisors.c"
#include "t-euler_number_vec.c"
#include "t-euler_number_zeta.c"
@@ -34,7 +32,6 @@
#include "t-ramanujan_tau.c"
#include "t-stirling.c"
#include "t-sum_of_squares.c"
-#include "t-swinnerton_dyer_polynomial.c"
/* Array of test functions ***************************************************/
@@ -49,8 +46,6 @@ test_struct tests[] =
TEST_FUNCTION(arith_bernoulli_number_denom),
TEST_FUNCTION(arith_bernoulli_number_vec),
TEST_FUNCTION(arith_bernoulli_polynomial),
- TEST_FUNCTION(arith_chebyshev_t_polynomial),
- TEST_FUNCTION(arith_chebyshev_u_polynomial),
TEST_FUNCTION(arith_divisors),
TEST_FUNCTION(arith_euler_number_vec),
TEST_FUNCTION(arith_euler_number_zeta),
@@ -61,7 +56,6 @@ test_struct tests[] =
TEST_FUNCTION(arith_ramanujan_tau),
TEST_FUNCTION(arith_stirling),
TEST_FUNCTION(arith_sum_of_squares),
- TEST_FUNCTION(arith_swinnerton_dyer_polynomial)
};
/* main function *************************************************************/
diff --git a/src/arith/test/t-chebyshev_t_polynomial.c b/src/arith/test/t-chebyshev_t_polynomial.c
deleted file mode 100644
index 1c68e1fafc..0000000000
--- a/src/arith/test/t-chebyshev_t_polynomial.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright (C) 2011 Fredrik Johansson
-
- This file is part of FLINT.
-
- FLINT is free software: you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License (LGPL) as published
- by the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version. See .
-*/
-
-#include "test_helpers.h"
-#include "fmpz_poly.h"
-#include "arith.h"
-
-TEST_FUNCTION_START(arith_chebyshev_t_polynomial, state)
-{
- fmpz_poly_t T0, T1, T2, t;
- slong n;
-
-
- fmpz_poly_init(T0);
- fmpz_poly_init(T1);
- fmpz_poly_init(T2);
- fmpz_poly_init(t);
-
- arith_chebyshev_t_polynomial(T0, 0);
- arith_chebyshev_t_polynomial(T1, 1);
-
- for (n = 2; n <= 500; n++)
- {
- arith_chebyshev_t_polynomial(T2, n);
-
- /* Verify T_{n+1} = 2 x T_n - T_{n-1} */
- fmpz_poly_scalar_mul_ui(t, T1, UWORD(2));
- fmpz_poly_shift_left(t, t, 1);
- fmpz_poly_sub(t, t, T0);
-
- if (!fmpz_poly_equal(t, T2))
- {
- flint_printf("FAIL: n = %wd\n", n);
- flint_printf("t: "); fmpz_poly_print_pretty(t, "x"); flint_printf("\n");
- flint_printf("T2: "); fmpz_poly_print_pretty(T2, "x"); flint_printf("\n");
- fflush(stdout);
- flint_abort();
- }
-
- fmpz_poly_swap(T0, T1);
- fmpz_poly_swap(T1, T2);
- }
-
- fmpz_poly_clear(T0);
- fmpz_poly_clear(T1);
- fmpz_poly_clear(T2);
- fmpz_poly_clear(t);
-
- TEST_FUNCTION_END(state);
-}
diff --git a/src/arith/test/t-chebyshev_u_polynomial.c b/src/arith/test/t-chebyshev_u_polynomial.c
deleted file mode 100644
index 3429d91bab..0000000000
--- a/src/arith/test/t-chebyshev_u_polynomial.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- Copyright (C) 2011 Fredrik Johansson
-
- This file is part of FLINT.
-
- FLINT is free software: you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License (LGPL) as published
- by the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version. See .
-*/
-
-#include "test_helpers.h"
-#include "fmpz_poly.h"
-#include "arith.h"
-
-TEST_FUNCTION_START(arith_chebyshev_u_polynomial, state)
-{
- fmpz_poly_t T, U;
-
- slong n;
-
-
- fmpz_poly_init(T);
- fmpz_poly_init(U);
-
- for (n = 0; n <= 500; n++)
- {
- arith_chebyshev_u_polynomial(U, n);
- arith_chebyshev_t_polynomial(T, n + 1);
- fmpz_poly_derivative(T, T);
- fmpz_poly_scalar_divexact_ui(T, T, n + 1);
-
- if (!fmpz_poly_equal(T, U))
- {
- flint_printf("FAIL: n = %wd\n", n);
- flint_printf("T: "); fmpz_poly_print_pretty(T, "x"); flint_printf("\n");
- flint_printf("U: "); fmpz_poly_print_pretty(U, "x"); flint_printf("\n");
- fflush(stdout);
- flint_abort();
- }
-
- }
-
- fmpz_poly_clear(T);
- fmpz_poly_clear(U);
-
- TEST_FUNCTION_END(state);
-}
diff --git a/src/arith/test/t-swinnerton_dyer_polynomial.c b/src/arith/test/t-swinnerton_dyer_polynomial.c
deleted file mode 100644
index d0c384fa98..0000000000
--- a/src/arith/test/t-swinnerton_dyer_polynomial.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (C) 2011 Fredrik Johansson
-
- This file is part of FLINT.
-
- FLINT is free software: you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License (LGPL) as published
- by the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version. See .
-*/
-
-#include "test_helpers.h"
-#include "fmpz_poly.h"
-#include "arith.h"
-
-static const ulong known_values[] =
-{
- UWORD(2147483629),
- UWORD(1073742093),
- UWORD(1342248677),
- UWORD(3319936736),
- UWORD(2947821228),
- UWORD(1019513834),
- UWORD(3324951530),
- UWORD(1995039408),
- UWORD(3505683295),
- UWORD(3567639420),
- UWORD(394942914)
-};
-
-TEST_FUNCTION_START(arith_swinnerton_dyer_polynomial, state)
-{
- fmpz_poly_t S;
- ulong r;
- slong n;
-
-
- for (n = 0; n <= 10; n++)
- {
- fmpz_poly_init(S);
- arith_swinnerton_dyer_polynomial(S, n);
- r = fmpz_poly_evaluate_mod(S, UWORD(2147483629), UWORD(4294967291));
-
- if (r != known_values[n])
- {
- flint_printf("ERROR: wrong evaluation of S_%wd\n", n);
- fflush(stdout);
- flint_abort();
- }
-
- fmpz_poly_clear(S);
- }
-
- TEST_FUNCTION_END(state);
-}