Commit c226d3ed authored by Emmanuel Thomé's avatar Emmanuel Thomé

refresh gf2x in cado 2.2

parent 87a1ae31
Known bugs/issues with gf2x version 0.9.1
See the official bug tracker here:
- Toom tuning reports bizarre results on opteron. Prefer the shipped
x86_64/gf2x-thresholds.h (even though this was for a core2)
- fft tuning crashes on solaris-2.10, amd64 in 32bit mode.
https://gforge.inria.fr/tracker/?atid=6979&group_id=1874&func=browse
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -48,7 +48,7 @@ if ENABLE_FFT_INTERFACE
# default which gets shipped
libgf2x_la_CFLAGS=$(AM_CFLAGS) -DCANTOR_BASE_FIELD_SIZE=128
endif
libgf2x_la_SOURCES=gf2x.c toom.c toom-gpl.c $(FFT_SOURCES)
libgf2x_la_SOURCES=gf2x.c toom.c toom128.c toom-gpl.c $(FFT_SOURCES)
......@@ -74,7 +74,7 @@ nobase_nodist_include_HEADERS= \
gf2x/gf2x_mul9.h
libgf2x_la_LDFLAGS=-version-info @gf2x_lib_version@
libgf2x_la_LDFLAGS=-version-info @gf2x_lib_version@ -no-undefined
SUBDIRS=lowlevel src . fft tests $(MAYBE_APPS)
......@@ -106,8 +106,17 @@ untaint:
cp $(srcdir)/toom-gpl-placeholder.c $(srcdir)/toom-gpl.c
dist-hook:
-find $(distdir) \( -name .svn -type d \) -o -name "*~" -o -name ".#*" \
| xargs rm -rf
-find $(distdir)/already_tuned/tuned \! -type d -a \! -name README | xargs rm
-git log --boundary 29b13131cfaf95132f6a0602d3e0575694359d11..HEAD > $(distdir)/ChangeLog
# This one is simply taken from the generated Makefile. I agree it's a
# bit ugly.
dist-LGPL: distdir
mv $(distdir)/ $(distdir)-LGPL/
cp $(distdir)-LGPL/toom-gpl-placeholder.c $(distdir)-LGPL/toom-gpl.c
tardir=$(distdir)-LGPL && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir)-LGPL.tar.gz
mv $(distdir)-LGPL/ $(distdir)/
$(am__post_remove_distdir)
tune-lowlevel tune-toom tune-fft: all
cd src; $(MAKE) $@
......
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -171,7 +171,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(gf2x_includedir)" \
"$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libgf2x_la_LIBADD =
am__libgf2x_la_SOURCES_DIST = gf2x.c toom.c toom-gpl.c \
am__libgf2x_la_SOURCES_DIST = gf2x.c toom.c toom128.c toom-gpl.c \
fft/gf2x-ternary-fft.c fft/gf2x-fake-fft.c \
fft/gf2x-cantor-fft.c
am__dirstamp = $(am__leading_dot)dirstamp
......@@ -180,7 +180,7 @@ am__dirstamp = $(am__leading_dot)dirstamp
@ENABLE_FFT_INTERFACE_TRUE@ fft/libgf2x_la-gf2x-cantor-fft.lo
am__objects_2 = fft/libgf2x_la-gf2x-ternary-fft.lo $(am__objects_1)
am_libgf2x_la_OBJECTS = libgf2x_la-gf2x.lo libgf2x_la-toom.lo \
libgf2x_la-toom-gpl.lo $(am__objects_2)
libgf2x_la-toom128.lo libgf2x_la-toom-gpl.lo $(am__objects_2)
libgf2x_la_OBJECTS = $(am_libgf2x_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
......@@ -323,6 +323,7 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
......@@ -368,6 +369,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
......@@ -466,7 +468,7 @@ FFT_SOURCES = fft/gf2x-ternary-fft.c $(am__append_2)
lib_LTLIBRARIES = libgf2x.la
# default which gets shipped
@ENABLE_FFT_INTERFACE_TRUE@libgf2x_la_CFLAGS = $(AM_CFLAGS) -DCANTOR_BASE_FIELD_SIZE=128
libgf2x_la_SOURCES = gf2x.c toom.c toom-gpl.c $(FFT_SOURCES)
libgf2x_la_SOURCES = gf2x.c toom.c toom128.c toom-gpl.c $(FFT_SOURCES)
nobase_include_HEADERS = gf2x.h \
gf2x/gf2x-impl.h \
gf2x/gf2x-impl-export.h \
......@@ -488,7 +490,7 @@ nobase_nodist_include_HEADERS = \
gf2x/gf2x_mul8.h \
gf2x/gf2x_mul9.h
libgf2x_la_LDFLAGS = -version-info @gf2x_lib_version@
libgf2x_la_LDFLAGS = -version-info @gf2x_lib_version@ -no-undefined
SUBDIRS = lowlevel src . fft tests $(MAYBE_APPS)
DIST_SUBDIRS = lowlevel src . fft tests apps
DISTCLEANFILES = gf2x/gf2x-thresholds.h \
......@@ -628,6 +630,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgf2x_la-gf2x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgf2x_la-toom-gpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgf2x_la-toom.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgf2x_la-toom128.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@fft/$(DEPDIR)/libgf2x_la-gf2x-cantor-fft.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@fft/$(DEPDIR)/libgf2x_la-gf2x-fake-fft.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@fft/$(DEPDIR)/libgf2x_la-gf2x-ternary-fft.Plo@am__quote@
......@@ -670,6 +673,13 @@ libgf2x_la-toom.lo: toom.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgf2x_la_CFLAGS) $(CFLAGS) -c -o libgf2x_la-toom.lo `test -f 'toom.c' || echo '$(srcdir)/'`toom.c
libgf2x_la-toom128.lo: toom128.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgf2x_la_CFLAGS) $(CFLAGS) -MT libgf2x_la-toom128.lo -MD -MP -MF $(DEPDIR)/libgf2x_la-toom128.Tpo -c -o libgf2x_la-toom128.lo `test -f 'toom128.c' || echo '$(srcdir)/'`toom128.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgf2x_la-toom128.Tpo $(DEPDIR)/libgf2x_la-toom128.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='toom128.c' object='libgf2x_la-toom128.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgf2x_la_CFLAGS) $(CFLAGS) -c -o libgf2x_la-toom128.lo `test -f 'toom128.c' || echo '$(srcdir)/'`toom128.c
libgf2x_la-toom-gpl.lo: toom-gpl.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgf2x_la_CFLAGS) $(CFLAGS) -MT libgf2x_la-toom-gpl.lo -MD -MP -MF $(DEPDIR)/libgf2x_la-toom-gpl.Tpo -c -o libgf2x_la-toom-gpl.lo `test -f 'toom-gpl.c' || echo '$(srcdir)/'`toom-gpl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgf2x_la-toom-gpl.Tpo $(DEPDIR)/libgf2x_la-toom-gpl.Plo
......@@ -951,7 +961,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
......@@ -977,7 +987,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
......@@ -995,7 +1005,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
......@@ -1005,7 +1015,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
......@@ -1229,8 +1239,17 @@ untaint:
cp $(srcdir)/toom-gpl-placeholder.c $(srcdir)/toom-gpl.c
dist-hook:
-find $(distdir) \( -name .svn -type d \) -o -name "*~" -o -name ".#*" \
| xargs rm -rf
-find $(distdir)/already_tuned/tuned \! -type d -a \! -name README | xargs rm
-git log --boundary 29b13131cfaf95132f6a0602d3e0575694359d11..HEAD > $(distdir)/ChangeLog
# This one is simply taken from the generated Makefile. I agree it's a
# bit ugly.
dist-LGPL: distdir
mv $(distdir)/ $(distdir)-LGPL/
cp $(distdir)-LGPL/toom-gpl-placeholder.c $(distdir)-LGPL/toom-gpl.c
tardir=$(distdir)-LGPL && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir)-LGPL.tar.gz
mv $(distdir)-LGPL/ $(distdir)/
$(am__post_remove_distdir)
tune-lowlevel tune-toom tune-fft: all
cd src; $(MAKE) $@
......
......@@ -19,7 +19,7 @@ gf2x-1.1: (bugfix release)
- Added a faster mul4
- Added some support for cross compilation (might also have been
broken in the meantime, we don't have regression testing for this).
The interface is unchanged, so the shared library version has not
changed and still is 1.0.0
......@@ -8,7 +8,7 @@ License (for the library) is either:
placeholder, the GNU Lesser General Public License, either
version 2.1 of the License, or (at your option) any later
version.
License for the apps/ subdir is the GNU General Public License, either
version 2 of the License, or (at your option) any later version.
......@@ -24,25 +24,16 @@ This package contains routines for fast arithmetic in GF(2)[x]
Dependencies
============
gf2x requires the Gnu MP (GMP) library. GMP is packaged in most major
software distributions. You may also build it from source and install it
from yourself, see here for further details.
https://gmplib.org/
If you got the path of installing GMP to a custom location, this location
must be specified to gf2x's configure script as follows:
./configure --with-gmp=/path/which/was/given/as/a/prefix/for/gmp/build
gf2x has no external dependencies.
Some of the demos in the apps/ subdirectory require the gmp and NTL libraries.
# The text below is outdated (dates back to gf2x 1.0 at best).
# The text below is somewhat outdated, and was originally written for
# gf2x 1.0 at best, and was marginally updated since. It is still
# "reasonably accurate", but must be followed with caution.
------------------------------------------------------------------------
Summary:
......@@ -212,6 +203,19 @@ Cautious users follow steps 1 to 5 below. Urged users follow only 1 and 5.
ways of making this work, your easiest bet is to stick to the static
library approach.
Notes for specific systems:
===========================
- ABI selection is sometimes tricky. Be sure that you select the proper
combination of ABI= and CFLAGS= parameters. You must also make sure
that those correspond to the CFLAGS that were used by any other binary
object you're linking gf2x with. That applies, in particular, to the
GMP library if you intend to compile the files in apps/
- under AIX the following might be required to build the gf2x binaries:
$ export OBJECT_MODE=64
Caution regarding installation:
===============================
......
Before making a release:
*) check with ./configure --disable-hardware-specific-code
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15], [],
m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
......@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15])dnl
[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -605,7 +605,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -626,7 +626,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -648,7 +648,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -683,7 +683,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -733,7 +733,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -772,7 +772,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -801,7 +801,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -848,7 +848,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -867,7 +867,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -948,7 +948,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1008,7 +1008,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1036,7 +1036,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1055,7 +1055,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......
# put here the location of the NTL installation (for example /usr/local)
NTL=
AM_CPPFLAGS = -I$(top_srcdir) -T$(top_builddir)
# add -mbmi2 to use the pdep_u64 instruction
AM_CPPFLAGS = -I$(top_srcdir) -T$(top_builddir) -fopenmp -std=c++11 -I$(NTL)/include
check_PROGRAMS=factor
factor_SOURCES=factor.cpp halfgcd.cpp
noinst_HEADERS=halfgcd.hpp
factor_LDADD=../libgf2x.la -lntl -lgmp
factor_LDFLAGS=-fopenmp
factor_LDADD=../libgf2x.la $(NTL)/lib/libntl.a -lgmp
LOG_COMPILER=$(SHELL) 2>/dev/null
TESTS=check-factor-000.sh check-factor-001.sh \
......
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -109,11 +109,14 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am_factor_OBJECTS = factor.$(OBJEXT) halfgcd.$(OBJEXT)
factor_OBJECTS = $(am_factor_OBJECTS)
factor_DEPENDENCIES = ../libgf2x.la
factor_DEPENDENCIES = ../libgf2x.la $(NTL)/lib/libntl.a
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
factor_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(factor_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
......@@ -383,6 +386,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
$(top_srcdir)/config/test-driver COPYING
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
......@@ -428,6 +432,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
......@@ -512,10 +517,16 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = -I$(top_srcdir) -T$(top_builddir)
# put here the location of the NTL installation (for example /usr/local)
NTL =
# add -mbmi2 to use the pdep_u64 instruction
AM_CPPFLAGS = -I$(top_srcdir) -T$(top_builddir) -fopenmp -std=c++11 -I$(NTL)/include
factor_SOURCES = factor.cpp halfgcd.cpp
noinst_HEADERS = halfgcd.hpp
factor_LDADD = ../libgf2x.la -lntl -lgmp
factor_LDFLAGS = -fopenmp
factor_LDADD = ../libgf2x.la $(NTL)/lib/libntl.a -lgmp
LOG_COMPILER = $(SHELL) 2>/dev/null
TESTS = check-factor-000.sh check-factor-001.sh \
check-factor-002.sh check-factor-003.sh
......@@ -566,7 +577,7 @@ clean-checkPROGRAMS:
factor$(EXEEXT): $(factor_OBJECTS) $(factor_DEPENDENCIES) $(EXTRA_factor_DEPENDENCIES)
@rm -f factor$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(factor_OBJECTS) $(factor_LDADD) $(LIBS)
$(AM_V_CXXLD)$(factor_LINK) $(factor_OBJECTS) $(factor_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
......
This diff is collapsed.
......@@ -200,6 +200,10 @@ IterHalfGCD (GF2XMatrix& M_out, GF2X& U, GF2X& V, long d_red)
GF2X Q, t(INIT_SIZE, d_red);
while (deg(V) > goal) {
/* For the gcd of two polynomials of degree < 74207281,
this PlainDivRem() call takes about 20% of the total gcd time.
Here U and V have degree less than about 2*NTL_GF2X_HalfGCD_CROSSOVER,
and usually deg(V) = deg(U) - <small value>. */
PlainDivRem(Q, U, U, V);
swap(U, V);
......@@ -330,7 +334,8 @@ HalfGCD2 (GF2XMatrix& M_out, GF2X& U, GF2X& V, long d_red, int extended)
GF2X Q;
GF2XMatrix M2;
DivRem (Q, U, U, V);
/* this PlainDivRem() call takes negligible time */
PlainDivRem (Q, U, U, V);
swap (U, V);
if (extended)
......
......@@ -25,20 +25,18 @@
02110-1301, USA.
*/
#include <sys/resource.h>
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <stdlib.h>
#include "gf2x.h"
/* Usage: ./bench <limit size> */
/* return runtime in seconds */
double runtime(void)
{
struct rusage used;
getrusage(RUSAGE_SELF, &used);
return (used.ru_utime.tv_sec + used.ru_stime.tv_sec +
(used.ru_utime.tv_usec + used.ru_stime.tv_usec) / 1e6);
return (double) clock () / CLOCKS_PER_SEC;
}
int main(int argc, char * argv[])
......@@ -69,7 +67,7 @@ int main(int argc, char * argv[])
unsigned long jmax = 100000;
for(i = n0 ; i < n ; i++) {
for(i = n0 ; i < n ; i<<=1) {
/* warm up */
gf2x_mul(c,a,i,b,i);
gf2x_mul(c,a,i,b,i);
......
......@@ -89,10 +89,12 @@ AC_DEFUN([SSE2_EXAMPLE],[AC_LANG_SOURCE([
#include <emmintrin.h>
int main(int argc, char * argv[[]]) {
volatile int a0 = 17;
volatile int a1 = 42;
__m128i foo = _mm_setr_epi32(argc, argc + 1, argc + 2, argc + 3);
__m128i bar = _mm_setr_epi32(argc + 3, argc + 2, argc + 1, argc);
__m128i x = _mm_setr_epi32(42, 0, 17, 0);
__m128d g = _mm_set_pd(42.0, 17.0);
__m128i x = _mm_setr_epi32(a1, 0, a0, 0);
__m128d g = _mm_set_pd((double) a1, (double) a0);
x = _mm_srl_epi64(x, _mm_setr_epi32(2,0,0,0));
foo = _mm_mullo_epi16(foo, bar);
foo = _mm_slli_epi64(foo, 1);
......@@ -116,8 +118,10 @@ AC_DEFUN([SSE3_EXAMPLE],[AC_LANG_SOURCE([
int main()
{
__m128d x = _mm_setr_pd(12.34, 34.12);
__m128d y = _mm_setr_pd(78.56, 56.78);
volatile double a0 = 12.34;
volatile double a1 = 56.78;
__m128d x = _mm_setr_pd(a0, 34.12);
__m128d y = _mm_setr_pd(78.56, a1);
double a[[2]], b[[2]] = { 78.56 + 56.78, 12.34 + 34.12 };
y = _mm_hadd_pd(y, x);
......@@ -134,8 +138,10 @@ AC_DEFUN([SSSE3_EXAMPLE],[AC_LANG_SOURCE([
int main()
{
__m128i x = _mm_setr_epi32(0x03020100, 0x07060504, 0x0B0A0908, 0x0F0E0D0C);
__m128i y = _mm_setr_epi32(0x13121110, 0x17161514, 0x1B1A1918, 0x1F1E1D1C);
volatile uint32_t a0 = 0x03020100;
volatile uint32_t a1 = 0x1F1E1D1C;
__m128i x = _mm_setr_epi32(a0, 0x07060504, 0x0B0A0908, 0x0F0E0D0C);
__m128i y = _mm_setr_epi32(0x13121110, 0x17161514, 0x1B1A1918, a1);
uint64_t a[[2]], b[[2]] = { 0x0C0B0A0908070605, 0x14131211100F0E0D };
y = _mm_alignr_epi8(y, x, 0x5);
memcpy (a, &y, 16);
......@@ -145,16 +151,26 @@ int main()
AC_DEFUN([SSE41_EXAMPLE],[AC_LANG_SOURCE([
#include <stdint.h>
#include <stdlib.h>
#include <smmintrin.h>
int main() {
__m128i x = _mm_setr_epi32(42, 0, 17, 0);
__m128i y = _mm_setr_epi32(41, 0, 17, 0);
x = _mm_cmpeq_epi64(x, y);
/* the following test is for emulated 32-bit on physical 64-bit */
if (sizeof(unsigned long) != 8)
abort ();
return 0;
volatile int a0 = 17;
volatile int a1 = 42;
__m128i x = _mm_setr_epi32(a1, 0, a0, 0);