m4rie-20200125/0000755000175000017500000000000013612744244007777 500000000000000m4rie-20200125/m4/0000755000175000017500000000000013612744244010317 500000000000000m4rie-20200125/m4/ax_m4ri_flags.m40000644000175000017500000000227413206144356013222 00000000000000# SYNOPSIS # # AX_M4RI_CFLAGS # # DESCRIPTION # # Defines M4RI_CFLAGS which contains the CFLAGS used for building # the copy of M4RI we're linking against. # # LAST MODIFICATION # # 2011-10-03 # # COPYLEFT # # Copyright (c) 2009,2010 Martin Albrecht # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AX_M4RI_CFLAGS], [ AC_PREREQ(2.59) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_SED]) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $M4RIE_M4RI_CFLAGS" AC_CACHE_CHECK(for M4RI CFLAGS, ax_cv_m4ri_cflags, [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ FILE *f; f = fopen("conftest_m4ri_cflags", "w"); if (!f) return 1; fprintf(f,"%s %s",__M4RI_SIMD_CFLAGS, __M4RI_OPENMP_CFLAGS); fclose(f); return 0; ]])], [ax_cv_m4ri_cflags=`cat conftest_m4ri_cflags`; rm -f conftest_m4ri_cflags; CFLAGS="$save_CFLAGS"], [ax_cv_m4ri_cflags=""; rm -f conftest_m4ri_cflags; CFLAGS="$save_CFLAGS"], [ax_cv_m4ri_cflags=""; CFLAGS="$save_CFLAGS"])])]) ]) m4rie-20200125/m4/ax_openmp.m40000644000175000017500000001033613206144356012467 00000000000000# =========================================================================== # http://autoconf-archive.cryp.to/ax_openmp.html # =========================================================================== # # SYNOPSIS # # AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro tries to find out how to compile programs that use OpenMP a # standard API and set of compiler directives for parallel programming # (see http://www-unix.mcs/) # # On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS # output variable to the flag (e.g. -omp) used both to compile *and* link # OpenMP programs in the current language. # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. # # If you want to compile everything with OpenMP, you should set: # # CFLAGS="$CFLAGS $OPENMP_CFLAGS" # #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" # #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" # # (depending on the selected language). # # The user can override the default choice by setting the corresponding # environment variable (e.g. OPENMP_CFLAGS). # # ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is # found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is # not found. If ACTION-IF-FOUND is not specified, the default action will # define HAVE_OPENMP. # # LAST MODIFICATION # # 2008-04-12 # # COPYLEFT # # Copyright (c) 2008 Steven G. Johnson # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program 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 a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Macro Archive. When you make and # distribute a modified version of the Autoconf Macro, you may extend this # special exception to the GPL to apply to your modified version as well. AC_DEFUN([AX_OPENMP], [ AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), # -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" fi for ax_openmp_flag in $ax_openmp_flags; do case $ax_openmp_flag in none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; esac AC_TRY_LINK_FUNC(omp_set_num_threads, [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) done []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS ]) if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then m4_default([$2],:) else if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp fi m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) fi ])dnl AX_OPENMP m4rie-20200125/m4/libtool.m40000644000175000017500000112640013525301046012141 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS m4rie-20200125/m4/ltoptions.m40000644000175000017500000003426213525301046012533 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) m4rie-20200125/m4/ltsugar.m40000644000175000017500000001044013525301046012151 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) m4rie-20200125/m4/ltversion.m40000644000175000017500000000127313525301046012521 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) m4rie-20200125/m4/lt~obsolete.m40000644000175000017500000001377413525301046013057 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) m4rie-20200125/m4rie/0000755000175000017500000000000013612744244011017 500000000000000m4rie-20200125/m4rie/gf2x.h0000644000175000017500000001302413206144356011753 00000000000000/** * \file gf2x.h * * \brief \GF2X for degrees < 64 * * \author Martin Albrecht * * \warning Do not rely on these functions for high performance, they are not fully optimised. */ #ifndef M4RIE_GF2X_H #define M4RIE_GF2X_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2012 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #define __M4RIE_1tF(X) ~((X)-1) /**< Maps 1 to word with all ones and 0 to 0. */ typedef int deg_t; /**< degree type **/ /** * \brief a*b in \GF2X with deg(a) and deg(b) < d. */ static inline word gf2x_mul(const word a, const word b, deg_t d) { word res = 0; switch(d) { case 32: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(31)) >>31) & (b<<31); case 31: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(30)) >>30) & (b<<30); case 30: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(29)) >>29) & (b<<29); case 29: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(28)) >>28) & (b<<28); case 28: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(27)) >>27) & (b<<27); case 27: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(26)) >>26) & (b<<26); case 26: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(25)) >>25) & (b<<25); case 25: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(24)) >>24) & (b<<24); case 24: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(23)) >>23) & (b<<23); case 23: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(22)) >>22) & (b<<22); case 22: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(21)) >>21) & (b<<21); case 21: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(20)) >>20) & (b<<20); case 20: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(19)) >>19) & (b<<19); case 19: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(18)) >>18) & (b<<18); case 18: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(17)) >>17) & (b<<17); case 17: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(16)) >>16) & (b<<16); case 16: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(15)) >>15) & (b<<15); case 15: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(14)) >>14) & (b<<14); case 14: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(13)) >>13) & (b<<13); case 13: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(12)) >>12) & (b<<12); case 12: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(11)) >>11) & (b<<11); case 11: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW(10)) >>10) & (b<<10); case 10: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 9)) >> 9) & (b<< 9); case 9: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 8)) >> 8) & (b<< 8); case 8: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 7)) >> 7) & (b<< 7); case 7: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 6)) >> 6) & (b<< 6); case 6: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 5)) >> 5) & (b<< 5); case 5: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 4)) >> 4) & (b<< 4); case 4: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 3)) >> 3) & (b<< 3); case 3: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 2)) >> 2) & (b<< 2); case 2: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 1)) >> 1) & (b<< 1); case 1: res ^= __M4RIE_1tF((a & __M4RI_TWOPOW( 0)) >> 0) & (b<< 0); break; default: m4ri_die("degree %d too big.\n",d); } return res; } /** * \brief deg(a) in \GF2X. * * \param a Polynomial of degree <= 64. */ static inline deg_t gf2x_deg(word a) { deg_t degree = 0; if( (a & 0xffffffff00000000ULL) != 0) { degree += 32; a>>=32; } if( (a & 0xffff0000ULL) != 0) { degree += 16; a>>=16; } if( (a & 0xff00ULL) != 0) { degree += 8; a>>= 8; } if( (a & 0xf0ULL) != 0) { degree += 4; a>>= 4; } if( (a & 0xcULL) != 0) { degree += 2; a>>= 2; } if( (a & 0x2ULL) != 0) { degree += 1; a>>= 1; } return degree; } /** * \brief a / b in \GF2X. */ static inline word gf2x_div(word a, word b) { word res = 0; word mask = 0; const deg_t deg_b = gf2x_deg(b); for(deg_t deg_a = gf2x_deg(a); deg_a >= deg_b; deg_a--) { mask = __M4RIE_1tF(a>>deg_a); res |= mask & __M4RI_TWOPOW(deg_a - deg_b); a ^= mask & b<<(deg_a - deg_b); } return res; } /** * \brief a mod b in \GF2X. */ static inline word gf2x_mod(word a, word b) { const deg_t deg_b = gf2x_deg(b); for(deg_t deg_a=gf2x_deg(a); deg_a>=deg_b; deg_a--) { a ^= __M4RIE_1tF(a>>deg_a) & b<<(deg_a - deg_b); } return a; } /** * \brief a / b and a mod b in \GF2X. */ static inline word gf2x_divmod(word a, word b, word *rem) { word res = 0; word mask = 0; const deg_t deg_b = gf2x_deg(b); for(deg_t deg_a=gf2x_deg(a); deg_a>=deg_b; deg_a--) { mask = __M4RIE_1tF(a>>deg_a); res |= mask & __M4RI_TWOPOW(deg_a - deg_b); a ^= mask & b<<(deg_a - deg_b); } *rem = a; return res; } /** * \brief a^(-1) % b with deg(a), deg(b) <= d. */ static inline word gf2x_invmod(word a, word b, const deg_t d) { word x = 0; word lastx = 1; word y = 1; word lasty = 0; word rem; word quo; word tmp = 0; while (b != 0) { quo = gf2x_divmod(a,b, &rem); a = b; b = rem; tmp = x; x = lastx ^ gf2x_mul(quo, x, d); lastx = tmp; tmp = y; y = lasty ^ gf2x_mul(quo, y, d); lasty = tmp; } return lastx; } #endif //M4RIE_GF2X_H m4rie-20200125/m4rie/gf2e.h0000644000175000017500000001162413467575273011753 00000000000000/** * \file gf2e.h * * \brief \GF2E * * \author Martin Albrecht */ #ifndef M4RIE_GF2E_H #define M4RIE_GF2E_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GPL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #ifdef _WIN32 #if defined(DLL_EXPORT) && defined(M4RIE_BUILDING_M4RIE) #define M4RIE_DLL_EXPORT __declspec(dllexport) #elif defined(M4RI_USE_DLL) && !defined(M4RIE_BUILDING_M4RIE) #define M4RIE_DLL_EXPORT __declspec(dllimport) #else #define M4RIE_DLL_EXPORT #endif #else #define M4RIE_DLL_EXPORT #endif /** * \brief maximal supported degree */ #define M4RIE_MAX_DEGREE 16 /** * \brief \GF2E */ typedef struct gf2e_struct gf2e; /** * \brief \GF2E */ struct gf2e_struct { deg_t degree; /**< The degree \e. */ word minpoly; /**< Irreducible polynomial of degree \e. */ word *pow_gen; /**< pow_gen[i] holds \f$a^i / \langle f\rangle\f$ for \f$a\f$ a generator of this field.*/ word *red; /**< red[i] holds precomputed reductors for the minpoly.*/ word **_mul; /**< mul[a][b] holds \f$ a \cdot b\f$ for small fields.*/ word (*inv)(const gf2e *ff, const word a); /**< implements \f$a^{-1}\f$ for a in \GF2E*/ word (*mul)(const gf2e *ff, const word a, const word b); /**< implements \f$a \cdot b\f$ for a in \GF2E.*/ }; /** * Create finite field from minimal polynomial * * \param minpoly Polynomial represented as series of bits. */ gf2e *gf2e_init(const word minpoly); /** * Free ff * * \param ff Finite field. */ void gf2e_free(gf2e *ff); /** * \brief a^(-1) % minpoly */ static inline word gf2e_inv(const gf2e *ff, word a) { return gf2x_invmod(a, ff->minpoly, ff->degree); } /** * \brief a*b in \GF2E using a table lookups. */ static inline word _gf2e_mul_table(const gf2e *ff, const word a, const word b) { return ff->_mul[a][b]; } /** * \brief a*b in \GF2E using a gf2x_mul() lookups. */ static inline word _gf2e_mul_arith(const gf2e *ff, const word a, const word b) { const word res = gf2x_mul(a, b, ff->degree); return res ^ ff->red[res>>ff->degree]; } /** * \brief a*b in \GF2E. */ static inline word gf2e_mul(const gf2e *ff, const word a, const word b) { if( ff->_mul != NULL ) return _gf2e_mul_table(ff, a, b); else return _gf2e_mul_arith(ff, a, b); } /** * Return the width used for storing elements of ff * * \param ff Finite field. */ static inline size_t gf2e_degree_to_w(const gf2e *ff) { switch(ff->degree) { case 2: return 2; case 3: case 4: return 4; case 5: case 6: case 7: case 8: return 8; case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: return 16; default: m4ri_die("degree %d not supported.\n",ff->degree); } return 0; } /** * Compute all multiples by a of vectors fitting into 16 bits. * * \param ff Finite field. * \param a Finite field element. */ static inline word *gf2e_t16_init(const gf2e *ff, const word a) { word *mul = (word*)m4ri_mm_calloc(1<<16, sizeof(word)); const deg_t w = gf2e_degree_to_w(ff); const word mask_w = (1<>0)&mask_w))<<0 | gf2e_mul(ff, a, ((i>> 2)&mask_w))<< 2 | gf2e_mul(ff, a, ((i>> 4)&mask_w))<< 4 | gf2e_mul(ff, a, ((i>> 6)&mask_w))<< 6; mul[i] |= gf2e_mul(ff, a, ((i>>8)&mask_w))<<8 | gf2e_mul(ff, a, ((i>>10)&mask_w))<<10 | gf2e_mul(ff, a, ((i>>12)&mask_w))<<12 | gf2e_mul(ff, a, ((i>>14)&mask_w))<<14; break; case 4: mul[i] = gf2e_mul(ff, a, (i&mask_w)) | gf2e_mul(ff, a, ((i>>4)&mask_w))<<4 | gf2e_mul(ff, a, ((i>>8)&mask_w))<<8 | gf2e_mul(ff, a, ((i>>12)&mask_w))<<12; break; case 8: mul[i] = gf2e_mul(ff, a, (i&mask_w)) | gf2e_mul(ff, a, ((i>>8)&mask_w))<<8; break; case 16: mul[i] = gf2e_mul(ff, a, (i&mask_w)); break; }; } return mul; } /** * \brief Free multiplication table. * * \param mul Multiplication table */ static inline void gf2e_t16_free(word *mul) { m4ri_mm_free(mul); } /** * \brief all Irreducible polynomials over GF(2) up to degree 16. */ M4RIE_DLL_EXPORT extern const word* irreducible_polynomials[17]; #endif //M4RIE_GF2E_H m4rie-20200125/m4rie/mzed.h0000644000175000017500000010605113206144356012047 00000000000000/** * \file mzed.h * * \brief Dense matrices over \GF2E represented as packed matrices. * * This file implements the data type mzed_t. That is, matrices over * \GF2E in row major representation. * For example, let \f$ a = \sum a_i x_i / \f$ and \f$b = \sum b_i x_i / \f$ * be elements in \f$\mathbb{F}_{2^6}\f$ with minimal polynomial \f$f\f$. Then, the * \f$ 1 \times 2\f$ matrix [b a] would be stored as \verbatim [...| 0 0 b5 b4 b3 b2 b1 b0 | 0 0 a5 a4 a3 a2 a1 a0] \endverbatim * * Internally M4RI matrices are used to store bits with allows to * re-use existing M4RI methods (such as mzd_add) when implementing * functions for mzed_t. * * This data type is preferable when Newton-John tables ought be used * or when the matrix is small (\f$ m \times n \times e < L2\f$). * * \author Martin Albrecht */ #ifndef M4RIE_MZED_H #define M4RIE_MZED_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include /** * \brief Dense matrices over \GF2E represented as packed matrices. * * \ingroup Definitions */ typedef struct { mzd_t *x; /**< \f$m \times n\f$ matrices over \GF2E are represented as \f$m \times (en)\f$ matrices over \GF2. */ const gf2e *finite_field; /**< A finite field \GF2E. */ rci_t nrows; /**< Number of rows. */ rci_t ncols; /**< Number of columns. */ wi_t w; /**< The internal width of elements (must divide 64). */ } mzed_t; /** * \brief Create a new matrix of dimension m x n over ff * * Use mzed_free() to kill it. * * \param ff Finite field * \param m Number of rows * \param n Number of columns * * \ingroup Constructions */ mzed_t *mzed_init(const gf2e *ff, const rci_t m, const rci_t n); /** * \brief Free a matrix created with mzed_init(). * * \param A Matrix * * \ingroup Constructions */ void mzed_free(mzed_t *A); /** * \brief Concatenate B to A and write the result to C. * * That is, \verbatim [ A ], [ B ] -> [ A B ] = C \endverbatim * The inputs are not modified but a new matrix is created. * * \param C Matrix, may be NULL for automatic creation * \param A Matrix * \param B Matrix * * \note This is sometimes called augment. * * \ingroup Constructions */ static inline mzed_t *mzed_concat(mzed_t *C, const mzed_t *A, const mzed_t *B) { if(C==NULL) C = mzed_init(A->finite_field, A->nrows, A->ncols + B->ncols); mzd_concat(C->x, A->x, B->x); return C; } /** * \brief Stack A on top of B and write the result to C. * * That is, \verbatim [ A ], [ B ] -> [ A ] = C [ B ] \endverbatim * The inputs are not modified but a new matrix is created. * * \param C Matrix, may be NULL for automatic creation * \param A Matrix * \param B Matrix * * \ingroup Constructions */ static inline mzed_t *mzed_stack(mzed_t *C, const mzed_t *A, const mzed_t *B) { if(C==NULL) C = mzed_init(A->finite_field, A->nrows + B->nrows, A->ncols); mzd_stack(C->x, A->x, B->x); return C; } /** * \brief Copy a submatrix. * * Note that the upper bounds are not included. * * \param S Preallocated space for submatrix, may be NULL for automatic creation. * \param M Matrix * \param lowr start rows * \param lowc start column * \param highr stop row (this row is \em not included) * \param highc stop column (this column is \em not included) * * \ingroup Constructions */ static inline mzed_t *mzed_submatrix(mzed_t *S, const mzed_t *M, const rci_t lowr, const rci_t lowc, const rci_t highr, const rci_t highc) { if(S==NULL) S = mzed_init(M->finite_field, highr - lowr, highc - lowc); mzd_submatrix(S->x, M->x, lowr, lowc*M->w, highr, highc*M->w); return S; } /** * \brief Create a window/view into the matrix A. * * A matrix window for A is a meta structure on the matrix A. It is * setup to point into the matrix so M \em must \em not be freed while * the matrix window is used. * * This function puts the restriction on the provided parameters that * all parameters must be within range for A which is not currently * enforced. * * Use mzed_free_window() to free the window. * * \param A Matrix * \param lowr Starting row (inclusive) * \param lowc Starting column (inclusive) * \param highr End row (exclusive) * \param highc End column (exclusive) * * \ingroup Constructions */ static inline mzed_t *mzed_init_window(const mzed_t *A, const rci_t lowr, const rci_t lowc, const rci_t highr, const rci_t highc) { mzed_t *B = (mzed_t *)m4ri_mm_malloc(sizeof(mzed_t)); B->finite_field = A->finite_field; B->w = gf2e_degree_to_w(A->finite_field); B->nrows = highr - lowr; B->ncols = highc - lowc; B->x = mzd_init_window(A->x, lowr, B->w*lowc, highr, B->w*highc); return B; } /** * \brief Free a matrix window created with mzed_init_window(). * * \param A Matrix * * \ingroup Constructions */ static inline void mzed_free_window(mzed_t *A) { mzd_free_window(A->x); m4ri_mm_free(A); } /** * \brief \f$ C = A+B \f$. * * C is also returned. If C is NULL then a new matrix is created which * must be freed by mzed_free(). * * \param C Preallocated sum matrix, may be NULL for automatic creation. * \param A Matrix * \param B Matrix * * \ingroup Addition */ mzed_t *mzed_add(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = A+B \f$. * * \param C Preallocated sum matrix, may be NULL for automatic creation. * \param A Matrix * \param B Matrix * * \ingroup Addition */ mzed_t *_mzed_add(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = A+B \f$. * * \param C Preallocated difference matrix, may be NULL for automatic creation. * \param A Matrix * \param B Matrix * * \ingroup Addition */ #define mzed_sub mzed_add /** * \brief \f$ C = A+B \f$. * * \param C Preallocated difference matrix, may be NULL for automatic creation. * \param A Matrix * \param B Matrix * * \ingroup Addition */ #define _mzed_sub _mzed_add /** * \brief \f$ C = A \cdot B \f$. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \ingroup Multiplication */ mzed_t *mzed_mul(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = C + A \cdot B \f$. * * \param C Preallocated product matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \ingroup Multiplication */ mzed_t *mzed_addmul(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = A \cdot B \f$. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * * \ingroup Multiplication */ mzed_t *_mzed_mul(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = C + A \cdot B \f$. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * * \ingroup Multiplication */ mzed_t *_mzed_addmul(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = C + A \cdot B \f$ using naive cubic multiplication. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * * \note There is no reason to call this function except for checking * the correctness of other algorithms. It is very slow. * * \ingroup Multiplication */ mzed_t *mzed_addmul_naive(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = A \cdot B \f$ using naive cubic multiplication. * * \param C Preallocated product matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \note There is no reason to call this function except for checking * the correctness of other algorithms. It is very slow. * * \ingroup Multiplication */ mzed_t *mzed_mul_naive(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = C + A \cdot B \f$ using naive cubic multiplication. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * * \ingroup Multiplication */ mzed_t *_mzed_mul_naive(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$ C = a \cdot B \f$. * * \param C Preallocated product matrix or NULL. * \param a finite field element. * \param B Input matrix B. * * \ingroup Multiplication */ mzed_t *mzed_mul_scalar(mzed_t *C, const word a, const mzed_t *B); /** * Check whether C, A and B match in sizes and fields for * multiplication * * \param C Output matrix, if NULL a new matrix is created. * \param A Input matrix. * \param B Input matrix. * \param clear Write zeros to C or not. */ mzed_t *_mzed_mul_init(mzed_t *C, const mzed_t *A, const mzed_t *B, int clear); /** * \brief Fill matrix A with random elements. * * \param A Matrix * * \todo Allow the user to provide a RNG callback. * * \ingroup Assignment */ void mzed_randomize(mzed_t *A); /** * \brief Copy matrix A to B. * * \param B May be NULL for automatic creation. * \param A Source matrix. * * \ingroup Assignment */ mzed_t *mzed_copy(mzed_t *B, const mzed_t *A); /** * \brief Return diagonal matrix with value on the diagonal. * * If the matrix is not square then the largest possible square * submatrix is used. * * \param A Matrix * \param value Finite Field element * * \ingroup Assignment */ void mzed_set_ui(mzed_t *A, word value); /** * \brief Get the element at position (row,col) from the matrix A. * * \param A Source matrix. * \param row Starting row. * \param col Starting column. * * \ingroup Assignment */ static inline word mzed_read_elem(const mzed_t *A, const rci_t row, const rci_t col) { return __mzd_read_bits(A->x, row, A->w*col, A->w); } /** * \brief At the element elem to the element at position (row,col) in the matrix A. * * \param A Target matrix. * \param row Starting row. * \param col Starting column. * \param elem finite field element. * * \ingroup Assignment */ static inline void mzed_add_elem(mzed_t *A, const rci_t row, const rci_t col, const word elem) { __mzd_xor_bits(A->x, row, A->w*col, A->w, elem); } /** * \brief Write the element elem to the position (row,col) in the matrix A. * * \param A Target matrix. * \param row Starting row. * \param col Starting column. * \param elem finite field element. * * \ingroup Assignment */ static inline void mzed_write_elem(mzed_t *A, const rci_t row, const rci_t col, const word elem) { __mzd_clear_bits(A->x, row, A->w*col, A->w); __mzd_xor_bits(A->x, row, A->w*col, A->w, elem); } /** * \brief Return -1,0,1 if if A < B, A == B or A > B respectively. * * \param A Matrix. * \param B Matrix. * * \note This comparison is not well defined mathematically and * relatively arbitrary since elements of \GF2E don't have an * ordering. * * \ingroup Comparison */ static inline int mzed_cmp(mzed_t *A, mzed_t *B) { return mzd_cmp(A->x,B->x); } /** * \brief Zero test for matrix. * * \param A Input matrix. * * \ingroup Comparison */ static inline int mzed_is_zero(const mzed_t *A) { return mzd_is_zero(A->x); } /** * A[ar,c] = A[ar,c] + x*B[br,c] for all c >= startcol. * * \param A Matrix. * \param ar Row index in A. * \param B Matrix. * \param br Row index in B. * \param x Finite field element. * \param start_col Column index. * * \ingroup RowOperations */ void mzed_add_multiple_of_row(mzed_t *A, rci_t ar, const mzed_t *B, rci_t br, word x, rci_t start_col); /** * A[ar,c] = A[ar,c] + B[br,c] for all c >= startcol. * * \param A Matrix. * \param ar Row index in A. * \param B Matrix. * \param br Row index in B. * \param start_col Column index. * * \ingroup RowOperations */ static inline void mzed_add_row(mzed_t *A, rci_t ar, const mzed_t *B, rci_t br, rci_t start_col) { assert(A->ncols == B->ncols && A->finite_field == B->finite_field); assert(start_col < A->ncols); const rci_t start = A->w*start_col; const wi_t startblock = start/m4ri_radix; const word bitmask_begin = __M4RI_RIGHT_BITMASK(m4ri_radix - (start%m4ri_radix)); const word bitmask_end = A->x->high_bitmask; word *_a = A->x->rows[ar]; const word *_b = B->x->rows[br]; wi_t j; if (A->x->width - startblock > 1) { _a[startblock] ^= _b[startblock] & bitmask_begin; for(j=startblock+1; jx->width-1; j++) _a[j] ^= _b[j]; _a[j] ^= _b[j] & bitmask_end; } else { _a[startblock] ^= _b[startblock] & (bitmask_begin & bitmask_end); } } /** * \brief Rescale the row r in A by X starting c. * * \param A Matrix * \param r Row index. * \param start_col Column index. * \param x Multiplier * * \ingroup RowOperations */ static inline void mzed_rescale_row(mzed_t *A, rci_t r, rci_t start_col, const word x) { assert(start_col < A->ncols); const gf2e *ff = A->finite_field; const rci_t start = A->w*start_col; const wi_t startblock = start/m4ri_radix; word *_a = A->x->rows[r]; const word bitmask_begin = __M4RI_RIGHT_BITMASK(m4ri_radix - (start%m4ri_radix)); const word bitmask_end = A->x->high_bitmask; register word __a = _a[startblock]>>(start%m4ri_radix); register word __t = 0; int j; if(A->w == 2) { switch( (start/2) % 32 ) { case 0: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 0; __a >>= 2; case 1: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 2; __a >>= 2; case 2: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 4; __a >>= 2; case 3: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 6; __a >>= 2; case 4: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 8; __a >>= 2; case 5: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<10; __a >>= 2; case 6: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<12; __a >>= 2; case 7: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<14; __a >>= 2; case 8: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<16; __a >>= 2; case 9: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<18; __a >>= 2; case 10: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<20; __a >>= 2; case 11: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<22; __a >>= 2; case 12: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<24; __a >>= 2; case 13: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<26; __a >>= 2; case 14: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<28; __a >>= 2; case 15: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<30; __a >>= 2; case 16: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<32; __a >>= 2; case 17: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<34; __a >>= 2; case 18: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<36; __a >>= 2; case 19: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<38; __a >>= 2; case 20: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<40; __a >>= 2; case 21: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<42; __a >>= 2; case 22: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<44; __a >>= 2; case 23: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<46; __a >>= 2; case 24: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<48; __a >>= 2; case 25: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<50; __a >>= 2; case 26: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<52; __a >>= 2; case 27: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<54; __a >>= 2; case 28: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<56; __a >>= 2; case 29: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<58; __a >>= 2; case 30: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<60; __a >>= 2; case 31: __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<62; break; default: m4ri_die("impossible"); } if(A->x->width-startblock == 1) { _a[startblock] &= ~(bitmask_begin & bitmask_end); _a[startblock] ^= __t & bitmask_begin & bitmask_end; return; } else { _a[startblock] &= ~bitmask_begin; _a[startblock] ^= __t & bitmask_begin; } for(j=startblock+1; jx->width -1; j++) { __a = _a[j], __t = 0; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 0; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 2; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 4; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 6; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<< 8; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<10; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<12; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<14; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<16; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<18; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<20; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<22; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<24; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<26; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<28; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<30; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<32; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<34; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<36; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<38; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<40; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<42; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<44; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<46; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<48; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<50; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<52; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<54; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<56; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<58; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<60; __a >>= 2; __t ^= ff->mul(ff, x, __a & 0x0000000000000003ULL)<<62; _a[j] = __t; } __t = _a[j] & ~bitmask_end; switch(A->x->ncols % m4ri_radix) { case 0: __t ^= ff->mul(ff, x, (_a[j] & 0xC000000000000000ULL)>>62)<<62; case 62: __t ^= ff->mul(ff, x, (_a[j] & 0x3000000000000000ULL)>>60)<<60; case 60: __t ^= ff->mul(ff, x, (_a[j] & 0x0C00000000000000ULL)>>58)<<58; case 58: __t ^= ff->mul(ff, x, (_a[j] & 0x0300000000000000ULL)>>56)<<56; case 56: __t ^= ff->mul(ff, x, (_a[j] & 0x00C0000000000000ULL)>>54)<<54; case 54: __t ^= ff->mul(ff, x, (_a[j] & 0x0030000000000000ULL)>>52)<<52; case 52: __t ^= ff->mul(ff, x, (_a[j] & 0x000C000000000000ULL)>>50)<<50; case 50: __t ^= ff->mul(ff, x, (_a[j] & 0x0003000000000000ULL)>>48)<<48; case 48: __t ^= ff->mul(ff, x, (_a[j] & 0x0000C00000000000ULL)>>46)<<46; case 46: __t ^= ff->mul(ff, x, (_a[j] & 0x0000300000000000ULL)>>44)<<44; case 44: __t ^= ff->mul(ff, x, (_a[j] & 0x00000C0000000000ULL)>>42)<<42; case 42: __t ^= ff->mul(ff, x, (_a[j] & 0x0000030000000000ULL)>>40)<<40; case 40: __t ^= ff->mul(ff, x, (_a[j] & 0x000000C000000000ULL)>>38)<<38; case 38: __t ^= ff->mul(ff, x, (_a[j] & 0x0000003000000000ULL)>>36)<<36; case 36: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000C00000000ULL)>>34)<<34; case 34: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000300000000ULL)>>32)<<32; case 32: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000C0000000ULL)>>30)<<30; case 30: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000030000000ULL)>>28)<<28; case 28: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000C000000ULL)>>26)<<26; case 26: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000003000000ULL)>>24)<<24; case 24: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000C00000ULL)>>22)<<22; case 22: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000300000ULL)>>20)<<20; case 20: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000000C0000ULL)>>18)<<18; case 18: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000030000ULL)>>16)<<16; case 16: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000000C000ULL)>>14)<<14; case 14: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000003000ULL)>>12)<<12; case 12: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000000C00ULL)>>10)<<10; case 10: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000000300ULL)>> 8)<< 8; case 8: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000000000C0ULL)>> 6)<< 6; case 6: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000000030ULL)>> 4)<< 4; case 4: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000000000CULL)>> 2)<< 2; case 2: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000000003ULL)>> 0)<< 0; }; _a[j] = __t; } else if(A->w == 4) { switch( (start/4)%16 ) { case 0: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<< 0; __a >>= 4; case 1: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<< 4; __a >>= 4; case 2: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<< 8; __a >>= 4; case 3: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<12; __a >>= 4; case 4: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<16; __a >>= 4; case 5: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<20; __a >>= 4; case 6: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<24; __a >>= 4; case 7: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<28; __a >>= 4; case 8: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<32; __a >>= 4; case 9: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<36; __a >>= 4; case 10: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<40; __a >>= 4; case 11: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<44; __a >>= 4; case 12: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<48; __a >>= 4; case 13: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<52; __a >>= 4; case 14: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<56; __a >>= 4; case 15: __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<60; break; default: m4ri_die("impossible"); } if(A->x->width-startblock == 1) { _a[startblock] &= ~(bitmask_begin & bitmask_end); _a[startblock] ^= __t & bitmask_begin & bitmask_end; return; } else { _a[startblock] &= ~bitmask_begin; _a[startblock] ^= __t & bitmask_begin; } for(j=startblock+1; jx->width -1; j++) { __a = _a[j], __t = 0; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<< 0; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<< 4; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<< 8; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<12; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<16; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<20; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<24; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<28; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<32; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<36; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<40; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<44; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<48; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<52; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<56; __a >>= 4; __t ^= ff->mul(ff, x, __a & 0x000000000000000FULL)<<60; _a[j] = __t; } __t = _a[j] & ~bitmask_end; switch(A->x->ncols % m4ri_radix) { case 0: __t ^= ff->mul(ff, x, (_a[j] & 0xF000000000000000ULL)>>60)<<60; case 60: __t ^= ff->mul(ff, x, (_a[j] & 0x0F00000000000000ULL)>>56)<<56; case 56: __t ^= ff->mul(ff, x, (_a[j] & 0x00F0000000000000ULL)>>52)<<52; case 52: __t ^= ff->mul(ff, x, (_a[j] & 0x000F000000000000ULL)>>48)<<48; case 48: __t ^= ff->mul(ff, x, (_a[j] & 0x0000F00000000000ULL)>>44)<<44; case 44: __t ^= ff->mul(ff, x, (_a[j] & 0x00000F0000000000ULL)>>40)<<40; case 40: __t ^= ff->mul(ff, x, (_a[j] & 0x000000F000000000ULL)>>36)<<36; case 36: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000F00000000ULL)>>32)<<32; case 32: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000F0000000ULL)>>28)<<28; case 28: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000F000000ULL)>>24)<<24; case 24: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000F00000ULL)>>20)<<20; case 20: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000000F0000ULL)>>16)<<16; case 16: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000000F000ULL)>>12)<<12; case 12: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000000F00ULL)>> 8)<< 8; case 8: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000000000F0ULL)>> 4)<< 4; case 4: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000000000FULL)>> 0)<< 0; }; _a[j] = __t; } else if (A->w == 8) { register word __a0 = _a[startblock]>>(start%m4ri_radix); register word __a1; register word __t0 = 0; register word __t1; switch( (start/8) %8 ) { case 0: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<< 0; __a0 >>= 8; case 1: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<< 8; __a0 >>= 8; case 2: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<<16; __a0 >>= 8; case 3: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<<24; __a0 >>= 8; case 4: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<<32; __a0 >>= 8; case 5: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<<40; __a0 >>= 8; case 6: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<<48; __a0 >>= 8; case 7: __t0 ^= ff->mul(ff, x, (__a0 & 0x00000000000000FFULL))<<56; break; default: m4ri_die("impossible"); } if(A->x->width-startblock == 1) { _a[startblock] &= ~(bitmask_begin & bitmask_end); _a[startblock] ^= __t0 & bitmask_begin & bitmask_end; return; } else { _a[startblock] &= ~bitmask_begin; _a[startblock] ^= __t0 & bitmask_begin; } for(j=startblock+1; j+2 < A->x->width; j+=2) { __a0 = _a[j], __t0 = 0; __a1 = _a[j+1], __t1 = 0; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<< 0; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<< 0; __a1 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<< 8; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<< 8; __a1 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<16; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<<16; __a1 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<24; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<<24; __a1 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<32; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<<32; __a1 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<40; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<<40; __a1 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<48; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<<48; __a1 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<56; __a0 >>= 8; __t1 ^= ff->mul(ff, x, __a1 & 0x00000000000000FFULL)<<56; _a[j+0] = __t0; _a[j+1] = __t1; } for(; j < A->x->width-1; j++) { __a0 = _a[j], __t0 = 0; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<< 0; __a0 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<< 8; __a0 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<16; __a0 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<24; __a0 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<32; __a0 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<40; __a0 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<48; __a0 >>= 8; __t0 ^= ff->mul(ff, x, __a0 & 0x00000000000000FFULL)<<56; _a[j] = __t0; } __t = _a[j] & ~bitmask_end; switch(A->x->ncols % m4ri_radix ) { case 0: __t ^= ff->mul(ff, x, (_a[j] & 0xFF00000000000000ULL)>>56)<<56; case 56: __t ^= ff->mul(ff, x, (_a[j] & 0x00FF000000000000ULL)>>48)<<48; case 48: __t ^= ff->mul(ff, x, (_a[j] & 0x0000FF0000000000ULL)>>40)<<40; case 40: __t ^= ff->mul(ff, x, (_a[j] & 0x000000FF00000000ULL)>>32)<<32; case 32: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000FF000000ULL)>>24)<<24; case 24: __t ^= ff->mul(ff, x, (_a[j] & 0x0000000000FF0000ULL)>>16)<<16; case 16: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000000FF00ULL)>> 8)<< 8; case 8: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000000000FFULL)>> 0)<< 0; }; _a[j] = __t; } else if (A->w == 16) { switch( (start/16) %4 ) { case 0: __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<< 0; __a >>= 16; case 1: __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<16; __a >>= 16; case 2: __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<32; __a >>= 16; case 3: __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<48; break; default: m4ri_die("impossible"); } if(A->x->width-startblock == 1) { _a[startblock] &= ~(bitmask_begin & bitmask_end); _a[startblock] ^= __t & bitmask_begin & bitmask_end; return; } else { _a[startblock] &= ~bitmask_begin; _a[startblock] ^= __t & bitmask_begin; } for(j=startblock+1; j+4x->width; j+=4) { __a = _a[j], __t = 0; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<< 0; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<16; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<32; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<48; _a[j] = __t; __a = _a[j+1], __t = 0; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<< 0; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<16; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<32; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<48; _a[j+1] = __t; __a = _a[j+2], __t = 0; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<< 0; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<16; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<32; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<48; _a[j+2] = __t; __a = _a[j+3], __t = 0; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<< 0; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<16; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<32; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<48; _a[j+3] = __t; } for( ; jx->width-1; j++) { __a = _a[j], __t = 0; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<< 0; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<16; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<32; __a >>= 16; __t ^= ff->mul(ff, x, __a & 0x000000000000FFFFULL)<<48; _a[j] = __t; } __t = _a[j] & ~bitmask_end; switch(A->x->ncols % m4ri_radix) { case 0: __t ^= ff->mul(ff, x, (_a[j] & 0xFFFF000000000000ULL)>>48)<<48; case 48: __t ^= ff->mul(ff, x, (_a[j] & 0x0000FFFF00000000ULL)>>32)<<32; case 32: __t ^= ff->mul(ff, x, (_a[j] & 0x00000000FFFF0000ULL)>>16)<<16; case 16: __t ^= ff->mul(ff, x, (_a[j] & 0x000000000000FFFFULL)>> 0)<< 0; }; _a[j] = __t; } else { for(rci_t j=start_col; jncols; j++) { mzed_write_elem(A, r, j, ff->mul(ff, x, mzed_read_elem(A, r, j))); } } } /** * \brief Swap the two rows rowa and rowb. * * \param M Matrix * \param rowa Row index. * \param rowb Row index. * * \ingroup RowOperations */ static inline void mzed_row_swap(mzed_t *M, const rci_t rowa, const rci_t rowb) { mzd_row_swap(M->x, rowa, rowb); } /** * \brief copy row j from A to row i from B. * * The the number of columns of A must be less than or equal to the number of columns of B. * * \param B Target matrix. * \param i Target row index. * \param A Source matrix. * \param j Source row index. * * \ingroup RowOperations */ static inline void mzed_copy_row(mzed_t* B, rci_t i, const mzed_t* A, rci_t j) { mzd_copy_row(B->x, i, A->x, j); } /** * \brief Swap the two columns cola and colb. * * \param M Matrix. * \param cola Column index. * \param colb Column index. * * \ingroup RowOperations */ static inline void mzed_col_swap(mzed_t *M, const rci_t cola, const rci_t colb) { for(rci_t i=0; iw; i++) mzd_col_swap(M->x,M->w*cola+i, M->w*colb+i); } /** * \brief Swap the two columns cola and colb but only between start_row and stop_row. * * \param A Matrix. * \param cola Column index. * \param colb Column index. * \param start_row Row index. * \param stop_row Row index (exclusive). * * \ingroup RowOperations */ static inline void mzed_col_swap_in_rows(mzed_t *A, const rci_t cola, const rci_t colb, const rci_t start_row, rci_t stop_row) { for(unsigned int e=0; e < A->finite_field->degree; e++) { mzd_col_swap_in_rows(A->x, A->w*cola+e, A->w*colb+e, start_row, stop_row); }; } /** * \brief Add the rows sourcerow and destrow and stores the total in * the row destrow. * * \param M Matrix * \param sourcerow Index of source row * \param destrow Index of target row * * \note this can be done much faster with mzed_combine. * * \ingroup RowOperations */ static inline void mzed_row_add(mzed_t *M, const rci_t sourcerow, const rci_t destrow) { mzd_row_add(M->x, sourcerow, destrow); } /** * \brief Return the first row with all zero entries. * * If no such row can be found returns nrows. * * \param A Matrix * * \ingroup RowOperations */ static inline rci_t mzed_first_zero_row(mzed_t *A) { return mzd_first_zero_row(A->x); } /** * \brief Gaussian elimination. * * Perform Gaussian elimination on the matrix A. If full=0, then it * will do triangular style elimination, and if full=1, it will do * Gauss-Jordan style, or full elimination. * * \param A Matrix * \param full Gauss-Jordan style or upper unit-triangular form only. * * \ingroup Echelon */ rci_t mzed_echelonize_naive(mzed_t *A, int full); /** * \brief Print a matrix to stdout. * * \param M Matrix * * \ingroup StringConversions */ void mzed_print(const mzed_t *M); #endif //M4RIE_MATRIX_H m4rie-20200125/m4rie/m4rie.h0000644000175000017500000000570713206144356012136 00000000000000/** * \file m4rie.h * \brief Main include file for the M4RIE library. * * \author Martin Albrecht * * \mainpage * * M4RIE is a library to do fast compations with dense matrices over * \GF2E for small \e. M4RIE is available under the GPLv2+. * * The two fundamental data types of this library are mzed_t and * mzd_slice_t. For big matrices, i.e., those which do not fit into L2 * cache, it is recommended to use mzd_slice_t and for smaller * matrices mzed_t will be slightly faster and use less memory. * * Function names follow the pattern \verbatim [_]_[type]_[what]_[algorithm] \endverbatim * * Function names beginning with an underscore perform less * consistency checks (matching dimensions, matching fields) than * those without, e.g., _mzed_ple() is called by mzed_ple() after some * checks were performed. * * For both data types almost all functions are the same, e.g., there * is a function mzd_slice_add() and there also should be a function * mzed_add() with the same signature except for the matrix type. * * Functions which do not specify an algorithm choose the best * available algorithm (based on some heuristic), e.g., mzed_ple() * might call mzed_ple_newton_john(). * * \defgroup Definitions Type definitions * \defgroup Constructions Constructions * \defgroup Assignment Assignment and basic manipulation * \defgroup RowOperations Operations on rows * \defgroup StringConversions String conversions and I/O * \defgroup Addition Addition and subtraction * \defgroup Multiplication Multiplication * \defgroup PLE PLE and PLUQ decomposition * \defgroup Echelon Echelon forms * \defgroup Triangular Triangular matrices * * \example tests/test_multiplication.c */ #ifndef M4RIE_H #define M4RIE_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #ifdef __cplusplus extern "C" { #endif //__cplusplus #include #include #include #include #include #include #include #include #include #include #include #ifdef __cplusplus } #endif //__cplusplus #endif //M4RIE_H m4rie-20200125/m4rie/m4ri_functions.h0000644000175000017500000000506113206144356014052 00000000000000/** * \file m4ri_functions.h * * \brief Utility functions for mzd_t types * * \note Some of these functions might be moved M4RI in the future. * * \author Martin Albrecht */ #ifndef M4RIE_M4RI_FUNCTIONS_H #define M4RIE_M4RI_FUNCTIONS_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include /** * mzd_read_bits with assumption that all bits are in the same word */ static inline word __mzd_read_bits(const mzd_t *M, const rci_t x, const rci_t y, const rci_t n) { int const spot = y % m4ri_radix; wi_t const block = y / m4ri_radix; int const spill = spot + n - m4ri_radix; word temp = M->rows[x][block] << -spill; return temp >> (m4ri_radix - n); } /** * mzd_xor_bits with assumption that all bits are in the same word */ static inline void __mzd_xor_bits(const mzd_t *M, const rci_t x, const rci_t y, const rci_t n, word values) { int const spot = y % m4ri_radix; wi_t const block = y / m4ri_radix; M->rows[x][block] ^= values << spot; } /** * mzd_clear_bits with assumption that all bits are in the same word */ static inline void __mzd_clear_bits(const mzd_t *M, const rci_t x, const rci_t y, const rci_t n) { word values = m4ri_ffff >> (m4ri_radix - n); int const spot = y % m4ri_radix; wi_t const block = y / m4ri_radix; M->rows[x][block] &= ~(values << spot); } /** * \brief Add n elements to A * * A += B[0] + ... + B[n-1] * * \param A Matrix * \param n Number of elements in list * \param ... Matrices * * \ingroup Utility */ static inline mzd_t *mzd_sum(mzd_t *A, const int n, ...) { assert(n>1); va_list b_list; va_start( b_list, n ); mzd_add(A, va_arg(b_list, mzd_t *), va_arg(b_list, mzd_t *)); for( int i = 0 ; i < n-2; i++ ) { mzd_t *B = va_arg(b_list, mzd_t *); mzd_add(A, A, B); } va_end( b_list ); return A; } #endif //M4RIE_M4RI_FUNCTIONS_H m4rie-20200125/m4rie/newton_john.h0000644000175000017500000002355513206144356013447 00000000000000/** * \file newton_john.h * * \brief Newton-John table based algorithms * * \note These tables were formally known as Travolta tables. * * \author Martin Albrecht */ #ifndef M4RIE_NEWTON_JOHN_H #define M4RIE_NEWTON_JOHN_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include /** * \brief Newton-John table */ typedef struct { rci_t *L; /**< A map such that L[a] points to the row where the first entry is a. */ mzed_t *M; /**< Table of length \e with multiples of the input s.t. \f$a^i\f$ is the first entry of row \f$i\f$. */ mzed_t *T; /**< Actual table of length \f$2^e\f$ of all linear combinations of T. */ } njt_mzed_t; /** * \brief Allocate Newton-John table of dimension gf2e::degree<<1 * ncols. * * \param ff Finite field. * \param ncols Integer > 0. */ njt_mzed_t *njt_mzed_init(const gf2e *ff, const rci_t ncols); /** * \brief Free Newton-John table * * \param t Table */ void njt_mzed_free(njt_mzed_t *t); /** * \brief Construct Newton-John table T for row r of A, and element A[r,c]. * * \param T Preallocated Newton-John table or NULL. * \param A Matrix. * \param r Row index. * \param c Column index. */ njt_mzed_t * mzed_make_table(njt_mzed_t *T, const mzed_t *A, const rci_t r, const rci_t c); /** * \brief \f$C = A \cdot B\f$ using Newton-John tables. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa mzed_mul _mzed_mul_newton_john0() * * \ingroup Multiplication */ mzed_t *mzed_mul_newton_john(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$C = C + A \cdot B\f$ using Newton-John tables. * * \param C Preallocated product matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzed_mul_newton_john() mzed_mul() * * \ingroup Multiplication */ mzed_t *mzed_addmul_newton_john(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$C = C + A \cdot B\f$ using Newton-John tables. * * This is a simple implementation for clarity of presentation. Do not * call, it is slow. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * * \sa mzed_mul_newton_john() mzed_mul() * * \ingroup Multiplication */ mzed_t *_mzed_mul_newton_john0(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief \f$C = C + A \cdot B\f$ using Newton-John tables. * * This is an optimised implementation. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * * \sa mzed_mul() * * \ingroup Multiplication */ mzed_t *_mzed_mul_newton_john(mzed_t *C, const mzed_t *A, const mzed_t *B); /** * \brief Reduce matrix A to row echelon form using Gauss-Newton-John * elimination. * * \param A Matrix to be reduced. * \param full If set to true, the reduced row echelon form will be * computed. * * \ingroup Echelon */ rci_t mzed_echelonize_newton_john(mzed_t *A, int full); /** * \brief Invert the matrix A using Gauss-Newton-John elimination. * * \param B Preallocated space for inversion matrix, may be NULL for * automatic creation. * \param A Matrix to be inverted. */ mzed_t *mzed_invert_newton_john(mzed_t *B, const mzed_t *A); /** * \brief \f$B = L^{-1} \cdot B\f$ using Newton-John tables. * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzed_trsm_lower_left_newton_john(const mzed_t *L, mzed_t *B); /** * \brief \f$B = L^{-1} \cdot B\f$ using Newton-John tables. * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzd_slice_trsm_lower_left_newton_john(const mzd_slice_t *L, mzd_slice_t *B); /** * \brief \f$B = U^{-1} \cdot B\f$ using Newton-John tables. * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzed_trsm_upper_left_newton_john(const mzed_t *U, mzed_t *B); /** * \brief \f$B = U^{-1} \cdot B\f$ using Newton-John tables. * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzd_slice_trsm_upper_left_newton_john(const mzd_slice_t *U, mzd_slice_t *B); /** * \brief PLE decomposition: \f$L \cdot E = P\cdot A\f$ using Newton-John tables. * * \ingroup PLE */ rci_t mzed_ple_newton_john(mzed_t *A, mzp_t *P, mzp_t *Q); /** * \brief The function looks up 6 entries from position i,startcol in * each row and adds the appropriate row from T to the row i. * * This process is iterated for i from startrow to stoprow * (exclusive). * * \param M Matrix to operate on * \param startrow top row which is operated on * \param endrow bottom row which is operated on * \param startcol Starting column for addition * \param T Newton-John table * * \ingroup RowOperations */ static inline void mzed_process_rows(mzed_t *M, const rci_t startrow, const rci_t endrow, rci_t startcol, const njt_mzed_t *T) { mzd_process_rows(M->x, startrow, endrow, startcol*M->w, M->w, T->T->x, T->L); } /** * \brief Same as mzed_process_rows but works with two Newton-John tables * in parallel. * * \param M Matrix to operate on * \param startrow top row which is operated on * \param endrow bottom row which is operated on * \param startcol Starting column for addition * \param T0 Newton-John table * \param T1 Newton-John table * * \ingroup RowOperations */ static inline void mzed_process_rows2(mzed_t *M, const rci_t startrow, const rci_t endrow, const rci_t startcol, const njt_mzed_t *T0, const njt_mzed_t *T1) { mzd_process_rows2(M->x, startrow, endrow, startcol*M->w, 2*M->w, T0->T->x, T0->L, T1->T->x, T1->L); } /** * \brief Same as mzed_process_rows but works with three Newton-John * tables in parallel. * * \param M Matrix to operate on * \param startrow top row which is operated on * \param endrow bottom row which is operated on * \param startcol Starting column for addition * \param T0 Newton-John table * \param T1 Newton-John table * \param T2 Newton-John table * * \ingroup RowOperations */ static inline void mzed_process_rows3(mzed_t *M, const rci_t startrow, const rci_t endrow, const rci_t startcol, const njt_mzed_t *T0, const njt_mzed_t *T1, const njt_mzed_t *T2) { mzd_process_rows3(M->x, startrow, endrow, startcol*M->w, 3*M->w, T0->T->x, T0->L, T1->T->x, T1->L, T2->T->x, T2->L); } /** * \brief Same as mzed_process_rows but works with four Newton-John * tables in parallel. * * \param M Matrix to operate on * \param startrow top row which is operated on * \param endrow bottom row which is operated on * \param startcol Starting column for addition * \param T0 Newton-John table * \param T1 Newton-John table * \param T2 Newton-John table * \param T3 Newton-John table * * \ingroup RowOperations */ static inline void mzed_process_rows4(mzed_t *M, const rci_t startrow, const rci_t endrow, const rci_t startcol, const njt_mzed_t *T0, const njt_mzed_t *T1, const njt_mzed_t *T2, const njt_mzed_t *T3) { mzd_process_rows4(M->x, startrow, endrow, startcol*M->w, 4*M->w, T0->T->x, T0->L, T1->T->x, T1->L, T2->T->x, T2->L, T3->T->x, T3->L); } /** * \brief Same as mzed_process_rows but works with five Newton-John * tables in parallel. * * \param M Matrix to operate on * \param startrow top row which is operated on * \param endrow bottom row which is operated on * \param startcol Starting column for addition * \param T0 Newton-John table * \param T1 Newton-John table * \param T2 Newton-John table * \param T3 Newton-John table * \param T4 Newton-John table * * \ingroup RowOperations */ static inline void mzed_process_rows5(mzed_t *M, const rci_t startrow, const rci_t endrow, const rci_t startcol, const njt_mzed_t *T0, const njt_mzed_t *T1, const njt_mzed_t *T2, const njt_mzed_t *T3, const njt_mzed_t *T4) { mzd_process_rows5(M->x, startrow, endrow, startcol*M->w, 5*M->w, T0->T->x, T0->L, T1->T->x, T1->L, T2->T->x, T2->L, T3->T->x, T3->L, T4->T->x, T4->L); } /** * \brief Same as mzed_process_rows but works with six Newton-John tables * in parallel. * * \param M Matrix to operate on * \param startrow top row which is operated on * \param endrow bottom row which is operated on * \param startcol Starting column for addition * \param T0 Newton-John table * \param T1 Newton-John table * \param T2 Newton-John table * \param T3 Newton-John table * \param T4 Newton-John table * \param T5 Newton-John table * * \ingroup RowOperations */ static inline void mzed_process_rows6(mzed_t *M, const rci_t startrow, const rci_t endrow, const rci_t startcol, const njt_mzed_t *T0, const njt_mzed_t *T1, const njt_mzed_t *T2, const njt_mzed_t *T3, const njt_mzed_t *T4, const njt_mzed_t *T5) { mzd_process_rows6(M->x, startrow, endrow, startcol*M->w, 6*M->w, T0->T->x, T0->L, T1->T->x, T1->L, T2->T->x, T2->L, T3->T->x, T3->L, T4->T->x, T4->L, T5->T->x, T5->L); } #endif //M4RIE_NEWTON_JOHN_H m4rie-20200125/m4rie/echelonform.h0000644000175000017500000000517513206144356013416 00000000000000/** * \file echelonform.h * * \brief Echelon forms. * * \author Martin Albrecht */ #ifndef M4RIE_ECHELONFORM_H #define M4RIE_ECHELONFORM_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include /** * \brief Compute row echelon forms using PLE decomposition. * * Compute the (reduced) row echelon form of the matrix A. If full=0, * then return the reduced row echelon. This function reduces echelon * forms to PLE (or PLUQ) decomposition. * * \param A Matrix * \param full REF or RREF. * * \ingroup Echelon */ rci_t mzd_slice_echelonize_ple(mzd_slice_t *A, int full); /** * \brief Compute row echelon forms using PLE decomposition. * * Compute the (reduced) row echelon form of the matrix A. If full=0, * then return the reduced REF. This function reduces echelon forms to * PLE (or PLUQ) decomposition. * * \param A Matrix * \param full REF or RREF. * * \ingroup Echelon * * \note This function converts A to bitslice representation and * back. Hence, it uses more memory than using * mzed_echelonize_newton_john() or mzd_slice_echelonize_ple() */ static inline rci_t mzed_echelonize_ple(mzed_t *A, int full) { mzd_slice_t *a = mzed_slice(NULL, A); rci_t r = mzd_slice_echelonize_ple(a, full); mzed_cling(A, a); mzd_slice_free(a); return r; } /** * \brief Compute row echelon forms. * * Compute the (reduced) row echelon form of the matrix A. If full=0, * then return the reduced REF. * * \param A Matrix * \param full REF or RREF. * * \ingroup Echelon */ #define mzd_slice_echelonize mzd_slice_echelonize_ple /** * \brief Compute row echelon forms. * * Compute the (reduced) row echelon form of the matrix A. If full=0, * then return the reduced row echelon form. * * \param A Matrix * \param full REF or RREF. * * \ingroup Echelon */ rci_t mzed_echelonize(mzed_t *A, int full); #endif //M4RIE_ECHELONFORM_H m4rie-20200125/m4rie/strassen.h0000644000175000017500000000675113206144356012760 00000000000000/** * \file strassen.h * \brief Strassen-Winograd multiplication for mzed_t * \author Martin Albrecht */ #ifndef M4RIE_STRASSEN_H #define M4RIE_STRASSEN_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ /** * \brief \f$ C = A \cdot B \f$ using Strassen-Winograd. * * This function uses Strassen-Winograd multiplication (Bodrato * variant) recursively until it reaches the cutoff, where it switches * to Newton-John table based multiplication or naive multiplication. * * \param C Preallocated product matrix, may be NULL for allocation. * \param A Input matrix A. * \param B Input matrix B. * \param cutoff Crossover to basecase dimension > 64 or 0 for heuristic choice * * \ingroup Multiplication */ mzed_t *mzed_mul_strassen(mzed_t *C, const mzed_t *A, const mzed_t *B, int cutoff); /** * \brief \f$ C = C + A \cdot B \f$ using Strassen-Winograd. * * This function uses Strassen-Winograd multiplication (Bodrato * variant) recursively until it reaches the cutoff, where it switches * to Newton-John table based multiplication or naive multiplication. * * \param C Preallocated product matrix, may be NULL for allocation. * \param A Input matrix A. * \param B Input matrix B. * \param cutoff Crossover to basecase dimension > 64 or 0 for heuristic choice. * * \ingroup Multiplication */ mzed_t *mzed_addmul_strassen(mzed_t *C, const mzed_t *A, const mzed_t *B, int cutoff); /** * \brief \f$ C = A \cdot B \f$ using Strassen-Winograd. * * This function uses Strassen-Winograd multiplication (Bodrato * variant) recursively until it reaches the cutoff, where it switches * to Newton-John table based multiplication or naive multiplication. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * \param cutoff Crossover to basecase dimension > 64 * * \ingroup Multiplication * */ mzed_t *_mzed_mul_strassen(mzed_t *C, const mzed_t *A, const mzed_t *B, int cutoff); /** * \brief \f$ C = A \cdot B \f$ using Strassen-Winograd. * * This function uses Strassen-Winograd multiplication (Bodrato * variant) recursively until it reaches the cutoff, where it switches * to Newton-John table based multiplication or naive multiplication. * * \param C Preallocated product matrix. * \param A Input matrix A. * \param B Input matrix B. * \param cutoff Crossover to basecase dimension > 64 * * \ingroup Multiplication */ mzed_t *_mzed_addmul_strassen(mzed_t *C, const mzed_t *A, const mzed_t *B, int cutoff); /** * \brief Return heurstic choice for crossover parameter for Strassen-Winograd multiplication given A, B and C. * * \param C Matrix (ignored) * \param A Matrix * \param B Martix (ignored) * * \ingroup Multiplication */ rci_t _mzed_strassen_cutoff(const mzed_t *C, const mzed_t *A, const mzed_t *B); #endif //M4RIE_STRASSEN_H m4rie-20200125/m4rie/mzd_slice.h0000644000175000017500000006123413206144356013064 00000000000000/** * \file mzd_slice.h * * \brief Matrices using a bitsliced representation. * * Matrices over \GF2E can be represented as polynomials with matrix * coefficients where the matrices are in \GF2. * * In this file, matrices over \GF2E are implemented as \e slices of * matrices over \GF2 where each slice holds the coefficients of one * degree when viewing elements of \GF2E as polynomials over \GF2. * * \author Martin Albrecht */ #ifndef M4RIE_MZD_SLICE #define M4RIE_MZD_SLICE /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include #include /** * \brief Dense matrices over \GF2E represented as slices of matrices over \GF2. * * This is one of two fundamental data types of this library, the * other being mzed_t. For large matrices (\f$m \times n \times e > L2\f$) * it is advisable to use this data type because multiplication * is faster in this representation. Hence, compared to mzed_t one * saves the time to convert betwen representations and - more * importantly - memory. * * \ingroup Definitions */ typedef struct { mzd_t *x[16]; /**< mzd_slice_t::x[e][i,j] is the \e-th bit of the entry A[i,j]. */ rci_t nrows; /**< Number of rows. */ rci_t ncols; /**< Number of columns. */ unsigned int depth; /**< Number of slices * * \note This value may be greater than finite_field->degree in some situations */ const gf2e *finite_field; /**finite_field = ff; A->nrows = m; A->ncols = n; A->depth = ff->degree; for(int i=0; idepth; i++) A->x[i] = mzd_init(m,n); return A; } /** * \brief Return diagonal matrix with value on the diagonal. * * If the matrix is not square then the largest possible square * submatrix is used. * * \param A Matrix. * \param value Finite Field element. * * \ingroup Assignment */ void mzd_slice_set_ui(mzd_slice_t *A, word value); /** * \brief Extend or truncate the depth of A to depth new_depth. * * We may think of mzd_slice_t as polynomials over matrices over * \GF2. This function then truncates/extends these polynomials to * degree new_depth-1. In case of extension, all newly created * coefficients are zero, hence the mathematical content of A is not * changed. In case of truncation higher degree terms are simply * deleted and A's mathematical content modified. * * \param A Matrix, modifed in place. * \param new_depth Integer >= mzd_slice_t::finite_field::degree. */ static inline mzd_slice_t *_mzd_slice_adapt_depth(mzd_slice_t *A, const unsigned int new_depth) { assert(A->finite_field->degree <= new_depth); if (new_depth < A->depth) { for(unsigned int i=new_depth; idepth; i++) { mzd_free(A->x[i]); A->x[i] = NULL; } } else { for(unsigned int i=A->depth; ix[i] = mzd_init(A->nrows,A->ncols); } } A->depth = new_depth; return A; } /** * \brief Free a matrix created with mzd_slice_init(). * * \param A Matrix. * * \ingroup Constructions */ static inline void mzd_slice_free(mzd_slice_t *A) { for(int i=0; idepth; i++) mzd_free(A->x[i]); #if __M4RI_USE_MM_MALLOC _mm_free(A); #else free(A); #endif } /** * \brief copy A to B * * \param B Matrix. * \param A Matrix. * * \ingroup Constructions */ static inline mzd_slice_t *mzd_slice_copy(mzd_slice_t *B, const mzd_slice_t *A) { if(B == NULL) B = mzd_slice_init(A->finite_field, A->nrows, A->ncols); for(int i=0; idepth; i++) { mzd_copy(B->x[i],A->x[i]); } return B; } /** * \brief Get the element at position (row,col) from the matrix A. * * \param A Source matrix. * \param row Starting row. * \param col Starting column. * * \todo This function is considerably slower than it needs to be. * * \ingroup Assignment */ static inline word mzd_slice_read_elem(const mzd_slice_t *A, const rci_t row, const rci_t col) { word ret = 0; for(int i=0; idepth; i++) { ret |= mzd_read_bit(A->x[i], row, col)<depth; i++) { __mzd_xor_bits(A->x[i], row, col, 1, elem&1); elem=elem>>1; } } /** * \brief Write the element elem to the position (row,col) in the matrix A. * * \param A Target matrix. * \param row Starting row. * \param col Starting column. * \param elem finite field element. * * \todo This function is considerably slower than it needs to be. * * \ingroup Assignment */ static inline void mzd_slice_write_elem(mzd_slice_t *A, const rci_t row, const rci_t col, word elem) { for(int i=0; idepth; i++) { mzd_write_bit(A->x[i], row, col, elem&1); elem=elem>>1; } } /** * \brief Return -1,0,1 if if A < B, A == B or A > B respectively. * * \param A Matrix. * \param B Matrix. * * \note This comparison is not well defined (except for !=0) * mathematically and relatively arbitrary since elements of GF(2^k) * don't have an ordering. * * \ingroup Comparison */ static inline int mzd_slice_cmp(mzd_slice_t *A, mzd_slice_t *B) { int r = 0; if ((A->finite_field != B->finite_field) | (A->depth != B->depth) ) return -1; for(int i=0; idepth; i++) r |= mzd_cmp(A->x[i],B->x[i]); return r; } /** * \brief Zero test for matrix. * * \param A Input matrix. * * \ingroup Comparison */ static inline int mzd_slice_is_zero(const mzd_slice_t *A) { for(int i=0; idepth; i++) { if (!mzd_is_zero(A->x[i])) return 0; } return 1; } /** * \brief Swap the two rows rowa and rowb. * * \param A Matrix * \param rowa Row index. * \param rowb Row index. * * \ingroup RowOperations */ static inline void mzd_slice_row_swap(mzd_slice_t *A, const rci_t rowa, const rci_t rowb) { for(int i=0; idepth; i++) { mzd_row_swap(A->x[i], rowa, rowb); } } /** * \brief copy row j from A to row i from B. * * The number of columns of A must be less than or equal to the number of columns of B. * * \param B Target matrix. * \param i Target row index. * \param A Source matrix. * \param j Source row index. * * \ingroup RowOperations */ static inline void mzd_slice_copy_row(mzd_slice_t* B, size_t i, const mzd_slice_t* A, size_t j) { for(int ii=0; iidepth; ii++) mzd_copy_row(B->x[ii], i, A->x[ii], j); } /** * \brief Swap the two columns cola and colb. * * \param A Matrix. * \param cola Column index. * \param colb Column index. * * \ingroup RowOperations */ static inline void mzd_slice_col_swap(mzd_slice_t *A, const rci_t cola, const rci_t colb) { for(int i=0; idepth; i++) mzd_col_swap(A->x[i], cola, colb); } /** * \brief Swap the two columns cola and colb but only between start_row and stop_row. * * \param A Matrix. * \param cola Column index. * \param colb Column index. * \param start_row Row index. * \param stop_row Row index (exclusive). */ static inline void mzd_slice_col_swap_in_rows(mzd_slice_t *A, const rci_t cola, const rci_t colb, const rci_t start_row, rci_t stop_row) { for(unsigned int e=0; e < A->finite_field->degree; e++) { mzd_col_swap_in_rows(A->x[e], cola, colb, start_row, stop_row); }; } /** * \brief Add the rows sourcerow and destrow and stores the total in * the row destrow. * * \param A Matrix * \param sourcerow Index of source row * \param destrow Index of target row * * \note this can be done much faster with mzd_combine. * * \ingroup RowOperations */ static inline void mzd_slice_row_add(mzd_slice_t *A, const rci_t sourcerow, const rci_t destrow) { for(int i=0; idepth; i++) mzd_row_add(A->x[i], sourcerow, destrow); } /** * \brief Print a matrix to stdout. * * \param A Matrix * * \ingroup StringConversions */ void mzd_slice_print(const mzd_slice_t *A); /** * \brief Move the submatrix L of rank r2 starting at column n1 to the left to column r1. * * \param A Matrix * \param r1 Integer < n1 * \param n1 Integer > r1 * \param r2 Integer <= A->ncols - n1 */ static inline void _mzd_slice_compress_l(mzd_slice_t *A, const rci_t r1, const rci_t n1, const rci_t r2) { for(int i=0; idepth; i++) _mzd_compress_l(A->x[i], r1, n1, r2); } /** * \brief Concatenate B to A and write the result to C. * * That is, \verbatim [ A ], [ B ] -> [ A B ] = C \endverbatim * The inputs are not modified but a new matrix is created. * * \param C Matrix, may be NULL for automatic creation. * \param A Matrix. * \param B Matrix. * * \note This is sometimes called augment. * * \ingroup Constructions */ static inline mzd_slice_t *mzd_slice_concat(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { if(C == NULL) C = mzd_slice_init(A->finite_field, A->nrows, A->ncols + B->ncols); for(int i=0; idepth; i++) { mzd_concat(C->x[i], A->x[i], B->x[i]); } return C; } /** * \brief Stack A on top of B and write the result to C. * * That is, \verbatim [ A ], [ B ] -> [ A ] = C [ B ] \endverbatim * The inputs are not modified but a new matrix is created. * * \param C Matrix, may be NULL for automatic creation * \param A Matrix * \param B Matrix * * \ingroup Constructions */ static inline mzd_slice_t *mzd_slice_stack(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { if(C == NULL) C = mzd_slice_init(A->finite_field, A->nrows + B->nrows, A->ncols); for(int i=0; idepth; i++) { mzd_stack(C->x[i], A->x[i], B->x[i]); } return C; } /** * \brief Copy a submatrix. * * \param S Preallocated space for submatrix, may be NULL for automatic creation. * \param A Matrix * \param lowr start rows * \param lowc start column * \param highr stop row (this row is \em not included) * \param highc stop column (this column is \em not included) * * \ingroup Constructions */ static inline mzd_slice_t *mzd_slice_submatrix(mzd_slice_t *S, const mzd_slice_t *A, const size_t lowr, const size_t lowc, const size_t highr, const size_t highc) { if(S==NULL) S = mzd_slice_init(A->finite_field, highr - lowr, highc - lowc); for(int i=0; idepth; i++) { mzd_submatrix(S->x[i], A->x[i], lowr, lowc, highr, highc); } return S; } /** * \brief Create a window/view into the matrix M. * * A matrix window for M is a meta structure on the matrix M. It is * setup to point into the matrix so M \em must \em not be freed while the * matrix window is used. * * This function puts the restriction on the provided parameters that * all parameters must be within range for M which is not currently * enforced. * * Use mzd_slice_free_window() to free the window. * * \param A Matrix * \param lowr Starting row (inclusive) * \param lowc Starting column (inclusive) * \param highr End row (exclusive) * \param highc End column (exclusive) * * \ingroup Constructions */ static inline mzd_slice_t *mzd_slice_init_window(const mzd_slice_t *A, const size_t lowr, const size_t lowc, const size_t highr, const size_t highc) { mzd_slice_t *B = (mzd_slice_t *)m4ri_mm_malloc(sizeof(mzd_slice_t)); B->finite_field = A->finite_field; B->depth = A->depth; B->nrows = highr - lowr; B->ncols = highc - lowc; for(int i=0; idepth; i++) { B->x[i] = mzd_init_window(A->x[i], lowr, lowc, highr, highc); } return B; } /** * \brief Free a matrix window created with mzd_slice_init_window(). * * \param A Matrix * * \ingroup Constructions */ static inline void mzd_slice_free_window(mzd_slice_t *A) { for(int i=0; idepth; i++) { mzd_free_window(A->x[i]); } m4ri_mm_free(A); } /** * \brief \f$ C = A + B\f$. * * \param C Preallocated sum matrix. * \param A Matrix * \param B Matrix * * \ingroup Addition */ static inline mzd_slice_t *_mzd_slice_add(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { _mzd_ptr_add(C->x, (const mzd_t**)A->x, (const mzd_t**)B->x, A->depth); return C; } /** * \brief \f$ C = A + B\f$. * * C is also returned. If C is NULL then a new matrix is created which * must be freed by mzd_slice_free(). * * \param C Preallocated sum matrix, may be NULL for automatic creation. * \param A Matrix * \param B Matrix * * \ingroup Addition */ static inline mzd_slice_t *mzd_slice_add(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { if ( (A->finite_field != B->finite_field) | (A->nrows != B->nrows) | (A->ncols != B->ncols) ) m4ri_die("mzd_slice_add: input matrices A (%d x %d) and B (%d x %d) do not match.\n",A->nrows,A->ncols, B->nrows,B->ncols); if(C == NULL) C = mzd_slice_init(A->finite_field, A->nrows, A->ncols); else if ( (A->finite_field != C->finite_field) | (A->nrows != C->nrows) | (A->ncols != C->ncols) ) m4ri_die("mzd_slice_add: input matrix A (%d x %d) and output matrix (%d x %d) do not match.\n",A->nrows,A->ncols, C->nrows, C->ncols); return _mzd_slice_add(C,A,B); } /** * \brief \f$ C = A + B\f$. * * C is also returned. If C is NULL then a new matrix is created which * must be freed by mzd_slice_free(). * * \param C Preallocated sum matrix, may be NULL for automatic creation. * \param A Matrix * \param B Matrix * * \ingroup Addition */ #define mzd_slice_sub mzd_slice_add /** * \brief \f$ C = A + B\f$. * * \param C Preallocated sum matrix, may be NULL for automatic creation. * \param A Matrix * \param B Matrix * * \ingroup Addition */ #define _mzd_slice_sub _mzd_slice_add /** * \brief \f$ C = A \cdot B \f$ using quadratic polynomial multiplication with matrix coefficients. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \ingroup Multiplication */ mzd_slice_t *_mzd_slice_addmul_naive(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B); /** * \brief \f$ C = C + A \cdot B \f$ using Karatsuba multiplication of polynomials over matrices over \GF2. * * This function reduces matrix multiplication over \GF2E to matrix * multiplication over \GF2. * * As an example consider \f$ \mathbb{F}_4 \f$. The minimal polynomial is * \f$ x^2 + x + 1 \f$. The matrix A can be represented as A0*x + A1 and the matrix B * can be represented as B0*x + B1. Their product C is * \f[ A0 \cdot B0 \cdot x^2 + (A0 \cdot B1 + A1 \cdot B0) \cdot x + A1*B1. * \f] * Reduction modulo x^2 + x + 1 gives * \f[ (A0 \cdot B0 + A0 \cdot B1 + A1 \cdot B0) \cdot x + A1 \cdot B1 + A0 \cdot B0. * \f] * This can be re-written as * \f[ ((A0 + A1) \cdot (B0 + B1) + A1 \cdot B1) \cdot x + A1 \cdot B1 + A0 \cdot B0 * \f] * and thus this multiplication costs 3 matrix multiplications over * \GF2 and 4 matrix additions over \GF2. * * This technique was proposed in Tomas J. Boothby and Robert * W. Bradshaw; Bitslicing and the Method of Four Russians Over Larger * Finite Fields; 2009; http://arxiv.org/abs/0901.1413 * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa mzed_mul() mzd_slice_mul() mzd_slice_addmul_karatsuba() * * \ingroup Multiplication */ static inline mzd_slice_t *_mzd_slice_addmul_karatsuba(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { if (C == NULL) C = mzd_slice_init(A->finite_field, A->nrows, B->ncols); switch(A->finite_field->degree) { case 2: _mzd_ptr_addmul_karatsuba2(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 3: _mzd_ptr_addmul_karatsuba3(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 4: _mzd_ptr_addmul_karatsuba4(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 5: _mzd_ptr_addmul_karatsuba5(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 6: _mzd_ptr_addmul_karatsuba6(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 7: _mzd_ptr_addmul_karatsuba7(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 8: _mzd_ptr_addmul_karatsuba8(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 9: _mzd_ptr_addmul_karatsuba9(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 10: _mzd_ptr_addmul_karatsuba10(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 11: _mzd_ptr_addmul_karatsuba11(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 12: _mzd_ptr_addmul_karatsuba12(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 13: _mzd_ptr_addmul_karatsuba13(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 14: _mzd_ptr_addmul_karatsuba14(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 15: _mzd_ptr_addmul_karatsuba15(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 16: _mzd_ptr_addmul_karatsuba16(A->finite_field, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; default: C = _mzd_slice_addmul_naive(C, A, B); break; } return C; } /** * \brief \f$ C = A \cdot B \f$ using Karatsuba multiplication of polynomials over matrices over \GF2. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_addmul_karatsuba() * * \ingroup Multiplication */ static inline mzd_slice_t *mzd_slice_mul_karatsuba(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzd_slice_mul_karatsuba: rows, columns and fields must match.\n"); if (C != NULL) { if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzd_slice_mul_karatsuba: rows and columns of returned matrix must match.\n"); mzd_slice_set_ui(C,0); } return _mzd_slice_addmul_karatsuba(C, A, B); } /** * \brief \f$ C = C + A \cdot B\f$ using Karatsuba multiplication of polynomials over matrices over \GF2. * * \param C Preallocated return matrix. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_addmul_karatsuba() * * \ingroup Multiplication */ static inline mzd_slice_t *mzd_slice_addmul_karatsuba(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { assert(C != NULL); if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzd_slice_addmul_karatsuba: rows, columns and fields must match.\n"); if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzd_slice_addmul_karatsuba: rows and columns of returned matrix must match.\n"); return _mzd_slice_addmul_karatsuba(C, A, B); } /** * \brief \f$ C = A \cdot B \f$ using bilinear maps over matrices over \GF2. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * \param f Blinear map such that C == H*((F*A) x (G*B)), if NULL it will be created and destroyed * * \ingroup Multiplication * * \note Calling _mzd_slice_addmul_karatsuba will be more efficient */ static inline mzd_slice_t *_mzd_slice_mul_blm(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B, blm_t *f) { if (C == NULL) C = mzd_slice_init(A->finite_field, A->nrows, B->ncols); int free_f = 0; if (f == NULL) { const deg_t d = C->finite_field->degree; if (d > 16) m4ri_die("degrees > 16 unsupported.\n"); int *p = (int *)m4ri_mm_calloc(M4RIE_MAX_DEGREE+1, sizeof(int)); p[d] = 1; free_f = 1; f = blm_init_crt(C->finite_field, d, d, p, 1); m4ri_mm_free(p); } _mzd_ptr_apply_blm(C->x, (const mzd_t**)A->x, (const mzd_t**)B->x, f); if (free_f) blm_free(f); return C; } /** * \brief \f$ C = A \cdot B \f$ using bilinear maps over matrices over \GF2. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * \param f Blinear map such that C == H*((F*A) x (G*B)), if NULL it will be created and destroyed * * \ingroup Multiplication * * \note Calling mzd_slice_mul_karatsuba will be more efficient */ static inline mzd_slice_t *mzd_slice_mul_blm(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B, blm_t *f) { if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzd_slice_mul_karatsuba: rows, columns and fields must match.\n"); if (C != NULL) { if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzd_slice_mul_karatsuba: rows and columns of returned matrix must match.\n"); mzd_slice_set_ui(C,0); } return _mzd_slice_mul_blm(C, A, B, f); } /** * \brief \f$ C = C + A \cdot B \f$ using bilinear maps over matrices over \GF2. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * \param f Blinear map such that C == C + H*((F*A) x (G*B)), if NULL it will be created and destroyed * * \ingroup Multiplication * * \note Calling mzd_slice_addmul_karatsuba will be more efficient */ static inline mzd_slice_t *mzd_slice_addmul_blm(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B, blm_t *f) { assert(C != NULL); if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzd_slice_addmul_karatsuba: rows, columns and fields must match.\n"); if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzd_slice_addmul_karatsuba: rows and columns of returned matrix must match.\n"); mzd_slice_t *T = _mzd_slice_mul_blm(NULL, A, B, f); mzd_slice_add(C, C, T); mzd_slice_free(T); return C; } /** * \brief \f$ C = a \cdot B \f$. * * \param C Preallocated product matrix or NULL. * \param a finite field element. * \param B Input matrix B. * * \ingroup Multiplication */ mzd_slice_t *mzd_slice_mul_scalar(mzd_slice_t *C, const word a, const mzd_slice_t *B); /** * \brief \f$ C += a \cdot B \f$. * * \param C Preallocated product matrix. * \param a finite field element. * \param B Input matrix B. * * \ingroup Multiplication */ mzd_slice_t *mzd_slice_addmul_scalar(mzd_slice_t *C, const word a, const mzd_slice_t *B); /** * \brief \f$ C = A \cdot B \f$. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_addmul_karatsuba() * * \ingroup Multiplication */ static inline mzd_slice_t *mzd_slice_mul(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { return mzd_slice_mul_karatsuba(C,A,B); } /** * \brief \f$ C = C + A \cdot B \f$. * * \param C Preallocated return matrix. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_addmul_karatsuba(n) * * \ingroup Multiplication */ static inline mzd_slice_t *mzd_slice_addmul(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { return mzd_slice_addmul_karatsuba(C,A,B); } /** * \brief Fill matrix A with random elements. * * \param A Matrix * * \todo Allow the user to provide a RNG callback. * * \ingroup Assignment */ static inline void mzd_slice_randomize(mzd_slice_t *A) { for(int i=0; idepth; i++) mzd_randomize(A->x[i]); } /** * \brief Copy matrix A to B. * * \param B May be NULL for automatic creation. * \param A Source matrix. * * \ingroup Assignment */ #endif //M4RIE_MZD_SLICE m4rie-20200125/m4rie/mzd_poly.h0000644000175000017500000001727413206144356012755 00000000000000/** * \file mzd_poly.h * * \brief Matrices over \GF2[x] * * @warning This code is experimental. */ #ifndef M4RIE_MZD_POLY_H #define M4RIE_MZD_POLY_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include "mzd_ptr.h" #include "gf2x.h" #include "blm.h" /** * \brief will be the data type for matrices over \GF2[x] in the future */ typedef struct { mzd_t **x; /**< Coefficients. */ rci_t nrows; /**< Number of rows. */ rci_t ncols; /**< Number of columns. */ deg_t depth; /**< Degree +1 */ } mzd_poly_t; /** * \brief C += (A+B)*x^offset * * \param C Target polynomial. * \param A Source polynomial. * \param B Source polynomial. * \param offset The result is shifted offset entries upwards. * * \ingroup Addition * * \warning No bounds checks are performed. */ static inline mzd_poly_t *_mzd_poly_add(mzd_poly_t *C, const mzd_poly_t *A, const mzd_poly_t *B, unsigned int offset) { _mzd_ptr_add(C->x+offset, (const mzd_t**)A->x, (const mzd_t**)B->x, A->depth); return C; } /** * \brief C += (A+B) * * \param C Target polynomial. * \param A Source polynomial. * \param B Source polynomial. * * \ingroup Addition */ static inline mzd_poly_t *mzd_poly_add(mzd_poly_t *C, const mzd_poly_t *A, const mzd_poly_t *B) { assert(C->depth >= A->depth && A->depth == B->depth); return _mzd_poly_add(C, A, B, 0); } /** * \brief Create a new polynomial of degree d with m x n matrices as coefficients. * * \param d Degree. * \param m Number of rows. * \param n Number of columns. * * \ingroup Constructions */ static inline mzd_poly_t *mzd_poly_init(const deg_t d, const rci_t m, const rci_t n) { mzd_poly_t *A = (mzd_poly_t*)m4ri_mm_malloc(sizeof(mzd_poly_t)); A->x = (mzd_t**)m4ri_mm_malloc(sizeof(mzd_t*)*(d+1)); A->nrows = m; A->ncols = n; A->depth = d+1; for(int i=0; idepth; i++) A->x[i] = mzd_init(m,n); return A; } /** * \brief Free polynomial A * * \param A Polynomial. * * \ingroup Constructions */ static inline void mzd_poly_free(mzd_poly_t *A) { for(int i=0; idepth; i++) mzd_free(A->x[i]); m4ri_mm_free(A->x); m4ri_mm_free(A); } /** * \brief change depth of A to new_depth. * * \param A Polynomial. * \param new_depth New depth (may be <,=,> than current depth). * * \ingroup Constructions */ static inline mzd_poly_t *_mzd_poly_adapt_depth(mzd_poly_t *A, const deg_t new_depth) { if (new_depth < A->depth) { for(int i=new_depth; idepth; i++) { mzd_free(A->x[i]); A->x[i] = NULL; } } else { for(int i=A->depth; ix[i] = mzd_init(A->nrows,A->ncols); } } A->depth = new_depth; return A; } /** * \brief C += A*B using naive polynomial multiplication * * \param C Target polynomial. * \param A Source polynomial. * \param B Source polynomial. * * \ingroup Multiplication */ static inline mzd_poly_t *_mzd_poly_addmul_naive(mzd_poly_t *C, const mzd_poly_t *A, const mzd_poly_t *B) { if (C == NULL) C = mzd_poly_init(A->depth+B->depth-1, A->nrows, B->ncols); for(unsigned int i=0; idepth; i++) { for(unsigned int j=0; jdepth; j++) { mzd_addmul(C->x[i+j], A->x[i], B->x[j], 0); } } return C; } /** * \brief C += A*B using Karatsuba multiplication on balanced inputs * * \param C Target polynomial. * \param A Source polynomial. * \param B Source polynomial. * * \ingroup Multiplication */ static inline mzd_poly_t *_mzd_poly_addmul_karatsubs_balanced(mzd_poly_t *C, const mzd_poly_t *A, const mzd_poly_t *B) { assert(A->depth == B->depth); if (C == NULL) C = mzd_poly_init(A->depth+B->depth-1, A->nrows, B->ncols); switch(A->depth) { case 0: m4ri_die("depth 0: seriously?"); case 1: mzd_addmul(C->x[0], A->x[0], B->x[0], 0); break; case 2: _mzd_ptr_addmul_karatsuba2(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 3: _mzd_ptr_addmul_karatsuba3(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 4: _mzd_ptr_addmul_karatsuba4(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 5: _mzd_ptr_addmul_karatsuba5(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 6: _mzd_ptr_addmul_karatsuba6(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 7: _mzd_ptr_addmul_karatsuba7(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 8: _mzd_ptr_addmul_karatsuba8(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 9: _mzd_ptr_addmul_karatsuba9(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 10: _mzd_ptr_addmul_karatsuba10(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 11: _mzd_ptr_addmul_karatsuba11(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 12: _mzd_ptr_addmul_karatsuba12(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 13: _mzd_ptr_addmul_karatsuba13(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 14: _mzd_ptr_addmul_karatsuba14(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 15: _mzd_ptr_addmul_karatsuba15(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; case 16: _mzd_ptr_addmul_karatsuba16(NULL, C->x, (const mzd_t**)A->x, (const mzd_t**)B->x); break; default: m4ri_die("Not implemented\n"); } return C; } /** * \brief C += A*B by applying the bilinear maps f, i.e. f->H*((f->F*A) x (f->G*B)). */ static inline mzd_poly_t *_mzd_poly_addmul_blm(mzd_poly_t *C, mzd_poly_t *A, mzd_poly_t *B, const blm_t *f) { assert(f!=NULL); assert(f->F->ncols == A->depth && f->G->ncols == B->depth); if (C == NULL) C = mzd_poly_init(A->depth+B->depth-1, A->nrows, B->ncols); _mzd_ptr_apply_blm(C->x, (const mzd_t**)A->x, (const mzd_t**)B->x, f); return C; } /** * \brief C += A*B using the Chinese Remainder Theorem. */ static inline mzd_poly_t *_mzd_poly_addmul_crt(mzd_poly_t *C, mzd_poly_t *A, mzd_poly_t *B) { int *p = crt_init(A->depth, B->depth); blm_t *f = blm_init_crt(NULL, A->depth, B->depth, p, 1); _mzd_poly_addmul_blm(C, A, B, f); blm_free(f); m4ri_mm_free(p); return C; } /** * \brief C += A*B using arithmetic in GF(2^log2(d)) if C has degree d. */ mzd_poly_t *_mzd_poly_addmul_ext1(mzd_poly_t *C, mzd_poly_t *A, mzd_poly_t *B); /** * \brief Return -1,0,1 if if A < B, A == B or A > B respectively. * * \param A Matrix. * \param B Matrix. * * \note This comparison is not well defined (except for !=0) mathematically and relatively * arbitrary. * * \ingroup Comparison */ static inline int mzd_poly_cmp(mzd_poly_t *A, mzd_poly_t *B) { int r = 0; if ((A->depth != B->depth) ) { if (A->depth < B->depth) return -1; else return 1; } for(int i=0; idepth; i++) r |= mzd_cmp(A->x[i],B->x[i]); return r; } /** * \brief Fill matrix A with random elements. * * \param A Matrix * * \todo Allow the user to provide a RNG callback. * * \ingroup Assignment */ static inline void mzd_poly_randomize(mzd_poly_t *A) { for(int i=0; idepth; i++) mzd_randomize(A->x[i]); } #endif //M4RIE_MZD_POLY_H m4rie-20200125/m4rie/mzd_ptr.h0000644000175000017500000001736613206144356012601 00000000000000#ifndef M4RIE_MZD_PTR_H #define M4RIE_MZD_PTR_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2013 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include /** * \brief Add A to coefficient of X^t but perform modular reductions on the fly. * * (A + X^t % minpoly) * * \param ff Finite field (must not be NULL) * \param A Matrix * \param X Matrix list * \param t Integer >= 0 (degree) */ static inline void _mzd_ptr_add_modred(const gf2e *ff, const mzd_t *A, mzd_t **X, const int t) { if (mzd_is_zero(A)) return; if ((ff==NULL) || (t < ff->degree)) { mzd_add(X[t], X[t], A); return; } word pow_gen = ff->pow_gen[t]; for(int i=0; idegree; i++) { if (pow_gen & (1< 0 */ static inline mzd_t *_mzd_ptr_add_to_all(const gf2e *ff, mzd_t *A, mzd_t **X, const int n, ...) { va_list b_list; va_start( b_list, n ); if (ff) for( int i = 0 ; i < n; i++ ) { int t = va_arg(b_list, int); _mzd_ptr_add_modred(ff, A, X, t); } else for( int i = 0 ; i < n; i++ ) { int t = va_arg(b_list, int); mzd_add(X[t], X[t], A); } va_end( b_list ); return A; } static inline void _mzd_ptr_add(mzd_t **c, const mzd_t **a, const mzd_t **b, const deg_t length) { switch(length) { case 32: mzd_add(c[31], a[31], b[31]); case 31: mzd_add(c[30], a[30], b[30]); case 30: mzd_add(c[29], a[29], b[29]); case 29: mzd_add(c[28], a[28], b[28]); case 28: mzd_add(c[27], a[27], b[27]); case 27: mzd_add(c[26], a[26], b[26]); case 26: mzd_add(c[25], a[25], b[25]); case 25: mzd_add(c[24], a[24], b[24]); case 24: mzd_add(c[23], a[23], b[23]); case 23: mzd_add(c[22], a[22], b[22]); case 22: mzd_add(c[21], a[21], b[21]); case 21: mzd_add(c[20], a[20], b[20]); case 20: mzd_add(c[19], a[19], b[19]); case 19: mzd_add(c[18], a[18], b[18]); case 18: mzd_add(c[17], a[17], b[17]); case 17: mzd_add(c[16], a[16], b[16]); case 16: mzd_add(c[15], a[15], b[15]); case 15: mzd_add(c[14], a[14], b[14]); case 14: mzd_add(c[13], a[13], b[13]); case 13: mzd_add(c[12], a[12], b[12]); case 12: mzd_add(c[11], a[11], b[11]); case 11: mzd_add(c[10], a[10], b[10]); case 10: mzd_add(c[ 9], a[ 9], b[ 9]); case 9: mzd_add(c[ 8], a[ 8], b[ 8]); case 8: mzd_add(c[ 7], a[ 7], b[ 7]); case 7: mzd_add(c[ 6], a[ 6], b[ 6]); case 6: mzd_add(c[ 5], a[ 5], b[ 5]); case 5: mzd_add(c[ 4], a[ 4], b[ 4]); case 4: mzd_add(c[ 3], a[ 3], b[ 3]); case 3: mzd_add(c[ 2], a[ 2], b[ 2]); case 2: mzd_add(c[ 1], a[ 1], b[ 1]); case 1: mzd_add(c[ 0], a[ 0], b[ 0]); case 0: break; default: for(deg_t i=0; i= 2 (ff != NULL) or >=3 (ff == NULL) * \param A Input matrix A, preallocated of length >= 2. * \param B Input matrix B, preallocated of length >= 2. * * \sa _mzd_ptr_addmul_karatsuba() * * \ingroup Multiplication */ void _mzd_ptr_addmul_karatsuba2(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF8 using 6 multiplications over \GF2 and 3 temporary \GF2 matrices.. */ void _mzd_ptr_addmul_karatsuba3(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF16 using 9 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba4(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ C += A \cdot B \f$ over \GF32 using 13 multiplications over \GF2 and 3 temporary \GF2 matrices.. */ void _mzd_ptr_addmul_karatsuba5(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ C += A \cdot B \f$ over \GF64 using 17 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba6(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF128 using 22 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba7(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF256 using 27 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba8(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF512 using 31 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba9(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF1024 using 36 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba10(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF2048 using 40 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba11(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF4096 using 45 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba12(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF8192 using 49 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba13(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF16384 using 55 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba14(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF32768 using 60 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba15(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * \brief \f$ X += A \cdot B \f$ over \GF65536 using 64 multiplications over \GF2 and 3 temporary \GF2 matrices. */ void _mzd_ptr_addmul_karatsuba16(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B); /** * W = m*V * * Apply the linear map m to V (considered as a vector) and write the result to W. * * \param m Linear map * \param W Output vector of matrices mod 2. * \oaram V Input vector of matrices mod 2. */ void djb_apply_mzd_ptr(djb_t *m, mzd_t **W, const mzd_t **V); #endif //M4RIE_MZD_PTR_H m4rie-20200125/m4rie/blm.h0000644000175000017500000001011213206144356011652 00000000000000/** * \file blm.h * * \brief Bilinear Maps on Matrices over GF(2). * * This is used to realise mzd_poly_t multiplication. * * \author Martin Albrecht */ #ifndef M4RIE_BLM_H #define M4RIE_BLM_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2013 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include "m4rie/gf2e.h" /** * \brief We consider at most polynomials of degree M4RIE_MAX_DEGREE in CRT. */ #define M4RIE_CRT_LEN (M4RIE_MAX_DEGREE + 1) /** * \brief Bilinear Maps on Matrices over GF(2). * * Encodes the bilinear map H*((F*A) x (G*B)) where A,B are vectors of mzd_t, "*" is matrix-vector * multiplication and "x" is pointwise multiplication. * * If a DJB map is not NULL, it will be used instead its matrix representant. */ typedef struct { mzd_t *H; /*!< final linear map H*/ djb_t *h; /*!< final linear map H (DJB encoding)*/ mzd_t *F; /*!< lineatr map on A */ djb_t *f; /*!< lineatr map on N (DJB encoding) */ mzd_t *G; /*!< lineatr map on B */ djb_t *g; /*!< lineatr map on B (DJB encoding) */ } blm_t; /** * costs[i] = cost of multiplying two polynomials of length i over \GF2. */ extern const int costs[17]; /** * Return the multiplication cost of the multiplication scheme p */ static inline int blm_cost_crt(const int p[M4RIE_CRT_LEN]) { int cost = costs[p[0]]; for(deg_t d=1; d= f_len*g_len-1. * * We store the number of polynomials of degree d in p[d]. We store the degree w of (x-infinity)^w * in p[0]. */ int *crt_init(const deg_t f_len, const deg_t g_len); /** * Compute H, F, G such that vec(c) = H*(F*vec(a) x G*vec(b)) * with poly(c) = poly(a)*poly(b), * deg(poly(a)) = a_ncols -1, deg(poly(b)) = b_ncols -1 and "x" being pointwise multiplication * * This is realised by a multi-modular computation modulo the primes up to degree deg (which may not * be irreducible polynomials, but merely co-prime). */ blm_t *blm_init_crt(const gf2e *ff, const deg_t f_ncols, const deg_t g_ncols, const int *p, int djb); /** * Given F and G compute H. * * \param ff finite field for modular reduction * \param f Bilinear Map with F and G already computed. */ blm_t *_blm_finish_polymult(const gf2e *ff, blm_t *f); /** * Free bilinear map f. */ void blm_free(blm_t *f); /** * \brief Compile DJB map for f * * \param f Bilinear map */ blm_t *_blm_djb_compile(blm_t *f); /** * \brief Apply f (stored as a matrix) on A and B, writing to X * * \param X Array of matrices * \param A Array of matrices * \param B Array of matrices * \param f Bilinear map */ void _mzd_ptr_apply_blm_mzd(mzd_t **X, const mzd_t **A, const mzd_t **B, const blm_t *f); /** * \brief Apply f (stored as a DJB map) on A and B, writing to X * * \param X Array of matrices * \param A Array of matrices * \param B Array of matrices * \param f Bilinear map */ void _mzd_ptr_apply_blm_djb(mzd_t **X, const mzd_t **A, const mzd_t **B, const blm_t *f); /** * \brief Apply f on A and B, writing to X * * \param X Array of matrices * \param A Array of matrices * \param B Array of matrices * \param f Bilinear map */ static inline void _mzd_ptr_apply_blm(mzd_t **X, const mzd_t **A, const mzd_t **B, const blm_t *f) { if (f->f!=NULL) _mzd_ptr_apply_blm_djb(X, A, B, f); else _mzd_ptr_apply_blm_mzd(X, A, B, f); } #endif //M4RIE_BLM_H m4rie-20200125/m4rie/trsm.h0000644000175000017500000001032013206144356012066 00000000000000/** * \file trsm.h * \brief Triangular System Solving with Matrices (TRSM). * * \author Martin Albrecht */ #ifndef TRSM_H #define TRSM_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #define MZED_TRSM_CUTOFF 512 /**< Crossover dimension to TRSM base cases */ /** * \brief \f$B = U^{-1} \cdot B\f$ * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * \param cutoff Crossover dimension to base case. * * \ingroup Triangular */ void _mzed_trsm_upper_left(const mzed_t *U, mzed_t *B, const rci_t cutoff); /** * \brief \f$B = U^{-1} \cdot B\f$ * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzed_trsm_upper_left_naive(const mzed_t *U, mzed_t *B); /** * \brief \f$B = U^{-1} \cdot B\f$ * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ static inline void mzed_trsm_upper_left(const mzed_t *U, mzed_t *B) { _mzed_trsm_upper_left(U, B, MZED_TRSM_CUTOFF); } /** * \brief \f$B = U^{-1} \cdot B\f$ * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * \param cutoff Crossover dimension to base case. * * \ingroup Triangular */ void _mzd_slice_trsm_upper_left(const mzd_slice_t *U, mzd_slice_t *B, const rci_t cutoff); /** * \brief \f$B = U^{-1} \cdot B\f$ * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzd_slice_trsm_upper_left_naive(const mzd_slice_t *U, mzd_slice_t *B); /** * \brief \f$B = U^{-1} \cdot B\f$ * * \param U Upper-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ static inline void mzd_slice_trsm_upper_left(const mzd_slice_t *U, mzd_slice_t *B) { _mzd_slice_trsm_upper_left(U, B, MZED_TRSM_CUTOFF); } /** * \brief \f$B = L^{-1} \cdot B\f$ * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * \param cutoff Crossover dimension to base case. * * \ingroup Triangular */ void _mzed_trsm_lower_left(const mzed_t *L, mzed_t *B, const rci_t cutoff); /** * \brief \f$B = L^{-1} \cdot B\f$ * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzed_trsm_lower_left_naive(const mzed_t *L, mzed_t *B); /** * \brief \f$B = L^{-1} \cdot B\f$ * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ static inline void mzed_trsm_lower_left(const mzed_t *L, mzed_t *B) { _mzed_trsm_lower_left(L, B, MZED_TRSM_CUTOFF); } /** * \brief \f$B = L^{-1} \cdot B\f$ * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * \param cutoff Crossover dimension to base case. * * \ingroup Triangular */ void _mzd_slice_trsm_lower_left(const mzd_slice_t *L, mzd_slice_t *B, const rci_t cutoff); /** * \brief \f$B = L^{-1} \cdot B\f$ * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ void mzd_slice_trsm_lower_left_naive(const mzd_slice_t *L, mzd_slice_t *B); /** * \brief \f$B = L^{-1} \cdot B\f$ * * \param L Lower-triangular matrix (other entries are ignored). * \param B Matrix. * * \ingroup Triangular */ static inline void mzd_slice_trsm_lower_left(const mzd_slice_t *L, mzd_slice_t *B) { _mzd_slice_trsm_lower_left(L, B, MZED_TRSM_CUTOFF); } #endif //TRSM_H m4rie-20200125/m4rie/ple.h0000644000175000017500000001467513206144356011702 00000000000000/** * \file ple.h * \brief PLE decomposition: \f$ L \cdot E = P \cdot A\f$. * * \author Martin Albrecht */ #ifndef M4RIE_PLE_H #define M4RIE_PLE_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include #include /** * \brief PLE decomposition: \f$ L \cdot E = P \cdot A \f$. * * Modifies A in place to store lower triangular L below (and on) the * main diagonal and E -- an echelon form of A -- above the main * diagonal (pivots are stored in Q). P and Q are updated with row and * column permutations respectively. * * This function uses naive cubic PLE decomposition depending on the * size of the underlying field. * * \param A Matrix * \param P Permutation vector of length A->nrows * \param Q Permutation vector of length A->ncols * * \ingroup PLE * * \sa mzed_ple_newton_john() mzed_ple() */ rci_t mzed_ple_naive(mzed_t *A, mzp_t *P, mzp_t *Q); /** * \brief PLE decomposition: \f$ L \cdot E = P \cdot A \f$. * * Modifies A in place to store lower triangular L below (and on) the * main diagonal and E -- an echelon form of A -- above the main * diagonal (pivots are stored in Q). P and Q are updated with row and * column permutations respectively. * * This function uses either asymptotically fast PLE decomposition by * reducing it to matrix multiplication or naive cubic PLE * decomposition depending on the size of the underlying field. If * asymptotically fast PLE decomposition is used, then the algorithm * switches to mzed_ple_newton_john if e * ncols * nrows is <= cutoff * where e is the exponent of the finite field. * * \param A Matrix * \param P Permutation vector of length A->nrows * \param Q Permutation vector of length A->ncols * \param cutoff Integer * * \ingroup PLE * * \sa mzed_ple_naive() mzed_ple_newton_john() mzed_ple() */ rci_t _mzd_slice_ple(mzd_slice_t *A, mzp_t *P, mzp_t *Q, rci_t cutoff); /** * \brief PLE decomposition: \f$ L \cdot E = P \cdot A \f$. * * Modifies A in place to store lower triangular L below (and on) the * main diagonal and E -- an echelon form of A -- above the main * diagonal (pivots are stored in Q). P and Q are updated with row and * column permutations respectively. * * This function implements asymptotically fast PLE decomposition by * reducing it to matrix multiplication. * * \param A Matrix * \param P Permutation vector of length A->nrows * \param Q Permutation vector of length A->ncols * * \ingroup PLE * * \sa mzed_ple_naive() mzed_ple_newton_john() _mzd_slice_ple() */ static inline rci_t mzd_slice_ple(mzd_slice_t *A, mzp_t *P, mzp_t *Q) { assert(P->length == A->nrows); assert(Q->length == A->ncols); return _mzd_slice_ple(A, P, Q, 0); } /** * \brief PLUQ decomposition: \f$ L \cdot U \cdot Q = P \cdot A\f$. * * This function implements asymptotically fast PLE decomposition by * reducing it to matrix multiplication. From PLE the PLUQ * decomposition is then obtained. * * \param A Matrix * \param P Permutation vector of length A->nrows * \param Q Permutation vector of length A->ncols * \param cutoff Crossover to base case if mzed_t::w * mzed_t::ncols * mzed_t::nrows < cutoff. * * \ingroup PLE */ rci_t _mzd_slice_pluq(mzd_slice_t *A, mzp_t *P, mzp_t *Q, rci_t cutoff); /** * \brief PLUQ decomposition: \f$ L \cdot U \cdot Q = P \cdot A\f$. * * This function implements asymptotically fast PLE decomposition by * reducing it to matrix multiplication. From PLE the PLUQ * decomposition is then obtained. * * \param A Matrix * \param P Permutation vector of length A->nrows * \param Q Permutation vector of length A->ncols * * \ingroup PLE */ static inline rci_t mzd_slice_pluq(mzd_slice_t *A, mzp_t *P, mzp_t *Q) { assert(P->length == A->nrows); assert(Q->length == A->ncols); return _mzd_slice_pluq(A, P, Q, 0); } /** * \brief PLE decomposition: \f$ L \cdot E = P \cdot A \f$. * * Modifies A in place to store lower triangular L below (and on) the * main diagonal and E -- an echelon form of A -- above the main * diagonal (pivots are stored in Q). P and Q are updated with row and * column permutations respectively. * * This function uses either asymptotically fast PLE decomposition by * reducing it to matrix multiplication or naive cubic PLE * decomposition depending on the size of the underlying field. If * asymptotically fast PLE decomposition is used, then the algorithm * switches to mzed_ple_newton_john if e * ncols * nrows is <= cutoff * where e is the exponent of the finite field. * * \param A Matrix * \param P Permutation vector of length A->nrows * \param Q Permutation vector of length A->ncols * \param cutoff Integer >= 0 * * \ingroup PLE * * \sa mzed_ple_naive() mzed_ple_newton_john() _mzed_ple() */ rci_t _mzed_ple(mzed_t *A, mzp_t *P, mzp_t *Q, rci_t cutoff); /** * Default crossover to PLE base case (Newton-John based). */ #define __M4RIE_PLE_CUTOFF (__M4RI_CPU_L2_CACHE<<2) /** * \brief PLE decomposition: \f$ L \cdot E = P \cdot A \f$. * * Modifies A in place to store lower triangular L below (and on) the * main diagonal and E -- an echelon form of A -- above the main * diagonal (pivots are stored in Q). P and Q are updated with row and * column permutations respectively. * * This function uses either asymptotically fast PLE decomposition by * reducing it to matrix multiplication or naive cubic PLE * decomposition depending on the size of the underlying field. * * \param A Matrix * \param P Permutation vector of length A->nrows * \param Q Permutation vector of length A->ncols * * \ingroup PLE * * \sa mzed_ple_naive() mzed_ple_newton_john() _mzed_ple() * */ static inline rci_t mzed_ple(mzed_t *A, mzp_t *P, mzp_t *Q) { return _mzed_ple(A, P, Q, __M4RIE_PLE_CUTOFF); } #endif //M4RIE_PLE_H m4rie-20200125/m4rie/permutation.h0000644000175000017500000001024013206144356013451 00000000000000/** * \file permutation.h * \brief Permutation matrices. * * \author Martin Albrecht */ #ifndef M4RIE_PERMUTATION_H #define M4RIE_PERMUTATION_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include /** * Apply the permutation P to A from the left. * * This is equivalent to row swaps walking from 0 to length-1. * * \param A Matrix. * \param P Permutation. */ static inline void mzed_apply_p_left(mzed_t *A, mzp_t const *P) { mzd_apply_p_left(A->x, P); } /** * Apply the permutation P to A from the left but transpose P before. * * This is equivalent to row swaps walking from length-1 to 0. * * \param A Matrix. * \param P Permutation. */ static inline void mzed_apply_p_left_trans(mzed_t *A, mzp_t const *P) { mzd_apply_p_left_trans(A->x, P); } /** * Apply the permutation P to A from the right. * * This is equivalent to column swaps walking from length-1 to 0. * * \param A Matrix. * \param P Permutation. */ static inline void mzed_apply_p_right(mzed_t *A, mzp_t const *P) { if(A->nrows == 0) return; rci_t const length = MIN(P->length, A->ncols); for (rci_t i = length-1; i >= 0; --i) { mzed_col_swap(A, i, P->values[i]); } } /** * Apply the permutation P to A from the right but transpose P before. * * This is equivalent to column swaps walking from 0 to length-1. * * \param A Matrix. * \param P Permutation. */ static inline void mzed_apply_p_right_trans(mzed_t *A, mzp_t const *P) { if(A->nrows == 0) return; rci_t const length = MIN(P->length, A->ncols); for (rci_t i = 0; i < length; ++i) { mzed_col_swap(A, i, P->values[i]); } } /** * Apply the permutation P to A from the left. * * This is equivalent to row swaps walking from 0 to length-1. * * \param A Matrix. * \param P Permutation. */ static inline void mzd_slice_apply_p_left(mzd_slice_t *A, mzp_t const *P) { for(int i=0; idepth; i++) { mzd_apply_p_left(A->x[i], P); } } /** * Apply the permutation P to A from the left but transpose P before. * * This is equivalent to row swaps walking from length-1 to 0. * * \param A Matrix. * \param P Permutation. */ static inline void mzd_slice_apply_p_left_trans(mzd_slice_t *A, mzp_t const *P) { for(int i=0; idepth; i++) { mzd_apply_p_left_trans(A->x[i], P); } } /** * Apply the permutation P to A from the right. * * This is equivalent to column swaps walking from length-1 to 0. * * \param A Matrix. * \param P Permutation. */ static inline void mzd_slice_apply_p_right(mzd_slice_t *A, mzp_t const *P) { for(int i=0; idepth; i++) { mzd_apply_p_right(A->x[i], P); } } /** * Apply the permutation P to A from the right but transpose P before. * * This is equivalent to column swaps walking from 0 to length-1. * * \param A Matrix. * \param P Permutation. */ static inline void mzd_slice_apply_p_right_trans(mzd_slice_t *A, mzp_t const *P) { for(int i=0; idepth; i++) { mzd_apply_p_right_trans(A->x[i], P); } } /** * Apply the permutation P to A from the right, but only on the upper * the matrix A above the main diagonal. * * This is equivalent to column swaps walking from 0 to length-1 and * is used to compress PLE to PLUQ. * * \param A Matrix. * \param P Permutation. */ static inline void mzd_slice_apply_p_right_trans_tri(mzd_slice_t *A, mzp_t const *P) { for(int i=0; idepth; i++) { mzd_apply_p_right_trans_tri(A->x[i], P); } } #endif // M4RIE_PERMUTATION_H m4rie-20200125/m4rie/conversion.h0000644000175000017500000002134713206144356013301 00000000000000/** * \file conversion.h * * \brief Conversion between mzed_t and mzd_slice_t * * \author Martin Albrecht */ #ifndef M4RIE_CONVERSION_H #define M4RIE_CONVERSION_H /****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include #include /** * \brief Pack a bitslice matrix into a packed represenation. * * \param A Matrix over \GF2E or NULL * \param Z Bitslice matrix over \GF2E * * \ingroup Constructions */ mzed_t *mzed_cling(mzed_t *A, const mzd_slice_t *Z); /** * \brief Unpack the matrix Z into bitslice representation. * * \param A Bitslice matrix or NULL * \param Z Input matrix * * \ingroup Constructions */ mzd_slice_t *mzed_slice(mzd_slice_t *A, const mzed_t *Z); /** * \brief Unpack the matrix Z over GF(2^2) into bitslice representation. * * Elements in GF(2^2) can be represented as x*a + y where a is a root * of x^2 + x + 1. A0 contains the coefficients for x while A1 * contains the coefficients for y. * * \param A Zero bitslice matrix over GF(2^2) * \param Z Matrix over GF(2^2) */ mzd_slice_t *_mzed_slice2(mzd_slice_t *A, const mzed_t *Z); /** * \brief Unpack the matrix Z over \GF2E into bitslice representation. * * \param A Zero bitslice matrix over \GF2E * \param Z Matrix over \GF2E */ mzd_slice_t *_mzed_slice4(mzd_slice_t *A, const mzed_t *Z); /** * \brief Unpack the matrix Z over \GF2E into bitslice representation. * * \param A Zero bitslice matrix over \GF2E * \param Z Matrix over \GF2E */ mzd_slice_t *_mzed_slice8(mzd_slice_t *A, const mzed_t *Z); /** * \brief Unpack the matrix Z over \GF2E into bitslice representation. * * \param A Zero bitslice matrix over \GF2E * \param Z Matrix over \GF2E */ mzd_slice_t *_mzed_slice16(mzd_slice_t *A, const mzed_t *Z); /** * \brief Pack a bitslice matrix into a classical represenation over GF(2^2). * * Elements in GF(2^2) can be represented as c_1*a + c_0 where a is a * root of x^2 + x + 1. A1 contains the coefficients for c_1 while A0 * contains the coefficients for c_0. * * \param A Matrix over GF(2^2), must be zero * \param Z Bitslice matrix over GF(2^2) */ mzed_t *_mzed_cling2(mzed_t *A, const mzd_slice_t *Z); /** * \brief Pack a bitslice matrix into a classical represenation over \GF2E for 2 < e <= 4. * * \param A Matrix over \GF2E, must be zero * \param Z Bitslice matrix over \GF2E */ mzed_t *_mzed_cling4(mzed_t *A, const mzd_slice_t *Z); /** * \brief Pack a bitslice matrix into a classical represenation over \GF2E for 4 < e <= 8. * * \param A Matrix over \GF2E, must be zero * \param Z Bitslice matrix over \GF2E */ mzed_t *_mzed_cling8(mzed_t *A, const mzd_slice_t *Z); /** * \brief Pack a bitslice matrix into a classical represenation over \GF2E for 8 < e <= 16. * * \param A Matrix over \GF2E, must be zero * \param Z Bitslice matrix over \GF2E */ mzed_t *_mzed_cling16(mzed_t *A, const mzd_slice_t *Z); /** * \brief Compute C += A*B using Karatsuba multiplication of polynomials over GF(2). * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_addmul_karatsuba */ static inline mzed_t *_mzed_addmul_karatsuba(mzed_t *C, const mzed_t *A, const mzed_t *B) { mzd_slice_t *As,*Bs,*Cs; if(C) Cs = mzed_slice(NULL,C); else Cs = NULL; As = mzed_slice(NULL,A); Bs = mzed_slice(NULL,B); Cs = _mzd_slice_addmul_karatsuba(Cs, As, Bs); C = mzed_cling(C, Cs); mzd_slice_free(As); mzd_slice_free(Bs); mzd_slice_free(Cs); return C; } /** * \brief Compute C = A*B. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_mul_karatsuba */ static inline mzed_t *mzed_mul_karatsuba(mzed_t *C, const mzed_t *A, const mzed_t *B) { if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzed_mul_karatsuba: rows, columns and fields must match.\n"); if (C != NULL) { if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzed_mul_karatsuba: rows and columns of returned matrix must match.\n"); mzed_set_ui(C,0); } return _mzed_addmul_karatsuba(C, A, B); } /** * \brief Compute C += A*B. * * \param C Preallocated return matrix. * \param A Input matrix A. * \param B Input matrix B. */ static inline mzed_t *mzed_addmul_karatsuba(mzed_t *C, const mzed_t *A, const mzed_t *B) { assert(C != NULL); if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzed_addmul_karatsuba: rows, columns and fields must match.\n"); if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzed_addmul_karatsuba: rows and columns of returned matrix must match.\n"); return _mzed_addmul_karatsuba(C, A, B); } /** * \brief Compute C += A*B using Bilinear Maps over GF(2). * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_addmul_blm */ static inline mzed_t *_mzed_addmul_blm(mzed_t *C, const mzed_t *A, const mzed_t *B) { mzd_slice_t *As,*Bs; As = mzed_slice(NULL,A); Bs = mzed_slice(NULL,B); mzd_slice_t *Ts = _mzd_slice_mul_blm(NULL, As, Bs, NULL); mzed_t *T = mzed_cling(NULL, Ts); mzd_slice_free(Ts); if (C) { C = mzed_add(C, C, T); mzed_free(T); } else { C = T; } mzd_slice_free(As); mzd_slice_free(Bs); return C; } /** * \brief Compute C = A*B. * * \param C Preallocated return matrix, may be NULL for automatic creation. * \param A Input matrix A. * \param B Input matrix B. * * \sa _mzd_slice_mul_blm */ static inline mzed_t *mzed_mul_blm(mzed_t *C, const mzed_t *A, const mzed_t *B) { if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzed_mul_blm: rows, columns and fields must match.\n"); if (C != NULL) { if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzed_mul_blm: rows and columns of returned matrix must match.\n"); mzed_set_ui(C,0); } return _mzed_addmul_blm(C, A, B); } /** * \brief Compute C += A*B. * * \param C Preallocated return matrix. * \param A Input matrix A. * \param B Input matrix B. */ static inline mzed_t *mzed_addmul_blm(mzed_t *C, const mzed_t *A, const mzed_t *B) { assert(C != NULL); if (A->ncols != B->nrows || A->finite_field != B->finite_field) m4ri_die("mzed_addmul_blm: rows, columns and fields must match.\n"); if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) m4ri_die("mzed_addmul_blm: rows and columns of returned matrix must match.\n"); return _mzed_addmul_blm(C, A, B); } /** * \brief Recale the row r in A by X starting c. * * \param A Matrix * \param r Row index. * \param c Column index. * \param x Multiplier * * \ingroup RowOperations */ static inline void mzd_slice_rescale_row(mzd_slice_t *A, rci_t r, rci_t c, word x) { mzd_slice_t *A_w = mzd_slice_init_window(A, r, 0, r+1, A->ncols); mzed_t *A_we = mzed_cling(NULL, A_w); mzed_rescale_row(A_we, r, c, x); mzed_slice(A_w, A_we); mzed_free(A_we); mzd_slice_free_window(A_w); } ///@cond INTERNAL /* * a bunch of constants to make code more readable */ static const word x80008000 = 0x8000800080008000ULL; static const word x80808080 = 0x8080808080808080ULL; static const word x88888888 = 0x8888888888888888ULL; static const word xaaaaaaaa = 0xaaaaaaaaaaaaaaaaULL; static const word xcccccccc = 0xccccccccccccccccULL; static const word xc0c0c0c0 = 0xc0c0c0c0c0c0c0c0ULL; static const word xf0f0f0f0 = 0xf0f0f0f0f0f0f0f0ULL; static const word xff00ff00 = 0xff00ff00ff00ff00ULL; static const word xffff0000 = 0xffff0000ffff0000ULL; static const word xffffffff = 0xffffffff00000000ULL; static const word x__left04 = 0xf000000000000000ULL; static const word x__left08 = 0xff00000000000000ULL; static const word x__left16 = 0xffff000000000000ULL; static const word x__left32 = 0xffffffff00000000ULL; ///@endcond #endif //M4RIE_CONVERSION_H m4rie-20200125/m4rie/config.h.in0000644000175000017500000000347413612743553012774 00000000000000/* m4rie/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if OpenMP is enabled */ #undef HAVE_OPENMP /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define whether debugging is enabled */ #undef NDEBUG /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to indicate that m4rie is being built instead of being used */ #ifdef _WIN32 #define M4RIE_BUILDING_M4RIE #endif m4rie-20200125/m4rie/gf2e.c0000644000175000017500000024177513310441753011740 00000000000000#include #include "gf2e.h" gf2e *gf2e_init(const word minpoly) { gf2e *ff = (gf2e*)m4ri_mm_calloc(1, sizeof(gf2e)); for(int i=0; i<=M4RIE_MAX_DEGREE; i++) if(1<degree = i; ff->minpoly = minpoly; const unsigned int order = __M4RI_TWOPOW(ff->degree); /** red **/ ff->red = (word*)m4ri_mm_calloc(order, sizeof(word)); for(unsigned int i=1; idegree; j++) if (__M4RI_TWOPOW(j) & i) tmp ^= minpoly<red[tmp>>ff->degree] == 0); ff->red[tmp>>ff->degree] = tmp; } /** pow_gen: X^i **/ deg_t n = 2*ff->degree-1; ff->pow_gen = (word*)m4ri_mm_malloc( n * sizeof(word)); for(deg_t i=0; ipow_gen[i] = 1<=ff->degree; j--) { if (ff->pow_gen[i] & 1<pow_gen[i] ^= ff->minpoly<<(j - ff->degree); } } if(ff->degree <= 8) { /** mul tables **/ ff->_mul = (word **)m4ri_mm_calloc(order, sizeof(word *)); ff->_mul[0] = (word *)m4ri_mm_calloc(order, sizeof(word)); for(unsigned int i = 1; i_mul[i] = (word *)m4ri_mm_calloc(order, sizeof(word)); for(unsigned int j=1; jdegree); ff->_mul[i][j] = res ^ ff->red[res>>ff->degree]; } } ff->mul = _gf2e_mul_table; } else { ff->mul = _gf2e_mul_arith; } ff->inv = gf2e_inv; return ff; } void gf2e_free(gf2e *ff) { if (ff->_mul) { for(size_t i=0; i<__M4RI_TWOPOW(ff->degree); i++) { m4ri_mm_free(ff->_mul[i]); } m4ri_mm_free(ff->_mul); } m4ri_mm_free(ff->pow_gen); m4ri_mm_free(ff->red); m4ri_mm_free(ff); } const word _irreducible_polynomials_degree_01[ 3] = { 2, 0x00002, 0x00003 }; const word _irreducible_polynomials_degree_02[ 2] = { 1, 0x00007 }; const word _irreducible_polynomials_degree_03[ 3] = { 2, 0x0000b, 0x0000d }; const word _irreducible_polynomials_degree_04[ 4] = { 3, 0x00013, 0x00019, 0x0001f }; const word _irreducible_polynomials_degree_05[ 7] = { 6, 0x00025, 0x00029, 0x0002f, 0x00037, 0x0003b, 0x0003d }; const word _irreducible_polynomials_degree_06[ 10] = { 9, 0x00043, 0x00049, 0x00057, 0x0005b, 0x00061, 0x00067, 0x0006d, 0x00073, 0x00075 }; const word _irreducible_polynomials_degree_07[ 19] = { 18, 0x00083, 0x00089, 0x0008f, 0x00091, 0x0009d, 0x000a7, 0x000ab, 0x000b9, 0x000bf, 0x000c1, 0x000cb, 0x000d3, 0x000d5, 0x000e5, 0x000ef, 0x000f1, 0x000f7, 0x000fd }; const word _irreducible_polynomials_degree_08[ 31] = { 30, 0x0011b, 0x0011d, 0x0012b, 0x0012d, 0x00139, 0x0013f, 0x0014d, 0x0015f, 0x00163, 0x00165, 0x00169, 0x00171, 0x00177, 0x0017b, 0x00187, 0x0018b, 0x0018d, 0x0019f, 0x001a3, 0x001a9, 0x001b1, 0x001bd, 0x001c3, 0x001cf, 0x001d7, 0x001dd, 0x001e7, 0x001f3, 0x001f5, 0x001f9 }; const word _irreducible_polynomials_degree_09[ 57] = { 56, 0x00203, 0x00211, 0x00217, 0x0021b, 0x00221, 0x0022d, 0x00233, 0x0024b, 0x00259, 0x0025f, 0x00265, 0x00269, 0x0026f, 0x00277, 0x0027d, 0x00287, 0x00295, 0x00299, 0x002a3, 0x002a5, 0x002af, 0x002b7, 0x002bd, 0x002cf, 0x002d1, 0x002db, 0x002f5, 0x002f9, 0x00301, 0x00313, 0x00315, 0x0031f, 0x00323, 0x00331, 0x0033b, 0x00349, 0x0034f, 0x0035b, 0x00361, 0x0036b, 0x0036d, 0x00373, 0x0037f, 0x00385, 0x0038f, 0x003a1, 0x003b5, 0x003b9, 0x003c7, 0x003cb, 0x003cd, 0x003d5, 0x003d9, 0x003e3, 0x003e9, 0x003fb }; const word _irreducible_polynomials_degree_10[ 100] = { 99, 0x00409, 0x0040f, 0x0041b, 0x0041d, 0x00427, 0x0042d, 0x00435, 0x00447, 0x00453, 0x00463, 0x00465, 0x0046f, 0x00481, 0x0048b, 0x00499, 0x004a9, 0x004af, 0x004c5, 0x004c9, 0x004d7, 0x004e7, 0x004ed, 0x004f3, 0x004ff, 0x0050b, 0x0050d, 0x00519, 0x0051f, 0x00523, 0x00531, 0x0053d, 0x00543, 0x00557, 0x00561, 0x00567, 0x0056b, 0x00585, 0x0058f, 0x00597, 0x0059b, 0x005a1, 0x005ab, 0x005b9, 0x005c1, 0x005c7, 0x005e5, 0x005f7, 0x005fb, 0x00613, 0x00615, 0x00623, 0x00625, 0x00631, 0x00637, 0x00643, 0x0064f, 0x00651, 0x0065b, 0x00679, 0x0067f, 0x00685, 0x00689, 0x006a7, 0x006ad, 0x006b5, 0x006bf, 0x006c1, 0x006cd, 0x006d3, 0x006df, 0x006f7, 0x006fd, 0x0070f, 0x00711, 0x00717, 0x0071d, 0x00721, 0x0072b, 0x00735, 0x00739, 0x00747, 0x0074d, 0x00755, 0x00759, 0x00763, 0x0077b, 0x0077d, 0x00781, 0x00787, 0x0078d, 0x00793, 0x007a9, 0x007b1, 0x007c5, 0x007db, 0x007eb, 0x007f3, 0x007f9, 0x007ff }; const word _irreducible_polynomials_degree_11[ 187] = { 186, 0x00805, 0x00817, 0x0082b, 0x0082d, 0x00847, 0x00863, 0x00865, 0x00871, 0x0087b, 0x0088d, 0x00895, 0x0089f, 0x008a9, 0x008b1, 0x008c3, 0x008cf, 0x008d1, 0x008e1, 0x008e7, 0x008eb, 0x008f5, 0x0090d, 0x00913, 0x00925, 0x00929, 0x00937, 0x0093b, 0x0093d, 0x00945, 0x00949, 0x00951, 0x0095b, 0x00973, 0x00975, 0x0097f, 0x00983, 0x0098f, 0x009ab, 0x009ad, 0x009b9, 0x009c7, 0x009d9, 0x009e5, 0x009ef, 0x009f7, 0x00a01, 0x00a07, 0x00a13, 0x00a15, 0x00a29, 0x00a49, 0x00a61, 0x00a6d, 0x00a79, 0x00a7f, 0x00a85, 0x00a91, 0x00a9d, 0x00aa7, 0x00aab, 0x00ab3, 0x00ab5, 0x00ad5, 0x00adf, 0x00ae3, 0x00ae9, 0x00aef, 0x00af1, 0x00afb, 0x00b03, 0x00b09, 0x00b11, 0x00b33, 0x00b3f, 0x00b41, 0x00b4b, 0x00b59, 0x00b5f, 0x00b65, 0x00b6f, 0x00b7d, 0x00b87, 0x00b8b, 0x00b93, 0x00b95, 0x00baf, 0x00bb7, 0x00bbd, 0x00bc9, 0x00bdb, 0x00bdd, 0x00be7, 0x00bed, 0x00c0b, 0x00c0d, 0x00c19, 0x00c1f, 0x00c31, 0x00c57, 0x00c61, 0x00c6b, 0x00c73, 0x00c75, 0x00c85, 0x00c89, 0x00c97, 0x00c9b, 0x00c9d, 0x00cb3, 0x00cbf, 0x00cc7, 0x00ccd, 0x00cd3, 0x00cd5, 0x00ce3, 0x00ce9, 0x00cf7, 0x00d03, 0x00d0f, 0x00d1d, 0x00d27, 0x00d2d, 0x00d41, 0x00d47, 0x00d55, 0x00d59, 0x00d63, 0x00d6f, 0x00d71, 0x00d93, 0x00d9f, 0x00da9, 0x00dbb, 0x00dbd, 0x00dc9, 0x00dd7, 0x00ddb, 0x00de1, 0x00de7, 0x00df5, 0x00dff, 0x00e05, 0x00e1d, 0x00e21, 0x00e27, 0x00e2b, 0x00e33, 0x00e39, 0x00e47, 0x00e4b, 0x00e55, 0x00e5f, 0x00e71, 0x00e7b, 0x00e7d, 0x00e81, 0x00e93, 0x00e9f, 0x00ea3, 0x00ebb, 0x00ec9, 0x00ecf, 0x00edd, 0x00ef3, 0x00ef9, 0x00f0b, 0x00f19, 0x00f31, 0x00f37, 0x00f5d, 0x00f6b, 0x00f6d, 0x00f75, 0x00f79, 0x00f83, 0x00f91, 0x00f97, 0x00f9b, 0x00fa7, 0x00fad, 0x00fb5, 0x00fcd, 0x00fd3, 0x00fe5, 0x00fe9, 0x00ffb }; const word _irreducible_polynomials_degree_12[ 336] = { 335, 0x01009, 0x01017, 0x01021, 0x01033, 0x01035, 0x0103f, 0x0104d, 0x01053, 0x01069, 0x01077, 0x0107b, 0x0107d, 0x01081, 0x0108b, 0x01099, 0x010a3, 0x010a5, 0x010cf, 0x010d1, 0x010eb, 0x010ed, 0x010ff, 0x01107, 0x0111f, 0x01123, 0x01131, 0x01137, 0x0113b, 0x0114f, 0x01157, 0x01161, 0x0116b, 0x0116d, 0x01179, 0x01183, 0x01185, 0x01191, 0x011ab, 0x011b3, 0x011d9, 0x011df, 0x011e3, 0x011ef, 0x011f1, 0x01201, 0x0120d, 0x01213, 0x01219, 0x01225, 0x01237, 0x0123b, 0x0123d, 0x01243, 0x01245, 0x01267, 0x0126d, 0x01273, 0x0127f, 0x012b5, 0x012b9, 0x012c1, 0x012cb, 0x01309, 0x0130f, 0x0131b, 0x0131d, 0x01321, 0x01333, 0x01339, 0x0133f, 0x0134d, 0x01365, 0x01371, 0x01399, 0x0139f, 0x013a3, 0x013a9, 0x013af, 0x013bb, 0x013c3, 0x013d1, 0x013d7, 0x013dd, 0x013f3, 0x013f5, 0x01407, 0x01413, 0x01431, 0x01437, 0x01449, 0x0144f, 0x0145b, 0x0145d, 0x01467, 0x0146b, 0x01475, 0x0147f, 0x01489, 0x014a1, 0x014a7, 0x014ad, 0x014b5, 0x014cd, 0x014d3, 0x014d9, 0x014df, 0x014e5, 0x0150f, 0x0151d, 0x0154b, 0x0154d, 0x01581, 0x01593, 0x015a5, 0x015a9, 0x015bb, 0x015c5, 0x015d7, 0x015dd, 0x015eb, 0x015f9, 0x01603, 0x01609, 0x0161b, 0x0163f, 0x01641, 0x01647, 0x0164b, 0x01655, 0x01659, 0x01663, 0x01665, 0x0166f, 0x01693, 0x016a5, 0x016bd, 0x016c3, 0x016c9, 0x016d1, 0x016e1, 0x016e7, 0x016f3, 0x016ff, 0x0170b, 0x01715, 0x01719, 0x0173d, 0x01743, 0x01745, 0x0174f, 0x01757, 0x0175d, 0x01773, 0x01775, 0x01779, 0x01789, 0x0178f, 0x01797, 0x0179d, 0x017ad, 0x017b3, 0x017bf, 0x017c1, 0x017df, 0x017fb, 0x01807, 0x0180d, 0x0181f, 0x01823, 0x01831, 0x01837, 0x01849, 0x01857, 0x0185d, 0x0186d, 0x01879, 0x0187f, 0x01883, 0x01891, 0x01897, 0x018a1, 0x018b9, 0x018cb, 0x018cd, 0x018ef, 0x018f1, 0x018fb, 0x01905, 0x01909, 0x0191b, 0x0192d, 0x01935, 0x01941, 0x0194b, 0x0195f, 0x01965, 0x0196f, 0x0197b, 0x01981, 0x0198b, 0x01999, 0x019b1, 0x019b7, 0x019bd, 0x019c9, 0x019cf, 0x019dd, 0x019e7, 0x019ed, 0x019f9, 0x01a1b, 0x01a1d, 0x01a21, 0x01a2b, 0x01a33, 0x01a4d, 0x01a53, 0x01a55, 0x01a5f, 0x01a63, 0x01a69, 0x01a7b, 0x01a8b, 0x01ab1, 0x01ac5, 0x01ad1, 0x01ae1, 0x01ae7, 0x01aeb, 0x01af5, 0x01b0b, 0x01b0d, 0x01b13, 0x01b19, 0x01b1f, 0x01b2f, 0x01b45, 0x01b57, 0x01b89, 0x01b8f, 0x01b91, 0x01ba7, 0x01bb5, 0x01bb9, 0x01bbf, 0x01bc1, 0x01bcb, 0x01bd3, 0x01be3, 0x01bfd, 0x01c03, 0x01c05, 0x01c0f, 0x01c11, 0x01c17, 0x01c27, 0x01c4d, 0x01c5f, 0x01c87, 0x01c9f, 0x01ca5, 0x01cb7, 0x01cbb, 0x01cc5, 0x01cc9, 0x01ccf, 0x01cd7, 0x01ceb, 0x01ced, 0x01cf3, 0x01d01, 0x01d07, 0x01d23, 0x01d2f, 0x01d3d, 0x01d43, 0x01d51, 0x01d5b, 0x01d5d, 0x01d67, 0x01d75, 0x01d79, 0x01d83, 0x01d85, 0x01d89, 0x01d91, 0x01da7, 0x01db3, 0x01dc1, 0x01def, 0x01e07, 0x01e15, 0x01e19, 0x01e2f, 0x01e3b, 0x01e3d, 0x01e45, 0x01e51, 0x01e5d, 0x01e61, 0x01e67, 0x01e73, 0x01e8f, 0x01e97, 0x01e9b, 0x01eb9, 0x01ebf, 0x01ecd, 0x01ed3, 0x01ee3, 0x01ef1, 0x01ef7, 0x01f03, 0x01f11, 0x01f1b, 0x01f27, 0x01f39, 0x01f47, 0x01f4b, 0x01f53, 0x01f65, 0x01f71, 0x01f7d, 0x01f81, 0x01f8d, 0x01f99, 0x01faf, 0x01fbb, 0x01fbd, 0x01fc3, 0x01fc5, 0x01fc9, 0x01fe1, 0x01fed, 0x01fff }; const word _irreducible_polynomials_degree_13[ 631] = { 630, 0x0201b, 0x02027, 0x02035, 0x02053, 0x02065, 0x0206f, 0x0208b, 0x0208d, 0x0209f, 0x020a5, 0x020af, 0x020bb, 0x020bd, 0x020c3, 0x020c9, 0x020e1, 0x020f3, 0x0210d, 0x02115, 0x02129, 0x0212f, 0x0213b, 0x02143, 0x02167, 0x0216b, 0x02179, 0x02189, 0x02197, 0x0219d, 0x021bf, 0x021c1, 0x021c7, 0x021cd, 0x021df, 0x021e3, 0x021f1, 0x021fb, 0x02219, 0x02225, 0x02237, 0x0223d, 0x02243, 0x0225b, 0x0225d, 0x02279, 0x0227f, 0x02289, 0x02297, 0x0229b, 0x022b3, 0x022bf, 0x022cd, 0x022ef, 0x022f7, 0x022fb, 0x02305, 0x02327, 0x0232b, 0x02347, 0x02355, 0x02359, 0x0236f, 0x02371, 0x0237d, 0x02387, 0x0238d, 0x02395, 0x023a3, 0x023a9, 0x023b1, 0x023b7, 0x023bb, 0x023e1, 0x023ed, 0x023f9, 0x0240b, 0x02413, 0x0241f, 0x02425, 0x02429, 0x0243d, 0x02451, 0x02457, 0x02461, 0x0246d, 0x0247f, 0x02483, 0x0249b, 0x0249d, 0x024b5, 0x024bf, 0x024c1, 0x024c7, 0x024cb, 0x024e3, 0x02509, 0x02517, 0x0251d, 0x02521, 0x0252d, 0x02539, 0x02553, 0x02555, 0x02563, 0x02571, 0x02577, 0x02587, 0x0258b, 0x02595, 0x02599, 0x0259f, 0x025af, 0x025bd, 0x025c5, 0x025cf, 0x025d7, 0x025eb, 0x02603, 0x02605, 0x02611, 0x0262d, 0x0263f, 0x0264b, 0x02653, 0x02659, 0x02669, 0x02677, 0x0267b, 0x02687, 0x02693, 0x02699, 0x026b1, 0x026b7, 0x026bd, 0x026c3, 0x026eb, 0x026f5, 0x02713, 0x02729, 0x0273b, 0x0274f, 0x02757, 0x0275d, 0x0276b, 0x02773, 0x02779, 0x02783, 0x02791, 0x027a1, 0x027b9, 0x027c7, 0x027cb, 0x027df, 0x027ef, 0x027f1, 0x02807, 0x02819, 0x0281f, 0x02823, 0x02831, 0x0283b, 0x0283d, 0x02845, 0x02867, 0x02875, 0x02885, 0x028ab, 0x028ad, 0x028bf, 0x028cd, 0x028d5, 0x028df, 0x028e3, 0x028e9, 0x028fb, 0x02909, 0x0290f, 0x02911, 0x0291b, 0x0292b, 0x02935, 0x0293f, 0x02941, 0x0294b, 0x02955, 0x02977, 0x0297d, 0x02981, 0x02993, 0x0299f, 0x029af, 0x029b7, 0x029bd, 0x029c3, 0x029d7, 0x029f3, 0x029f5, 0x02a03, 0x02a0f, 0x02a1d, 0x02a21, 0x02a33, 0x02a35, 0x02a4d, 0x02a69, 0x02a6f, 0x02a71, 0x02a7b, 0x02a7d, 0x02aa5, 0x02aa9, 0x02ab1, 0x02ac5, 0x02ad7, 0x02adb, 0x02aeb, 0x02af3, 0x02b01, 0x02b15, 0x02b23, 0x02b25, 0x02b2f, 0x02b37, 0x02b43, 0x02b49, 0x02b6d, 0x02b7f, 0x02b85, 0x02b97, 0x02b9b, 0x02bad, 0x02bb3, 0x02bd9, 0x02be5, 0x02bfd, 0x02c0f, 0x02c21, 0x02c2b, 0x02c2d, 0x02c3f, 0x02c41, 0x02c4d, 0x02c71, 0x02c8b, 0x02c8d, 0x02c95, 0x02ca3, 0x02caf, 0x02cbd, 0x02cc5, 0x02cd1, 0x02cd7, 0x02ce1, 0x02ce7, 0x02ceb, 0x02d0d, 0x02d19, 0x02d29, 0x02d2f, 0x02d37, 0x02d3b, 0x02d45, 0x02d5b, 0x02d67, 0x02d75, 0x02d89, 0x02d8f, 0x02da7, 0x02dab, 0x02db5, 0x02de3, 0x02df1, 0x02dfd, 0x02e07, 0x02e13, 0x02e15, 0x02e29, 0x02e49, 0x02e4f, 0x02e5b, 0x02e5d, 0x02e61, 0x02e6b, 0x02e8f, 0x02e91, 0x02e97, 0x02e9d, 0x02eab, 0x02eb3, 0x02eb9, 0x02edf, 0x02efb, 0x02efd, 0x02f05, 0x02f09, 0x02f11, 0x02f17, 0x02f3f, 0x02f41, 0x02f4b, 0x02f4d, 0x02f59, 0x02f5f, 0x02f65, 0x02f69, 0x02f95, 0x02fa5, 0x02faf, 0x02fb1, 0x02fcf, 0x02fdd, 0x02fe7, 0x02fed, 0x02ff5, 0x02fff, 0x03007, 0x03015, 0x03019, 0x0302f, 0x03049, 0x0304f, 0x03067, 0x03079, 0x0307f, 0x03091, 0x030a1, 0x030b5, 0x030bf, 0x030c1, 0x030d3, 0x030d9, 0x030e5, 0x030ef, 0x03105, 0x0310f, 0x03135, 0x03147, 0x0314d, 0x0315f, 0x03163, 0x03171, 0x0317b, 0x031a3, 0x031a9, 0x031b7, 0x031c5, 0x031c9, 0x031db, 0x031e1, 0x031eb, 0x031ed, 0x031f3, 0x031ff, 0x03209, 0x0320f, 0x0321d, 0x03227, 0x03239, 0x0324b, 0x03253, 0x03259, 0x03265, 0x03281, 0x03293, 0x03299, 0x0329f, 0x032a9, 0x032b7, 0x032bb, 0x032c3, 0x032d7, 0x032db, 0x032e7, 0x03307, 0x03315, 0x0332f, 0x03351, 0x0335d, 0x03375, 0x03397, 0x0339b, 0x033ab, 0x033b9, 0x033c1, 0x033c7, 0x033d5, 0x033e3, 0x033e5, 0x033f7, 0x033fb, 0x03409, 0x0341b, 0x03427, 0x03441, 0x0344d, 0x0345f, 0x03469, 0x03477, 0x0347b, 0x03487, 0x03493, 0x03499, 0x034a5, 0x034bd, 0x034c9, 0x034db, 0x034e7, 0x034f9, 0x0350d, 0x0351f, 0x03525, 0x03531, 0x03537, 0x03545, 0x0354f, 0x0355d, 0x0356d, 0x03573, 0x0357f, 0x0359d, 0x035a1, 0x035b9, 0x035cd, 0x035d5, 0x035d9, 0x035e3, 0x035e9, 0x035ef, 0x03601, 0x0360b, 0x0361f, 0x03625, 0x0362f, 0x0363b, 0x03649, 0x03651, 0x0365b, 0x03673, 0x03675, 0x03691, 0x0369b, 0x0369d, 0x036ad, 0x036cb, 0x036d3, 0x036d5, 0x036e3, 0x036ef, 0x03705, 0x0370f, 0x0371b, 0x03721, 0x0372d, 0x03739, 0x03741, 0x03747, 0x03753, 0x03771, 0x03777, 0x0378b, 0x03795, 0x03799, 0x037a3, 0x037c5, 0x037cf, 0x037d1, 0x037d7, 0x037dd, 0x037e1, 0x037f3, 0x03803, 0x03805, 0x03817, 0x0381d, 0x03827, 0x03833, 0x0384b, 0x03859, 0x03869, 0x03871, 0x038a3, 0x038b1, 0x038bb, 0x038c9, 0x038cf, 0x038e1, 0x038f3, 0x038f9, 0x03901, 0x03907, 0x0390b, 0x03913, 0x03931, 0x0394f, 0x03967, 0x0396d, 0x03983, 0x03985, 0x03997, 0x039a1, 0x039a7, 0x039ad, 0x039cb, 0x039cd, 0x039d3, 0x039ef, 0x039f7, 0x039fd, 0x03a07, 0x03a29, 0x03a2f, 0x03a3d, 0x03a51, 0x03a5d, 0x03a61, 0x03a67, 0x03a73, 0x03a75, 0x03a89, 0x03ab9, 0x03abf, 0x03acd, 0x03ad3, 0x03ad5, 0x03adf, 0x03ae5, 0x03ae9, 0x03afb, 0x03b11, 0x03b2b, 0x03b2d, 0x03b35, 0x03b3f, 0x03b53, 0x03b59, 0x03b63, 0x03b65, 0x03b6f, 0x03b71, 0x03b77, 0x03b8b, 0x03b99, 0x03ba5, 0x03ba9, 0x03bb7, 0x03bbb, 0x03bd1, 0x03be7, 0x03bf3, 0x03bff, 0x03c0d, 0x03c13, 0x03c15, 0x03c1f, 0x03c23, 0x03c25, 0x03c3b, 0x03c4f, 0x03c5d, 0x03c6d, 0x03c83, 0x03c8f, 0x03c9d, 0x03ca7, 0x03cab, 0x03cb9, 0x03cc7, 0x03ce9, 0x03cfb, 0x03cfd, 0x03d03, 0x03d17, 0x03d1b, 0x03d21, 0x03d2d, 0x03d33, 0x03d35, 0x03d41, 0x03d4d, 0x03d65, 0x03d69, 0x03d7d, 0x03d81, 0x03d95, 0x03db1, 0x03db7, 0x03dc3, 0x03dd1, 0x03ddb, 0x03de7, 0x03deb, 0x03df9, 0x03e05, 0x03e09, 0x03e0f, 0x03e1b, 0x03e2b, 0x03e3f, 0x03e41, 0x03e53, 0x03e65, 0x03e69, 0x03e8b, 0x03ea3, 0x03ebd, 0x03ec5, 0x03ed7, 0x03edd, 0x03ee1, 0x03ef9, 0x03f0d, 0x03f19, 0x03f1f, 0x03f25, 0x03f37, 0x03f3d, 0x03f43, 0x03f45, 0x03f49, 0x03f51, 0x03f57, 0x03f61, 0x03f83, 0x03f89, 0x03f91, 0x03fab, 0x03fb5, 0x03fe3, 0x03ff7, 0x03ffd }; const word _irreducible_polynomials_degree_14[1162] = { 1161, 0x04021, 0x0402b, 0x04033, 0x04039, 0x0403f, 0x04053, 0x0405f, 0x04065, 0x0407b, 0x04087, 0x040a9, 0x040af, 0x040bb, 0x040bd, 0x040cf, 0x040d7, 0x040eb, 0x040f3, 0x040f9, 0x0410b, 0x0410d, 0x04113, 0x0413b, 0x04143, 0x04149, 0x04157, 0x04167, 0x0416d, 0x04191, 0x0419b, 0x0419d, 0x041a7, 0x041ab, 0x041ad, 0x041b5, 0x041d5, 0x041d9, 0x041f1, 0x04201, 0x0420d, 0x04245, 0x04249, 0x04257, 0x04261, 0x04273, 0x04279, 0x0427f, 0x04283, 0x04285, 0x0429d, 0x042a1, 0x042c7, 0x042cb, 0x042cd, 0x042e3, 0x042e9, 0x042ef, 0x04303, 0x04309, 0x0431b, 0x04321, 0x04327, 0x0433f, 0x04369, 0x0437b, 0x0437d, 0x04387, 0x04395, 0x043af, 0x043c9, 0x043dd, 0x043eb, 0x043ed, 0x043ff, 0x0440b, 0x0440d, 0x04443, 0x0445d, 0x04473, 0x04489, 0x044c1, 0x044d3, 0x044d5, 0x044df, 0x044e3, 0x044f1, 0x044fb, 0x04503, 0x04509, 0x0450f, 0x0452b, 0x04539, 0x04559, 0x0456f, 0x04577, 0x0457d, 0x0458d, 0x04599, 0x0459f, 0x045a5, 0x045b7, 0x045c5, 0x045c9, 0x045d1, 0x045d7, 0x045e7, 0x045f3, 0x045ff, 0x0460f, 0x0461d, 0x04627, 0x04635, 0x04647, 0x04659, 0x04663, 0x04671, 0x0467b, 0x0468d, 0x04693, 0x04695, 0x046a3, 0x046a5, 0x046c5, 0x046cf, 0x046db, 0x046eb, 0x046ff, 0x04725, 0x04731, 0x04743, 0x0474f, 0x0477f, 0x04789, 0x04791, 0x0479b, 0x047a7, 0x047b5, 0x047c1, 0x047d3, 0x047d9, 0x047e5, 0x047e9, 0x047ef, 0x047fd, 0x04813, 0x04819, 0x0481f, 0x0483b, 0x04843, 0x04851, 0x0485b, 0x04861, 0x04867, 0x0487f, 0x04883, 0x04891, 0x048bf, 0x048c7, 0x048e3, 0x048f1, 0x048f7, 0x048fd, 0x0491d, 0x04921, 0x0492d, 0x04939, 0x04941, 0x04953, 0x0495f, 0x04965, 0x04969, 0x04977, 0x04987, 0x0498b, 0x049a9, 0x049cf, 0x049d1, 0x049dd, 0x049e1, 0x049e7, 0x04a17, 0x04a35, 0x04a59, 0x04a65, 0x04a7b, 0x04a81, 0x04a87, 0x04a8b, 0x04a93, 0x04aa3, 0x04aaf, 0x04abd, 0x04ac9, 0x04add, 0x04aed, 0x04af9, 0x04b1f, 0x04b37, 0x04b49, 0x04b5b, 0x04b61, 0x04b6b, 0x04b6d, 0x04b73, 0x04b79, 0x04b85, 0x04b8f, 0x04b97, 0x04ba1, 0x04bab, 0x04bb3, 0x04bb9, 0x04bcb, 0x04bcd, 0x04bd5, 0x04bdf, 0x04bf1, 0x04bfb, 0x04c09, 0x04c1b, 0x04c1d, 0x04c27, 0x04c2b, 0x04c3f, 0x04c47, 0x04c4b, 0x04c53, 0x04c55, 0x04c65, 0x04c7d, 0x04c8d, 0x04ca5, 0x04cbd, 0x04cc5, 0x04cd1, 0x04cd7, 0x04ced, 0x04cff, 0x04d15, 0x04d1f, 0x04d29, 0x04d31, 0x04d45, 0x04d4f, 0x04d51, 0x04d75, 0x04d85, 0x04d8f, 0x04dad, 0x04db3, 0x04dc1, 0x04dd3, 0x04df1, 0x04dfb, 0x04e01, 0x04e15, 0x04e23, 0x04e37, 0x04e43, 0x04e49, 0x04e51, 0x04e6b, 0x04e6d, 0x04e83, 0x04e9b, 0x04eb3, 0x04ed3, 0x04ee5, 0x04ee9, 0x04eef, 0x04f1d, 0x04f21, 0x04f4b, 0x04f55, 0x04f5f, 0x04f69, 0x04f6f, 0x04f81, 0x04f8d, 0x04f9f, 0x04fa5, 0x04fa9, 0x04fb7, 0x04fbb, 0x04fd7, 0x04feb, 0x04fed, 0x04ff9, 0x05007, 0x0501f, 0x05025, 0x0505b, 0x0505d, 0x050a1, 0x050cb, 0x050d5, 0x050d9, 0x050e3, 0x050e9, 0x050ef, 0x050fb, 0x0511b, 0x05121, 0x0512d, 0x0513f, 0x05153, 0x05159, 0x0515f, 0x0516f, 0x0517d, 0x0518b, 0x05199, 0x051a5, 0x051b1, 0x051b7, 0x051cf, 0x051d1, 0x051db, 0x051eb, 0x051ed, 0x051f5, 0x051ff, 0x05205, 0x0520f, 0x0522d, 0x05265, 0x05271, 0x0528b, 0x05299, 0x052a3, 0x052b1, 0x052bd, 0x052c3, 0x052c5, 0x052cf, 0x052d1, 0x052e7, 0x052eb, 0x052f9, 0x05301, 0x05319, 0x05325, 0x05329, 0x05337, 0x05349, 0x0535b, 0x05367, 0x05375, 0x0539b, 0x0539d, 0x053a7, 0x053b9, 0x053bf, 0x053c7, 0x053d3, 0x053e5, 0x053f1, 0x053fd, 0x05403, 0x0540f, 0x05417, 0x05435, 0x05439, 0x05447, 0x05459, 0x0545f, 0x0547b, 0x0548d, 0x05493, 0x05495, 0x0549f, 0x054b1, 0x054b7, 0x054bb, 0x054dd, 0x054e1, 0x054eb, 0x05513, 0x05519, 0x0552f, 0x05537, 0x05567, 0x0556b, 0x05575, 0x05579, 0x0557f, 0x05583, 0x05585, 0x05591, 0x05597, 0x055ad, 0x055c1, 0x055d3, 0x055df, 0x055e9, 0x055f7, 0x05607, 0x0560d, 0x05615, 0x05623, 0x05629, 0x0562f, 0x05631, 0x05657, 0x0565d, 0x0569b, 0x056ab, 0x056ad, 0x056b3, 0x056c1, 0x056c7, 0x056cd, 0x056f1, 0x056f7, 0x056fb, 0x0572b, 0x0572d, 0x0573f, 0x0574b, 0x05755, 0x05759, 0x05763, 0x05765, 0x0577d, 0x05793, 0x057af, 0x057bd, 0x057c3, 0x057c5, 0x057d7, 0x057e7, 0x057f3, 0x05803, 0x05811, 0x05821, 0x0582d, 0x05833, 0x05835, 0x0583f, 0x05841, 0x0587d, 0x05887, 0x0588b, 0x05895, 0x05899, 0x058a3, 0x058af, 0x058b1, 0x058d1, 0x058dd, 0x058e7, 0x058eb, 0x058f9, 0x058ff, 0x05913, 0x05923, 0x0593b, 0x0594f, 0x0597f, 0x0598f, 0x05997, 0x0599d, 0x059a1, 0x059a7, 0x059ab, 0x059b5, 0x059cb, 0x059df, 0x059e9, 0x059fd, 0x05a0d, 0x05a13, 0x05a1f, 0x05a25, 0x05a3b, 0x05a3d, 0x05a43, 0x05a45, 0x05a49, 0x05a75, 0x05a8f, 0x05aa7, 0x05ab5, 0x05ac1, 0x05ad3, 0x05ad5, 0x05ad9, 0x05af7, 0x05b0f, 0x05b17, 0x05b1d, 0x05b2b, 0x05b33, 0x05b39, 0x05b41, 0x05b63, 0x05b69, 0x05b77, 0x05b99, 0x05ba3, 0x05ba9, 0x05bc3, 0x05bc5, 0x05be1, 0x05beb, 0x05bf9, 0x05c07, 0x05c0b, 0x05c19, 0x05c31, 0x05c37, 0x05c49, 0x05c5d, 0x05c6d, 0x05c79, 0x05c83, 0x05ca1, 0x05cbf, 0x05cc1, 0x05ccb, 0x05ccd, 0x05ce5, 0x05d05, 0x05d11, 0x05d1d, 0x05d33, 0x05d35, 0x05d47, 0x05d6f, 0x05d87, 0x05d8d, 0x05d95, 0x05d9f, 0x05da3, 0x05da9, 0x05dbb, 0x05dc9, 0x05dcf, 0x05ddb, 0x05de1, 0x05e03, 0x05e0f, 0x05e1b, 0x05e2d, 0x05e47, 0x05e4b, 0x05e63, 0x05e7d, 0x05e81, 0x05e99, 0x05ea5, 0x05ea9, 0x05ed7, 0x05edb, 0x05ee7, 0x05ef5, 0x05f07, 0x05f0d, 0x05f19, 0x05f1f, 0x05f23, 0x05f3d, 0x05f43, 0x05f45, 0x05f51, 0x05f61, 0x05f6b, 0x05f75, 0x05f89, 0x05f97, 0x05fab, 0x05fcd, 0x05fdf, 0x05fe3, 0x05fe5, 0x05ff1, 0x0600b, 0x0600d, 0x06015, 0x0602f, 0x0603d, 0x0604f, 0x06051, 0x06061, 0x06067, 0x0606b, 0x06089, 0x06097, 0x0609d, 0x060a1, 0x060ab, 0x060b3, 0x060b9, 0x060d3, 0x060d5, 0x060f7, 0x06109, 0x06111, 0x0612d, 0x06139, 0x06141, 0x06153, 0x06171, 0x0617d, 0x0619f, 0x061a5, 0x061af, 0x061bb, 0x061db, 0x061ed, 0x061f5, 0x061ff, 0x0622b, 0x06233, 0x06235, 0x06239, 0x06247, 0x0624d, 0x06263, 0x0626f, 0x0627d, 0x0628d, 0x0629f, 0x062a5, 0x062a9, 0x062b1, 0x062b7, 0x062d7, 0x062db, 0x062dd, 0x062eb, 0x062ed, 0x062f3, 0x062ff, 0x06323, 0x06331, 0x06337, 0x0633d, 0x0635b, 0x0636d, 0x06375, 0x06385, 0x06389, 0x06391, 0x063a1, 0x063bf, 0x063ef, 0x063fd, 0x06409, 0x06417, 0x0642d, 0x06441, 0x06447, 0x0644d, 0x06455, 0x0648b, 0x06495, 0x0649f, 0x064a9, 0x064b1, 0x064e7, 0x064f5, 0x06501, 0x0650b, 0x06519, 0x06537, 0x0653b, 0x06543, 0x06545, 0x06549, 0x0655b, 0x06583, 0x06591, 0x065a7, 0x065ad, 0x065b9, 0x065bf, 0x065d3, 0x065d5, 0x065d9, 0x065e5, 0x065ef, 0x065f1, 0x065f7, 0x06601, 0x06607, 0x0660d, 0x06623, 0x0663b, 0x0664f, 0x0665d, 0x0666b, 0x0666d, 0x06673, 0x06683, 0x0668f, 0x06697, 0x066a7, 0x066ab, 0x066b5, 0x066b9, 0x066d9, 0x066df, 0x066e9, 0x06711, 0x0671b, 0x06721, 0x06733, 0x0674b, 0x0675f, 0x06769, 0x06777, 0x06781, 0x067a3, 0x067af, 0x067b7, 0x067d1, 0x067e7, 0x067eb, 0x067f5, 0x06803, 0x06811, 0x0681b, 0x0681d, 0x0682b, 0x06841, 0x06853, 0x0686f, 0x06877, 0x0688b, 0x0688d, 0x06893, 0x0689f, 0x068a5, 0x068a9, 0x068c5, 0x068c9, 0x068ff, 0x06907, 0x06919, 0x0692f, 0x0693d, 0x06957, 0x0696b, 0x06973, 0x06975, 0x06979, 0x06985, 0x0698f, 0x0699b, 0x0699d, 0x069a1, 0x069ab, 0x069c7, 0x069cd, 0x069e9, 0x06a01, 0x06a07, 0x06a0b, 0x06a19, 0x06a23, 0x06a2f, 0x06a51, 0x06a5b, 0x06a67, 0x06a6b, 0x06a6d, 0x06a75, 0x06a83, 0x06a97, 0x06ab3, 0x06ab5, 0x06abf, 0x06ac1, 0x06acb, 0x06acd, 0x06ae9, 0x06aef, 0x06afb, 0x06afd, 0x06b03, 0x06b17, 0x06b2b, 0x06b33, 0x06b39, 0x06b47, 0x06b4b, 0x06b55, 0x06b69, 0x06b7d, 0x06b81, 0x06b8d, 0x06b95, 0x06b9f, 0x06ba3, 0x06ba5, 0x06bb1, 0x06bb7, 0x06bc5, 0x06bd7, 0x06be1, 0x06bed, 0x06bf3, 0x06bf9, 0x06c0b, 0x06c19, 0x06c2f, 0x06c3d, 0x06c45, 0x06c57, 0x06c61, 0x06c73, 0x06cb5, 0x06cb9, 0x06cbf, 0x06cc1, 0x06cc7, 0x06ccb, 0x06ce5, 0x06cf1, 0x06d05, 0x06d09, 0x06d0f, 0x06d17, 0x06d2b, 0x06d53, 0x06d63, 0x06d65, 0x06d69, 0x06d7b, 0x06da3, 0x06db1, 0x06dbb, 0x06dbd, 0x06dc3, 0x06dc5, 0x06ddd, 0x06e09, 0x06e27, 0x06e2d, 0x06e33, 0x06e41, 0x06e4d, 0x06e53, 0x06e6f, 0x06e7b, 0x06e81, 0x06e87, 0x06e95, 0x06eaf, 0x06eb7, 0x06ec3, 0x06edb, 0x06edd, 0x06ef9, 0x06f01, 0x06f15, 0x06f29, 0x06f31, 0x06f3b, 0x06f4f, 0x06f57, 0x06f5b, 0x06f61, 0x06f85, 0x06f91, 0x06f97, 0x06fab, 0x06fb5, 0x06fc7, 0x06fd9, 0x06fdf, 0x06fe9, 0x07005, 0x0701d, 0x0702b, 0x07033, 0x07035, 0x0704b, 0x0707d, 0x07081, 0x0708d, 0x070a9, 0x070b7, 0x070bb, 0x070c9, 0x070cf, 0x070dd, 0x070e1, 0x07113, 0x07115, 0x07119, 0x07123, 0x07131, 0x07137, 0x0713d, 0x0715d, 0x0716b, 0x07189, 0x07197, 0x0719b, 0x071a1, 0x071b5, 0x071bf, 0x071cb, 0x071df, 0x071e5, 0x071f7, 0x071fb, 0x07219, 0x0721f, 0x0722f, 0x07231, 0x0723b, 0x0724f, 0x07261, 0x07267, 0x0728f, 0x072ad, 0x072b3, 0x072c1, 0x072cd, 0x072d3, 0x072df, 0x072e5, 0x072f1, 0x072f7, 0x07303, 0x07309, 0x07327, 0x0732b, 0x07341, 0x07355, 0x07365, 0x0736f, 0x0738d, 0x07393, 0x073a5, 0x073bd, 0x073c9, 0x073d1, 0x073e7, 0x073f3, 0x073f5, 0x073ff, 0x07413, 0x07415, 0x07429, 0x0744f, 0x07457, 0x0745b, 0x0746b, 0x0746d, 0x07483, 0x074ab, 0x074b3, 0x074c7, 0x074cd, 0x074d5, 0x074df, 0x074e9, 0x074fb, 0x074fd, 0x07517, 0x0751b, 0x07521, 0x07535, 0x07541, 0x0754b, 0x07577, 0x0757b, 0x07581, 0x07599, 0x075a3, 0x075bd, 0x075cf, 0x075d1, 0x075eb, 0x075f5, 0x075f9, 0x075ff, 0x0761d, 0x07639, 0x07647, 0x07653, 0x07655, 0x0765f, 0x07663, 0x07665, 0x07669, 0x07687, 0x07695, 0x0769f, 0x076a3, 0x076af, 0x076bb, 0x076c5, 0x076d1, 0x076eb, 0x076f3, 0x076f9, 0x0770b, 0x0772f, 0x07749, 0x07751, 0x07757, 0x0776d, 0x07773, 0x07783, 0x07789, 0x077a7, 0x077ad, 0x077b5, 0x077c7, 0x077d3, 0x077d5, 0x077ef, 0x07815, 0x07825, 0x07831, 0x0783d, 0x0784f, 0x07851, 0x0785b, 0x0786d, 0x078a7, 0x078ad, 0x078b3, 0x078bf, 0x078cb, 0x078cd, 0x078d9, 0x078df, 0x078e9, 0x078ef, 0x07903, 0x0790f, 0x07917, 0x07927, 0x07933, 0x0794d, 0x07959, 0x0796f, 0x07971, 0x0797b, 0x07981, 0x07987, 0x079a5, 0x079b1, 0x079c5, 0x079c9, 0x079d7, 0x079dd, 0x07a03, 0x07a1b, 0x07a27, 0x07a2b, 0x07a35, 0x07a3f, 0x07a4b, 0x07a55, 0x07a77, 0x07a81, 0x07a8d, 0x07aa9, 0x07ab7, 0x07abb, 0x07ac3, 0x07ae1, 0x07af3, 0x07af5, 0x07b0b, 0x07b23, 0x07b3b, 0x07b45, 0x07b4f, 0x07b51, 0x07b5d, 0x07b67, 0x07b79, 0x07b85, 0x07b8f, 0x07ba1, 0x07bab, 0x07bb9, 0x07bd3, 0x07be3, 0x07bf1, 0x07bf7, 0x07c05, 0x07c09, 0x07c27, 0x07c2d, 0x07c59, 0x07c69, 0x07c7d, 0x07c8b, 0x07c93, 0x07c95, 0x07ca3, 0x07cb7, 0x07cc3, 0x07cd1, 0x07cdd, 0x07ceb, 0x07cf9, 0x07cff, 0x07d01, 0x07d15, 0x07d37, 0x07d45, 0x07d49, 0x07d73, 0x07d79, 0x07d8f, 0x07d91, 0x07d97, 0x07da7, 0x07db3, 0x07dc7, 0x07dcd, 0x07dd5, 0x07de9, 0x07dfb, 0x07dfd, 0x07e01, 0x07e0d, 0x07e19, 0x07e2f, 0x07e45, 0x07e61, 0x07e75, 0x07e7f, 0x07e89, 0x07e8f, 0x07e9b, 0x07e9d, 0x07eab, 0x07ebf, 0x07ec7, 0x07ed3, 0x07ee3, 0x07ee5, 0x07f09, 0x07f21, 0x07f3f, 0x07f4d, 0x07f55, 0x07f71, 0x07f8b, 0x07f8d, 0x07f99, 0x07f9f, 0x07fa3, 0x07fb1, 0x07fc3, 0x07fc5, 0x07fd1, 0x07fd7, 0x07fe1, 0x07fe7 }; const word _irreducible_polynomials_degree_15[2183] = { 2182, 0x08003, 0x08011, 0x08017, 0x0802d, 0x08035, 0x0805f, 0x0806f, 0x08077, 0x08081, 0x08087, 0x08093, 0x080a5, 0x080b1, 0x080bd, 0x080c3, 0x080cf, 0x080dd, 0x080e7, 0x080f5, 0x080ff, 0x08101, 0x08115, 0x08125, 0x08157, 0x0815d, 0x08161, 0x0816d, 0x08179, 0x08185, 0x081a1, 0x081a7, 0x081b9, 0x081cb, 0x081cd, 0x081d5, 0x081df, 0x081fd, 0x08213, 0x0823b, 0x08245, 0x0827f, 0x08289, 0x0828f, 0x0829b, 0x082cb, 0x082d9, 0x082e3, 0x082f1, 0x08317, 0x0831b, 0x0832b, 0x08333, 0x08347, 0x0834d, 0x0835f, 0x08363, 0x08369, 0x08371, 0x0838b, 0x08395, 0x08399, 0x083af, 0x083bb, 0x083bd, 0x083c5, 0x083d1, 0x083f5, 0x08419, 0x08423, 0x0842f, 0x08431, 0x08437, 0x08449, 0x08467, 0x0846d, 0x08479, 0x08483, 0x08485, 0x08497, 0x084a1, 0x084b5, 0x084df, 0x084ef, 0x084f7, 0x084fb, 0x084fd, 0x0851d, 0x08521, 0x08527, 0x08533, 0x08547, 0x0854b, 0x0855f, 0x08571, 0x0857b, 0x08581, 0x0858d, 0x085a3, 0x085b1, 0x085b7, 0x085c5, 0x085c9, 0x085db, 0x085ed, 0x085f3, 0x08609, 0x08611, 0x0861d, 0x0862b, 0x08655, 0x08659, 0x08665, 0x0867d, 0x08681, 0x08693, 0x086a9, 0x086af, 0x086b7, 0x086c3, 0x086db, 0x086f3, 0x086ff, 0x0870b, 0x0870d, 0x08715, 0x0871f, 0x08729, 0x08731, 0x0876b, 0x08785, 0x08789, 0x0878f, 0x0879d, 0x087ab, 0x087ad, 0x087b3, 0x087bf, 0x087df, 0x087e9, 0x087f1, 0x087f7, 0x08801, 0x08807, 0x08825, 0x08837, 0x0883b, 0x08849, 0x0885d, 0x08861, 0x08873, 0x08879, 0x08883, 0x0888f, 0x08891, 0x088b3, 0x088b5, 0x088c7, 0x088d9, 0x08903, 0x08905, 0x08909, 0x08911, 0x08917, 0x08927, 0x08965, 0x0897d, 0x08995, 0x08999, 0x089af, 0x089cf, 0x089d1, 0x089db, 0x089dd, 0x089ed, 0x089ff, 0x08a17, 0x08a39, 0x08a55, 0x08a63, 0x08a65, 0x08a71, 0x08a7b, 0x08a87, 0x08a8b, 0x08a9f, 0x08aaf, 0x08ab1, 0x08add, 0x08b0b, 0x08b0d, 0x08b3b, 0x08b3d, 0x08b43, 0x08b6d, 0x08b73, 0x08b91, 0x08b9d, 0x08bc1, 0x08bcb, 0x08bd5, 0x08bd9, 0x08be5, 0x08bf1, 0x08c21, 0x08c27, 0x08c47, 0x08c55, 0x08c59, 0x08c63, 0x08c69, 0x08c87, 0x08c93, 0x08ca3, 0x08ca9, 0x08cbb, 0x08cc9, 0x08ce1, 0x08ceb, 0x08d01, 0x08d07, 0x08d0b, 0x08d25, 0x08d2f, 0x08d43, 0x08d51, 0x08d5b, 0x08d6d, 0x08d7f, 0x08d85, 0x08d89, 0x08d9b, 0x08da1, 0x08dbf, 0x08dcb, 0x08dcd, 0x08de5, 0x08de9, 0x08def, 0x08df7, 0x08e0b, 0x08e1f, 0x08e3b, 0x08e51, 0x08e57, 0x08e73, 0x08e75, 0x08e8f, 0x08e97, 0x08e9b, 0x08ea1, 0x08ebf, 0x08ec1, 0x08ed3, 0x08edf, 0x08ee5, 0x08efb, 0x08f0f, 0x08f27, 0x08f2b, 0x08f39, 0x08f41, 0x08f53, 0x08f55, 0x08f65, 0x08f77, 0x08f7d, 0x08fa5, 0x08fb7, 0x08fbd, 0x08fc9, 0x08fd1, 0x08fe1, 0x08fe7, 0x0900b, 0x09019, 0x0901f, 0x09025, 0x09037, 0x0903d, 0x09043, 0x09057, 0x09061, 0x0906d, 0x09075, 0x09089, 0x09091, 0x0909b, 0x0909d, 0x090ad, 0x090e3, 0x09105, 0x09109, 0x0910f, 0x09117, 0x0911b, 0x0911d, 0x09141, 0x0914d, 0x09177, 0x0917b, 0x09199, 0x091a3, 0x091a9, 0x091b1, 0x091bd, 0x091cf, 0x091e1, 0x09203, 0x09211, 0x0921b, 0x09221, 0x09227, 0x09233, 0x0923f, 0x0924d, 0x09253, 0x0925f, 0x0927b, 0x09287, 0x09295, 0x092a3, 0x092b7, 0x092c9, 0x092dd, 0x092f5, 0x092f9, 0x09313, 0x09331, 0x09337, 0x09345, 0x09349, 0x09357, 0x09373, 0x0937f, 0x09383, 0x0939d, 0x093a1, 0x093b5, 0x093cb, 0x093df, 0x093ef, 0x093f1, 0x093fb, 0x0940f, 0x0942b, 0x0942d, 0x09435, 0x0944b, 0x09453, 0x09477, 0x0947d, 0x0948b, 0x09493, 0x09499, 0x094a5, 0x094a9, 0x094bb, 0x094c5, 0x094d7, 0x094db, 0x094e1, 0x094e7, 0x094f5, 0x094ff, 0x09507, 0x09515, 0x09529, 0x09531, 0x0953d, 0x09545, 0x09561, 0x0956b, 0x09589, 0x0959b, 0x095ad, 0x095cd, 0x095df, 0x095e3, 0x095e9, 0x09613, 0x09615, 0x0962f, 0x09631, 0x09637, 0x0963d, 0x09643, 0x0965d, 0x09667, 0x09679, 0x09697, 0x096ad, 0x096c1, 0x096cb, 0x096d3, 0x096df, 0x096ef, 0x096fb, 0x09705, 0x0972b, 0x09735, 0x09739, 0x0974d, 0x09763, 0x09795, 0x0979f, 0x097a3, 0x097a5, 0x097a9, 0x097b1, 0x097db, 0x097dd, 0x097e1, 0x097f3, 0x097ff, 0x09809, 0x09821, 0x0982d, 0x09847, 0x09895, 0x09899, 0x098af, 0x098bb, 0x098c3, 0x098c5, 0x098d7, 0x098dd, 0x098e7, 0x098f3, 0x098f9, 0x0990b, 0x09919, 0x09925, 0x09929, 0x0992f, 0x09937, 0x09943, 0x09945, 0x0995b, 0x0996d, 0x0997f, 0x09989, 0x09991, 0x0999b, 0x099b9, 0x099bf, 0x099c1, 0x099cb, 0x099d5, 0x099e3, 0x099e5, 0x09a25, 0x09a31, 0x09a4f, 0x09a57, 0x09a5b, 0x09a5d, 0x09a61, 0x09a6d, 0x09a79, 0x09a7f, 0x09a85, 0x09a97, 0x09a9d, 0x09aab, 0x09ab9, 0x09ac7, 0x09acb, 0x09ae3, 0x09afb, 0x09b11, 0x09b1b, 0x09b2d, 0x09b33, 0x09b41, 0x09b53, 0x09b5f, 0x09b6f, 0x09b77, 0x09b7d, 0x09b87, 0x09b8b, 0x09b93, 0x09bb7, 0x09bbd, 0x09bd1, 0x09beb, 0x09bf9, 0x09bff, 0x09c15, 0x09c1f, 0x09c2f, 0x09c3b, 0x09c3d, 0x09c51, 0x09c5d, 0x09c67, 0x09c73, 0x09c75, 0x09c79, 0x09c85, 0x09cbf, 0x09cc7, 0x09cd5, 0x09ce5, 0x09ce9, 0x09cf1, 0x09cf7, 0x09d03, 0x09d55, 0x09d59, 0x09d63, 0x09d77, 0x09d81, 0x09d8b, 0x09d99, 0x09d9f, 0x09da5, 0x09dbd, 0x09e03, 0x09e11, 0x09e17, 0x09e21, 0x09e27, 0x09e39, 0x09e47, 0x09e55, 0x09e59, 0x09e5f, 0x09e63, 0x09e69, 0x09e81, 0x09e9f, 0x09ea3, 0x09eed, 0x09ef3, 0x09f0b, 0x09f13, 0x09f19, 0x09f23, 0x09f2f, 0x09f49, 0x09f4f, 0x09f67, 0x09f9b, 0x09fad, 0x09fb3, 0x09fb5, 0x09fcd, 0x09fd9, 0x09ff7, 0x0a00b, 0x0a015, 0x0a023, 0x0a025, 0x0a02f, 0x0a043, 0x0a05b, 0x0a05d, 0x0a067, 0x0a06b, 0x0a06d, 0x0a07f, 0x0a089, 0x0a091, 0x0a0a7, 0x0a0b5, 0x0a0cd, 0x0a0df, 0x0a0e9, 0x0a0fb, 0x0a103, 0x0a10f, 0x0a11d, 0x0a121, 0x0a127, 0x0a133, 0x0a135, 0x0a139, 0x0a147, 0x0a159, 0x0a16f, 0x0a17b, 0x0a181, 0x0a19f, 0x0a1b1, 0x0a1c5, 0x0a1cf, 0x0a1e1, 0x0a20f, 0x0a21d, 0x0a22d, 0x0a235, 0x0a241, 0x0a247, 0x0a255, 0x0a263, 0x0a26f, 0x0a299, 0x0a2a9, 0x0a2bb, 0x0a2bd, 0x0a2c5, 0x0a2c9, 0x0a2d7, 0x0a2db, 0x0a2ed, 0x0a307, 0x0a30b, 0x0a30d, 0x0a319, 0x0a31f, 0x0a323, 0x0a329, 0x0a345, 0x0a36b, 0x0a373, 0x0a385, 0x0a38f, 0x0a397, 0x0a3a1, 0x0a3b3, 0x0a3c1, 0x0a3cd, 0x0a3d5, 0x0a403, 0x0a405, 0x0a409, 0x0a411, 0x0a453, 0x0a459, 0x0a465, 0x0a481, 0x0a487, 0x0a48b, 0x0a495, 0x0a499, 0x0a4a5, 0x0a4af, 0x0a4b1, 0x0a4bd, 0x0a4c3, 0x0a4db, 0x0a4eb, 0x0a4ed, 0x0a501, 0x0a523, 0x0a525, 0x0a529, 0x0a54f, 0x0a573, 0x0a583, 0x0a5a7, 0x0a5b9, 0x0a5c7, 0x0a5cd, 0x0a5e9, 0x0a5f1, 0x0a5fb, 0x0a613, 0x0a625, 0x0a62f, 0x0a637, 0x0a63d, 0x0a651, 0x0a661, 0x0a673, 0x0a691, 0x0a69b, 0x0a69d, 0x0a6c7, 0x0a6f1, 0x0a6fd, 0x0a71b, 0x0a72b, 0x0a739, 0x0a75f, 0x0a771, 0x0a78d, 0x0a799, 0x0a7b1, 0x0a7bb, 0x0a7bd, 0x0a7cf, 0x0a7d1, 0x0a7dd, 0x0a7e7, 0x0a805, 0x0a82b, 0x0a833, 0x0a839, 0x0a84b, 0x0a84d, 0x0a855, 0x0a869, 0x0a86f, 0x0a87d, 0x0a881, 0x0a893, 0x0a89f, 0x0a8a3, 0x0a8a9, 0x0a8b7, 0x0a8cf, 0x0a8dd, 0x0a8e1, 0x0a8eb, 0x0a90b, 0x0a913, 0x0a919, 0x0a925, 0x0a949, 0x0a975, 0x0a991, 0x0a9a7, 0x0a9ad, 0x0a9bf, 0x0a9c1, 0x0a9e9, 0x0a9ef, 0x0a9f7, 0x0aa0d, 0x0aa15, 0x0aa2f, 0x0aa31, 0x0aa43, 0x0aa45, 0x0aa4f, 0x0aa51, 0x0aa61, 0x0aa79, 0x0aa9d, 0x0aaab, 0x0aaad, 0x0aab3, 0x0aab9, 0x0aad3, 0x0aadf, 0x0aaf1, 0x0ab03, 0x0ab0f, 0x0ab1d, 0x0ab35, 0x0ab39, 0x0ab47, 0x0ab63, 0x0ab7d, 0x0ab81, 0x0ab8b, 0x0ab99, 0x0abbb, 0x0abc5, 0x0abd1, 0x0abd7, 0x0abdb, 0x0abe7, 0x0abf3, 0x0ac01, 0x0ac07, 0x0ac0d, 0x0ac13, 0x0ac29, 0x0ac37, 0x0ac3b, 0x0ac45, 0x0ac5b, 0x0ac6d, 0x0ac73, 0x0ac7f, 0x0ac85, 0x0ac8f, 0x0ac97, 0x0acc7, 0x0acd5, 0x0acdf, 0x0ace9, 0x0acfd, 0x0ad05, 0x0ad11, 0x0ad1b, 0x0ad21, 0x0ad4b, 0x0ad4d, 0x0ad6f, 0x0ada3, 0x0adaf, 0x0adc9, 0x0addd, 0x0ade7, 0x0adeb, 0x0adf9, 0x0ae09, 0x0ae1d, 0x0ae2d, 0x0ae39, 0x0ae3f, 0x0ae4d, 0x0ae5f, 0x0ae63, 0x0ae71, 0x0ae77, 0x0ae7b, 0x0ae8d, 0x0ae95, 0x0aea3, 0x0aebb, 0x0aed7, 0x0aedd, 0x0aee7, 0x0aef5, 0x0af01, 0x0af13, 0x0af1f, 0x0af29, 0x0af2f, 0x0af3b, 0x0af43, 0x0af49, 0x0af67, 0x0af75, 0x0af8f, 0x0af9d, 0x0afab, 0x0afc1, 0x0afd3, 0x0afe3, 0x0aff7, 0x0affd, 0x0b00f, 0x0b01b, 0x0b02d, 0x0b035, 0x0b03f, 0x0b055, 0x0b077, 0x0b08d, 0x0b093, 0x0b0af, 0x0b0c3, 0x0b0c5, 0x0b0d1, 0x0b0e1, 0x0b0f3, 0x0b107, 0x0b10b, 0x0b10d, 0x0b13d, 0x0b157, 0x0b15d, 0x0b175, 0x0b18f, 0x0b197, 0x0b19d, 0x0b1a1, 0x0b1c7, 0x0b1df, 0x0b1e5, 0x0b20b, 0x0b213, 0x0b215, 0x0b243, 0x0b249, 0x0b24f, 0x0b275, 0x0b27f, 0x0b289, 0x0b29b, 0x0b2b5, 0x0b2c1, 0x0b2df, 0x0b2e9, 0x0b2ef, 0x0b2f7, 0x0b305, 0x0b317, 0x0b327, 0x0b363, 0x0b37b, 0x0b381, 0x0b393, 0x0b3a5, 0x0b3a9, 0x0b3b1, 0x0b3b7, 0x0b3c5, 0x0b3d7, 0x0b3db, 0x0b3dd, 0x0b3f9, 0x0b401, 0x0b40d, 0x0b419, 0x0b41f, 0x0b429, 0x0b443, 0x0b445, 0x0b457, 0x0b46d, 0x0b475, 0x0b47f, 0x0b4a7, 0x0b4bf, 0x0b4d9, 0x0b4ef, 0x0b4f7, 0x0b509, 0x0b51d, 0x0b533, 0x0b53f, 0x0b547, 0x0b553, 0x0b555, 0x0b569, 0x0b577, 0x0b57b, 0x0b595, 0x0b5a9, 0x0b5bb, 0x0b5c3, 0x0b5d7, 0x0b5e1, 0x0b5e7, 0x0b5eb, 0x0b5f9, 0x0b605, 0x0b609, 0x0b617, 0x0b61b, 0x0b621, 0x0b627, 0x0b62d, 0x0b633, 0x0b635, 0x0b64b, 0x0b659, 0x0b67b, 0x0b681, 0x0b68b, 0x0b699, 0x0b6af, 0x0b6b1, 0x0b6d1, 0x0b6e7, 0x0b6eb, 0x0b707, 0x0b71f, 0x0b725, 0x0b745, 0x0b757, 0x0b75b, 0x0b76b, 0x0b779, 0x0b783, 0x0b791, 0x0b797, 0x0b79d, 0x0b7a1, 0x0b7b3, 0x0b7cb, 0x0b7fd, 0x0b81f, 0x0b845, 0x0b84f, 0x0b861, 0x0b875, 0x0b885, 0x0b889, 0x0b89d, 0x0b8a1, 0x0b8ad, 0x0b8bf, 0x0b8d3, 0x0b8d5, 0x0b8fb, 0x0b903, 0x0b909, 0x0b91d, 0x0b927, 0x0b92b, 0x0b947, 0x0b955, 0x0b959, 0x0b965, 0x0b977, 0x0b98d, 0x0b9af, 0x0b9bb, 0x0b9c3, 0x0b9c9, 0x0b9d1, 0x0b9e1, 0x0b9ed, 0x0b9f3, 0x0b9f5, 0x0ba05, 0x0ba0f, 0x0ba11, 0x0ba2b, 0x0ba39, 0x0ba59, 0x0ba69, 0x0ba6f, 0x0ba81, 0x0ba87, 0x0ba8d, 0x0ba93, 0x0bab7, 0x0bad7, 0x0baf3, 0x0baff, 0x0bb01, 0x0bb07, 0x0bb15, 0x0bb19, 0x0bb23, 0x0bb3d, 0x0bb43, 0x0bb49, 0x0bb4f, 0x0bb51, 0x0bb5b, 0x0bb67, 0x0bb75, 0x0bb91, 0x0bbb5, 0x0bbbf, 0x0bbcb, 0x0bbcd, 0x0bbe5, 0x0bbe9, 0x0bc09, 0x0bc33, 0x0bc39, 0x0bc63, 0x0bc65, 0x0bc69, 0x0bc7b, 0x0bc8b, 0x0bc8d, 0x0bc9f, 0x0bca9, 0x0bcc3, 0x0bcd1, 0x0bcdd, 0x0bd01, 0x0bd13, 0x0bd25, 0x0bd2f, 0x0bd37, 0x0bd45, 0x0bd67, 0x0bd7f, 0x0bd83, 0x0bd89, 0x0bdb9, 0x0bdc1, 0x0bdd3, 0x0bdd9, 0x0bde5, 0x0bdf1, 0x0be07, 0x0be15, 0x0be23, 0x0be29, 0x0be37, 0x0be57, 0x0be5b, 0x0be61, 0x0be6b, 0x0be7f, 0x0be83, 0x0be91, 0x0beab, 0x0bed5, 0x0bed9, 0x0bef1, 0x0bf17, 0x0bf21, 0x0bf27, 0x0bf33, 0x0bf35, 0x0bf53, 0x0bf65, 0x0bf81, 0x0bf8b, 0x0bfa3, 0x0bfb7, 0x0bfc3, 0x0bfdb, 0x0bfed, 0x0bff5, 0x0bfff, 0x0c001, 0x0c007, 0x0c013, 0x0c01f, 0x0c025, 0x0c049, 0x0c073, 0x0c079, 0x0c085, 0x0c091, 0x0c097, 0x0c09d, 0x0c0a7, 0x0c0b9, 0x0c0cb, 0x0c0d5, 0x0c0e3, 0x0c0fb, 0x0c111, 0x0c121, 0x0c133, 0x0c13f, 0x0c14b, 0x0c15f, 0x0c16f, 0x0c177, 0x0c17b, 0x0c17d, 0x0c193, 0x0c1a5, 0x0c1bd, 0x0c1c3, 0x0c1c9, 0x0c1db, 0x0c1e7, 0x0c1ed, 0x0c205, 0x0c209, 0x0c217, 0x0c22d, 0x0c24d, 0x0c253, 0x0c255, 0x0c269, 0x0c299, 0x0c2b1, 0x0c2cf, 0x0c2d1, 0x0c2dd, 0x0c2f5, 0x0c301, 0x0c30d, 0x0c319, 0x0c325, 0x0c32f, 0x0c33d, 0x0c357, 0x0c35b, 0x0c361, 0x0c373, 0x0c383, 0x0c39b, 0x0c39d, 0x0c3ab, 0x0c3ad, 0x0c3bf, 0x0c3c7, 0x0c3e3, 0x0c3ef, 0x0c3fd, 0x0c405, 0x0c421, 0x0c433, 0x0c447, 0x0c44b, 0x0c45f, 0x0c46f, 0x0c47d, 0x0c493, 0x0c49f, 0x0c4a5, 0x0c4b7, 0x0c4c5, 0x0c4d7, 0x0c4dd, 0x0c4eb, 0x0c4f9, 0x0c4ff, 0x0c50b, 0x0c515, 0x0c52f, 0x0c531, 0x0c549, 0x0c55b, 0x0c575, 0x0c579, 0x0c589, 0x0c59b, 0x0c5a1, 0x0c5b3, 0x0c5b5, 0x0c5bf, 0x0c5cb, 0x0c5df, 0x0c5e9, 0x0c5ef, 0x0c5fd, 0x0c62f, 0x0c631, 0x0c63d, 0x0c645, 0x0c651, 0x0c66b, 0x0c675, 0x0c679, 0x0c68f, 0x0c697, 0x0c6ab, 0x0c6b3, 0x0c6b9, 0x0c6c1, 0x0c6c7, 0x0c6cd, 0x0c6d5, 0x0c6e3, 0x0c6e9, 0x0c6fb, 0x0c703, 0x0c709, 0x0c741, 0x0c753, 0x0c759, 0x0c763, 0x0c777, 0x0c799, 0x0c79f, 0x0c7a9, 0x0c7c3, 0x0c7d7, 0x0c7db, 0x0c7f5, 0x0c803, 0x0c81b, 0x0c835, 0x0c841, 0x0c84d, 0x0c85f, 0x0c865, 0x0c869, 0x0c895, 0x0c8bd, 0x0c8c9, 0x0c8f5, 0x0c8f9, 0x0c8ff, 0x0c901, 0x0c90d, 0x0c915, 0x0c91f, 0x0c923, 0x0c929, 0x0c931, 0x0c937, 0x0c93b, 0x0c95b, 0x0c95d, 0x0c961, 0x0c97f, 0x0c983, 0x0c98f, 0x0c9ab, 0x0c9c7, 0x0c9cb, 0x0c9cd, 0x0c9d9, 0x0ca25, 0x0ca29, 0x0ca2f, 0x0ca43, 0x0ca49, 0x0ca67, 0x0ca8f, 0x0caad, 0x0cabf, 0x0cad9, 0x0cae3, 0x0caef, 0x0caf1, 0x0cafd, 0x0cb17, 0x0cb1b, 0x0cb1d, 0x0cb2b, 0x0cb3f, 0x0cb55, 0x0cb69, 0x0cb71, 0x0cb7b, 0x0cb87, 0x0cbbd, 0x0cbd7, 0x0cbe7, 0x0cbf5, 0x0cc07, 0x0cc15, 0x0cc23, 0x0cc3d, 0x0cc49, 0x0cc5b, 0x0cc6d, 0x0cc7f, 0x0cc83, 0x0cc85, 0x0cc9b, 0x0cca1, 0x0cca7, 0x0ccad, 0x0ccb3, 0x0ccc1, 0x0ccd9, 0x0ccf7, 0x0ccfb, 0x0ccfd, 0x0cd11, 0x0cd2b, 0x0cd33, 0x0cd55, 0x0cd63, 0x0cd6f, 0x0cd87, 0x0cd9f, 0x0cda3, 0x0cdb7, 0x0cdc5, 0x0cdcf, 0x0cdd7, 0x0cde1, 0x0cdeb, 0x0cded, 0x0cdf9, 0x0cdff, 0x0ce03, 0x0ce11, 0x0ce27, 0x0ce35, 0x0ce39, 0x0ce65, 0x0ce6f, 0x0ce71, 0x0ce9f, 0x0cea5, 0x0cebb, 0x0cec3, 0x0cec5, 0x0cec9, 0x0ced1, 0x0ced7, 0x0cef3, 0x0ceff, 0x0cf0d, 0x0cf19, 0x0cf1f, 0x0cf2f, 0x0cf5d, 0x0cf61, 0x0cf6b, 0x0cf73, 0x0cf79, 0x0cf8f, 0x0cf9b, 0x0cf9d, 0x0cfa1, 0x0cfab, 0x0cfc7, 0x0cfd5, 0x0cfe9, 0x0cff7, 0x0d005, 0x0d009, 0x0d03f, 0x0d047, 0x0d04d, 0x0d071, 0x0d077, 0x0d087, 0x0d08b, 0x0d08d, 0x0d095, 0x0d099, 0x0d0a3, 0x0d0b1, 0x0d0c5, 0x0d0cf, 0x0d0d1, 0x0d0d7, 0x0d0e1, 0x0d0f9, 0x0d10b, 0x0d125, 0x0d129, 0x0d12f, 0x0d13d, 0x0d151, 0x0d15b, 0x0d16d, 0x0d19b, 0x0d1b9, 0x0d1bf, 0x0d1c1, 0x0d1d5, 0x0d1d9, 0x0d1ef, 0x0d1fd, 0x0d207, 0x0d215, 0x0d21f, 0x0d223, 0x0d229, 0x0d237, 0x0d257, 0x0d26b, 0x0d26d, 0x0d283, 0x0d28f, 0x0d2a1, 0x0d2b5, 0x0d2cb, 0x0d303, 0x0d317, 0x0d327, 0x0d341, 0x0d34b, 0x0d359, 0x0d35f, 0x0d369, 0x0d377, 0x0d37b, 0x0d381, 0x0d393, 0x0d399, 0x0d3a3, 0x0d3b1, 0x0d3c9, 0x0d3d1, 0x0d3dd, 0x0d3e7, 0x0d3ed, 0x0d415, 0x0d429, 0x0d43b, 0x0d45d, 0x0d461, 0x0d46b, 0x0d497, 0x0d49d, 0x0d4ab, 0x0d4b3, 0x0d4bf, 0x0d4c1, 0x0d4d3, 0x0d4e5, 0x0d4e9, 0x0d4f1, 0x0d50f, 0x0d51b, 0x0d527, 0x0d52b, 0x0d547, 0x0d555, 0x0d559, 0x0d563, 0x0d57d, 0x0d593, 0x0d5b7, 0x0d5c3, 0x0d5e1, 0x0d5e7, 0x0d5f3, 0x0d5f5, 0x0d605, 0x0d627, 0x0d62b, 0x0d64b, 0x0d65f, 0x0d663, 0x0d66f, 0x0d67d, 0x0d687, 0x0d6a9, 0x0d6b7, 0x0d6c5, 0x0d6d7, 0x0d6e1, 0x0d6ed, 0x0d6f3, 0x0d715, 0x0d723, 0x0d725, 0x0d731, 0x0d767, 0x0d76d, 0x0d77f, 0x0d7ad, 0x0d7b3, 0x0d7b5, 0x0d7bf, 0x0d7d9, 0x0d7f7, 0x0d7fb, 0x0d80d, 0x0d813, 0x0d849, 0x0d857, 0x0d86d, 0x0d889, 0x0d88f, 0x0d89b, 0x0d8a7, 0x0d8ab, 0x0d8b5, 0x0d8c1, 0x0d8c7, 0x0d8d3, 0x0d8d9, 0x0d8e5, 0x0d909, 0x0d91b, 0x0d933, 0x0d941, 0x0d947, 0x0d94d, 0x0d95f, 0x0d965, 0x0d971, 0x0d98b, 0x0d999, 0x0d99f, 0x0d9a3, 0x0d9a9, 0x0d9b1, 0x0d9c3, 0x0d9d7, 0x0d9f3, 0x0d9f9, 0x0da05, 0x0da17, 0x0da27, 0x0da33, 0x0da35, 0x0da3f, 0x0da59, 0x0da7d, 0x0da8b, 0x0da93, 0x0da99, 0x0daa3, 0x0dab1, 0x0dac3, 0x0dadd, 0x0daed, 0x0db07, 0x0db1f, 0x0db25, 0x0db29, 0x0db3b, 0x0db45, 0x0db4f, 0x0db61, 0x0db83, 0x0db91, 0x0dba1, 0x0dbc7, 0x0dbcd, 0x0dbd5, 0x0dbdf, 0x0dbe3, 0x0dbe9, 0x0dbef, 0x0dbfb, 0x0dbfd, 0x0dc11, 0x0dc2b, 0x0dc35, 0x0dc39, 0x0dc41, 0x0dc6f, 0x0dc71, 0x0dc93, 0x0dc9f, 0x0dcaf, 0x0dcd1, 0x0dcd7, 0x0dcdb, 0x0dcf5, 0x0dd19, 0x0dd29, 0x0dd31, 0x0dd45, 0x0dd57, 0x0dd67, 0x0dd73, 0x0dd75, 0x0dd9d, 0x0ddad, 0x0ddc1, 0x0ddd5, 0x0dde5, 0x0ddf7, 0x0ddfb, 0x0de07, 0x0de2f, 0x0de3d, 0x0de49, 0x0de4f, 0x0de51, 0x0de6d, 0x0de75, 0x0de83, 0x0de85, 0x0de89, 0x0dea1, 0x0dead, 0x0decb, 0x0decd, 0x0ded3, 0x0df03, 0x0df05, 0x0df17, 0x0df1d, 0x0df21, 0x0df33, 0x0df59, 0x0df63, 0x0df69, 0x0df6f, 0x0df71, 0x0dfa5, 0x0dfbb, 0x0dfc9, 0x0dfdb, 0x0dfeb, 0x0e003, 0x0e00f, 0x0e011, 0x0e033, 0x0e035, 0x0e047, 0x0e04b, 0x0e05f, 0x0e07b, 0x0e07d, 0x0e08d, 0x0e09f, 0x0e0a9, 0x0e0b1, 0x0e0b7, 0x0e0c5, 0x0e0d7, 0x0e0db, 0x0e0dd, 0x0e0ed, 0x0e0ff, 0x0e101, 0x0e10b, 0x0e125, 0x0e131, 0x0e149, 0x0e14f, 0x0e151, 0x0e15d, 0x0e167, 0x0e16b, 0x0e17f, 0x0e1b3, 0x0e1d3, 0x0e1d9, 0x0e1ef, 0x0e207, 0x0e20b, 0x0e219, 0x0e223, 0x0e231, 0x0e245, 0x0e24f, 0x0e267, 0x0e279, 0x0e285, 0x0e28f, 0x0e29b, 0x0e29d, 0x0e2a1, 0x0e2ab, 0x0e2ad, 0x0e2bf, 0x0e2c1, 0x0e2d5, 0x0e30f, 0x0e311, 0x0e31b, 0x0e335, 0x0e339, 0x0e359, 0x0e363, 0x0e365, 0x0e377, 0x0e38d, 0x0e393, 0x0e39f, 0x0e3a5, 0x0e3af, 0x0e3b7, 0x0e3c3, 0x0e3db, 0x0e3f3, 0x0e3ff, 0x0e41f, 0x0e431, 0x0e449, 0x0e45b, 0x0e46b, 0x0e46d, 0x0e473, 0x0e479, 0x0e485, 0x0e491, 0x0e497, 0x0e49d, 0x0e4a1, 0x0e4ab, 0x0e4cb, 0x0e4cd, 0x0e4df, 0x0e4f1, 0x0e4fd, 0x0e503, 0x0e505, 0x0e517, 0x0e51b, 0x0e52d, 0x0e533, 0x0e581, 0x0e595, 0x0e5a5, 0x0e5af, 0x0e5e7, 0x0e605, 0x0e621, 0x0e639, 0x0e63f, 0x0e647, 0x0e653, 0x0e669, 0x0e687, 0x0e6bb, 0x0e6bd, 0x0e6d7, 0x0e6dd, 0x0e6eb, 0x0e6f5, 0x0e6f9, 0x0e701, 0x0e719, 0x0e729, 0x0e76d, 0x0e775, 0x0e783, 0x0e78f, 0x0e7a7, 0x0e7ab, 0x0e7ad, 0x0e7b5, 0x0e7cb, 0x0e7d3, 0x0e7d5, 0x0e7e5, 0x0e7f1, 0x0e7f7, 0x0e801, 0x0e82f, 0x0e843, 0x0e84f, 0x0e851, 0x0e85b, 0x0e86d, 0x0e879, 0x0e889, 0x0e891, 0x0e8a7, 0x0e8bf, 0x0e8c1, 0x0e8cb, 0x0e8cd, 0x0e8d3, 0x0e8fb, 0x0e8fd, 0x0e903, 0x0e90f, 0x0e921, 0x0e927, 0x0e92b, 0x0e935, 0x0e959, 0x0e95f, 0x0e963, 0x0e969, 0x0e971, 0x0e98d, 0x0e9b7, 0x0e9c5, 0x0e9cf, 0x0e9d7, 0x0e9ed, 0x0ea09, 0x0ea1b, 0x0ea2d, 0x0ea4b, 0x0ea59, 0x0ea71, 0x0ea7d, 0x0ea81, 0x0ea8d, 0x0eabb, 0x0eac3, 0x0eac9, 0x0ead7, 0x0eaed, 0x0eaff, 0x0eb07, 0x0eb0b, 0x0eb19, 0x0eb23, 0x0eb29, 0x0eb3b, 0x0eb45, 0x0eb57, 0x0eb5d, 0x0eb67, 0x0eb6b, 0x0eb73, 0x0eb75, 0x0eb97, 0x0eb9b, 0x0ebad, 0x0ebb3, 0x0ebcd, 0x0ebd3, 0x0ebd5, 0x0ebe3, 0x0ec09, 0x0ec11, 0x0ec21, 0x0ec35, 0x0ec4b, 0x0ec5f, 0x0ec65, 0x0ec69, 0x0ec7d, 0x0ec93, 0x0ec99, 0x0ecaf, 0x0ecb7, 0x0ecbd, 0x0ecc9, 0x0eccf, 0x0ecff, 0x0ed07, 0x0ed15, 0x0ed23, 0x0ed37, 0x0ed49, 0x0ed5d, 0x0ed61, 0x0ed6b, 0x0ed97, 0x0eda1, 0x0edab, 0x0edb3, 0x0edc7, 0x0edcd, 0x0edd9, 0x0eddf, 0x0edef, 0x0edf1, 0x0edfd, 0x0ee01, 0x0ee0b, 0x0ee0d, 0x0ee1f, 0x0ee29, 0x0ee75, 0x0ee83, 0x0ee89, 0x0ee9d, 0x0eead, 0x0eeb9, 0x0eec7, 0x0eecb, 0x0eed9, 0x0eee3, 0x0eef1, 0x0eef7, 0x0ef0f, 0x0ef21, 0x0ef2d, 0x0ef33, 0x0ef39, 0x0ef4d, 0x0ef77, 0x0ef95, 0x0ef9f, 0x0efb1, 0x0efbb, 0x0efe1, 0x0efe7, 0x0efeb, 0x0eff3, 0x0eff5, 0x0eff9, 0x0f007, 0x0f00d, 0x0f01f, 0x0f029, 0x0f02f, 0x0f045, 0x0f05d, 0x0f085, 0x0f089, 0x0f097, 0x0f0ab, 0x0f0bf, 0x0f0c7, 0x0f0d5, 0x0f0df, 0x0f0f1, 0x0f0f7, 0x0f111, 0x0f11b, 0x0f135, 0x0f141, 0x0f147, 0x0f14b, 0x0f153, 0x0f163, 0x0f171, 0x0f18d, 0x0f193, 0x0f1c5, 0x0f1e1, 0x0f1e7, 0x0f1f3, 0x0f1f5, 0x0f1ff, 0x0f217, 0x0f21d, 0x0f247, 0x0f24d, 0x0f255, 0x0f259, 0x0f26f, 0x0f27b, 0x0f287, 0x0f29f, 0x0f2a5, 0x0f2db, 0x0f2dd, 0x0f2f9, 0x0f2ff, 0x0f301, 0x0f30b, 0x0f315, 0x0f32f, 0x0f337, 0x0f343, 0x0f385, 0x0f389, 0x0f391, 0x0f397, 0x0f3b3, 0x0f3df, 0x0f3e5, 0x0f405, 0x0f40f, 0x0f417, 0x0f421, 0x0f439, 0x0f453, 0x0f455, 0x0f463, 0x0f465, 0x0f469, 0x0f47b, 0x0f48b, 0x0f499, 0x0f4a3, 0x0f4b1, 0x0f4bd, 0x0f4c3, 0x0f4cf, 0x0f4f3, 0x0f4f5, 0x0f4f9, 0x0f50d, 0x0f519, 0x0f525, 0x0f537, 0x0f53b, 0x0f551, 0x0f561, 0x0f56d, 0x0f591, 0x0f59d, 0x0f5a7, 0x0f5b5, 0x0f5bf, 0x0f5c1, 0x0f5c7, 0x0f601, 0x0f615, 0x0f61f, 0x0f623, 0x0f63b, 0x0f645, 0x0f64f, 0x0f65d, 0x0f66b, 0x0f673, 0x0f683, 0x0f685, 0x0f6b3, 0x0f6b5, 0x0f6d9, 0x0f6ef, 0x0f6fb, 0x0f721, 0x0f72d, 0x0f73f, 0x0f74d, 0x0f753, 0x0f769, 0x0f76f, 0x0f787, 0x0f78b, 0x0f795, 0x0f7a3, 0x0f7b1, 0x0f7b7, 0x0f7c3, 0x0f7c9, 0x0f7db, 0x0f7ff, 0x0f803, 0x0f809, 0x0f80f, 0x0f81d, 0x0f827, 0x0f82d, 0x0f839, 0x0f83f, 0x0f84b, 0x0f86f, 0x0f871, 0x0f877, 0x0f893, 0x0f8c5, 0x0f8db, 0x0f8e1, 0x0f8ed, 0x0f8f3, 0x0f8f5, 0x0f907, 0x0f915, 0x0f923, 0x0f93b, 0x0f93d, 0x0f94f, 0x0f951, 0x0f973, 0x0f979, 0x0f985, 0x0f99b, 0x0f9b3, 0x0f9b9, 0x0f9c7, 0x0f9e3, 0x0f9e9, 0x0f9f7, 0x0fa01, 0x0fa07, 0x0fa13, 0x0fa23, 0x0fa37, 0x0fa49, 0x0fa6b, 0x0fa75, 0x0fa79, 0x0fa7f, 0x0fa83, 0x0fa97, 0x0fa9b, 0x0faa1, 0x0fac1, 0x0facb, 0x0fad9, 0x0fadf, 0x0fae5, 0x0fb05, 0x0fb0f, 0x0fb21, 0x0fb27, 0x0fb35, 0x0fb4d, 0x0fb55, 0x0fb5f, 0x0fb69, 0x0fb71, 0x0fb81, 0x0fb8d, 0x0fba3, 0x0fba9, 0x0fbb7, 0x0fbc9, 0x0fbcf, 0x0fbdb, 0x0fbe1, 0x0fc0b, 0x0fc0d, 0x0fc1f, 0x0fc49, 0x0fc5b, 0x0fc67, 0x0fc75, 0x0fc83, 0x0fcad, 0x0fcd3, 0x0fcef, 0x0fd0f, 0x0fd17, 0x0fd1d, 0x0fd2b, 0x0fd2d, 0x0fd39, 0x0fd47, 0x0fd53, 0x0fd71, 0x0fd8b, 0x0fd95, 0x0fd99, 0x0fda3, 0x0fdaf, 0x0fdb1, 0x0fdc3, 0x0fddd, 0x0fde1, 0x0fdeb, 0x0fe05, 0x0fe2d, 0x0fe33, 0x0fe35, 0x0fe41, 0x0fe4d, 0x0fe59, 0x0fe5f, 0x0fe7d, 0x0fe87, 0x0fe93, 0x0fe99, 0x0feb1, 0x0febd, 0x0fec9, 0x0feeb, 0x0feff, 0x0ff01, 0x0ff07, 0x0ff13, 0x0ff23, 0x0ff29, 0x0ff37, 0x0ff4f, 0x0ff57, 0x0ff5d, 0x0ff61, 0x0ff73, 0x0ff7f, 0x0ff8f, 0x0ff91, 0x0ffb3, 0x0ffc7, 0x0ffd9, 0x0ffe9, 0x0ffef, 0x0fffd }; const word _irreducible_polynomials_degree_16[4081] = { 4080, 0x1002b, 0x1002d, 0x10039, 0x1003f, 0x10047, 0x10053, 0x1008d, 0x100bd, 0x100d7, 0x100f5, 0x10129, 0x1012f, 0x1013b, 0x1013d, 0x1014f, 0x1015d, 0x10173, 0x10175, 0x1018f, 0x10197, 0x101a1, 0x101ad, 0x101bf, 0x101c7, 0x101cd, 0x101d5, 0x101e9, 0x101f7, 0x10215, 0x10219, 0x10225, 0x1022f, 0x1025b, 0x1025d, 0x1026b, 0x1026d, 0x10275, 0x10285, 0x10291, 0x102a1, 0x102b3, 0x102cd, 0x102d3, 0x102e5, 0x102f7, 0x102fb, 0x10317, 0x1031d, 0x10335, 0x10339, 0x1034b, 0x1034d, 0x10369, 0x1036f, 0x10371, 0x10387, 0x1038d, 0x1039f, 0x103a3, 0x103bb, 0x103cf, 0x103dd, 0x103ed, 0x103f9, 0x1040b, 0x10425, 0x10429, 0x10457, 0x10461, 0x10467, 0x1046d, 0x10483, 0x10489, 0x10491, 0x104a7, 0x104ad, 0x104b5, 0x104bf, 0x104c1, 0x104fd, 0x10509, 0x10533, 0x10539, 0x10547, 0x10563, 0x10565, 0x10569, 0x10587, 0x105af, 0x105c3, 0x105cf, 0x105d1, 0x105dd, 0x105eb, 0x105f5, 0x105f9, 0x10641, 0x1064b, 0x10653, 0x1065f, 0x1067b, 0x1067d, 0x10687, 0x1068b, 0x106a3, 0x106af, 0x106c3, 0x106c9, 0x106f5, 0x106ff, 0x1076b, 0x1076d, 0x10779, 0x1077f, 0x10783, 0x1078f, 0x10797, 0x107ef, 0x107f1, 0x107fb, 0x10807, 0x1080b, 0x1080d, 0x10815, 0x1083b, 0x10861, 0x10879, 0x10897, 0x1089d, 0x108ab, 0x108bf, 0x108d5, 0x108df, 0x108e3, 0x108e9, 0x108f1, 0x108fb, 0x10939, 0x10959, 0x10977, 0x1097d, 0x1098b, 0x109a5, 0x109af, 0x109c3, 0x109c5, 0x109e1, 0x109e7, 0x109ed, 0x109f3, 0x10a03, 0x10a11, 0x10a35, 0x10a39, 0x10a5f, 0x10a63, 0x10a71, 0x10a7d, 0x10a81, 0x10a9f, 0x10abb, 0x10ac5, 0x10acf, 0x10add, 0x10ae1, 0x10aff, 0x10b01, 0x10b13, 0x10b15, 0x10b51, 0x10b5d, 0x10b91, 0x10b97, 0x10bb3, 0x10bcd, 0x10bd3, 0x10be5, 0x10bef, 0x10bf7, 0x10bfd, 0x10c0f, 0x10c1d, 0x10c21, 0x10c2b, 0x10c41, 0x10c69, 0x10c71, 0x10c7b, 0x10c8d, 0x10c95, 0x10ca3, 0x10caf, 0x10cbd, 0x10cdd, 0x10ceb, 0x10cf3, 0x10d0d, 0x10d19, 0x10d1f, 0x10d43, 0x10d49, 0x10d83, 0x10d8f, 0x10d91, 0x10d9d, 0x10dad, 0x10db5, 0x10dd3, 0x10de3, 0x10de5, 0x10e23, 0x10e45, 0x10e73, 0x10e7f, 0x10e85, 0x10e91, 0x10e97, 0x10e9d, 0x10ea1, 0x10ea7, 0x10ec7, 0x10ecb, 0x10efd, 0x10f03, 0x10f05, 0x10f09, 0x10f1b, 0x10f21, 0x10f69, 0x10f77, 0x10f87, 0x10f8b, 0x10f95, 0x10f99, 0x10fb1, 0x10fbd, 0x10fcf, 0x10fdb, 0x10fe7, 0x10feb, 0x1100b, 0x11025, 0x1103d, 0x11043, 0x1104f, 0x1105d, 0x1107f, 0x11083, 0x11085, 0x11097, 0x1109b, 0x110a1, 0x110a7, 0x110b5, 0x1111d, 0x11127, 0x11139, 0x11147, 0x1114d, 0x1115f, 0x1116f, 0x111c9, 0x111db, 0x111dd, 0x111eb, 0x111ed, 0x111f3, 0x111f9, 0x11241, 0x11247, 0x11253, 0x11255, 0x11263, 0x11277, 0x11281, 0x1128b, 0x11293, 0x11299, 0x112a5, 0x112af, 0x112bd, 0x112c5, 0x112d7, 0x112db, 0x112e1, 0x112ed, 0x112f3, 0x112ff, 0x1133b, 0x1133d, 0x11351, 0x11357, 0x11361, 0x1136b, 0x11375, 0x11379, 0x1139d, 0x113a1, 0x113df, 0x113f7, 0x11409, 0x1141b, 0x11433, 0x11435, 0x1144b, 0x1144d, 0x11459, 0x1145f, 0x11487, 0x11493, 0x114af, 0x114b1, 0x114c9, 0x114d1, 0x114ed, 0x114f9, 0x11507, 0x11513, 0x1158f, 0x11591, 0x115a1, 0x115a7, 0x115ab, 0x115d5, 0x115d9, 0x115df, 0x115e3, 0x115fb, 0x1161f, 0x1162f, 0x11637, 0x1163d, 0x11643, 0x11645, 0x11649, 0x11651, 0x11675, 0x11683, 0x1169b, 0x116ab, 0x116d5, 0x116d9, 0x116f7, 0x116fd, 0x1170f, 0x1172d, 0x11733, 0x1173f, 0x11741, 0x11747, 0x1174d, 0x11753, 0x11765, 0x11795, 0x11799, 0x117a3, 0x117a9, 0x117d7, 0x117eb, 0x117f5, 0x1182b, 0x11833, 0x11855, 0x11863, 0x1186f, 0x11887, 0x1188d, 0x11893, 0x118a9, 0x118b1, 0x118b7, 0x118bb, 0x118cf, 0x118db, 0x118f9, 0x118ff, 0x1190b, 0x11923, 0x11925, 0x11931, 0x11937, 0x1195b, 0x1196b, 0x1196d, 0x11975, 0x11979, 0x119b3, 0x119cb, 0x119cd, 0x119e5, 0x119fb, 0x119fd, 0x11a07, 0x11a0d, 0x11a23, 0x11a31, 0x11a43, 0x11a51, 0x11a57, 0x11a5d, 0x11a6b, 0x11a73, 0x11a79, 0x11a89, 0x11a9b, 0x11abf, 0x11ae3, 0x11ae5, 0x11b09, 0x11b1d, 0x11b27, 0x11b2b, 0x11b47, 0x11b4b, 0x11b55, 0x11b59, 0x11b65, 0x11b7d, 0x11b8b, 0x11b8d, 0x11b93, 0x11baf, 0x11bbb, 0x11bbd, 0x11bc3, 0x11bd7, 0x11be1, 0x11bff, 0x11c07, 0x11c13, 0x11c23, 0x11c29, 0x11c45, 0x11c4f, 0x11c57, 0x11c5d, 0x11c61, 0x11c7f, 0x11c85, 0x11c9d, 0x11ca1, 0x11cb5, 0x11ccb, 0x11ccd, 0x11cd9, 0x11ce9, 0x11cef, 0x11cf1, 0x11d17, 0x11d1b, 0x11d2d, 0x11d3f, 0x11d4b, 0x11d53, 0x11d59, 0x11d5f, 0x11d65, 0x11d69, 0x11d77, 0x11d81, 0x11d87, 0x11dc9, 0x11ded, 0x11dff, 0x11e21, 0x11e3f, 0x11e5f, 0x11e71, 0x11e7b, 0x11e99, 0x11e9f, 0x11ea9, 0x11ebd, 0x11ec3, 0x11ec5, 0x11ecf, 0x11edd, 0x11ee7, 0x11eeb, 0x11ef3, 0x11f13, 0x11f29, 0x11f2f, 0x11f3b, 0x11f3d, 0x11f57, 0x11f67, 0x11f6d, 0x11f73, 0x11f75, 0x11f83, 0x11f9b, 0x11f9d, 0x11fb9, 0x11fbf, 0x11fc1, 0x1200d, 0x1201f, 0x12025, 0x1203d, 0x12051, 0x12073, 0x1208f, 0x1209b, 0x120ab, 0x120b5, 0x120b9, 0x120c7, 0x120e3, 0x12105, 0x12109, 0x1211b, 0x12141, 0x12153, 0x12163, 0x12169, 0x1217b, 0x12187, 0x12195, 0x121a9, 0x121b1, 0x121c5, 0x121cf, 0x121e1, 0x121e7, 0x121f9, 0x12217, 0x12227, 0x12235, 0x12241, 0x12253, 0x12259, 0x1225f, 0x12269, 0x1227b, 0x1228b, 0x12293, 0x12295, 0x122a5, 0x122af, 0x122b1, 0x122cf, 0x122dd, 0x122e7, 0x122f9, 0x12315, 0x1231f, 0x12325, 0x12329, 0x12345, 0x12357, 0x1236d, 0x12383, 0x12397, 0x123a7, 0x123b9, 0x123e3, 0x123e9, 0x12403, 0x1240f, 0x1242d, 0x12439, 0x1243f, 0x1244b, 0x12453, 0x1248d, 0x12499, 0x1249f, 0x124b7, 0x124c5, 0x124d1, 0x124e7, 0x124ff, 0x12515, 0x12523, 0x12529, 0x1253b, 0x12557, 0x1255d, 0x12561, 0x12573, 0x12579, 0x12585, 0x1259b, 0x125bf, 0x125cd, 0x125e5, 0x125f7, 0x12607, 0x12615, 0x12623, 0x1263d, 0x12651, 0x1265b, 0x1266d, 0x12675, 0x1267f, 0x12683, 0x1269b, 0x126ad, 0x126c1, 0x126e9, 0x126fb, 0x12711, 0x1272b, 0x12733, 0x12739, 0x12759, 0x12763, 0x12771, 0x12787, 0x127a5, 0x127c5, 0x127d7, 0x127ed, 0x127f3, 0x1281b, 0x1281d, 0x1282d, 0x12841, 0x12847, 0x12871, 0x1287b, 0x1289f, 0x128a3, 0x128a9, 0x128af, 0x128c5, 0x128f5, 0x12901, 0x1290b, 0x12919, 0x1292f, 0x1293b, 0x12943, 0x12945, 0x12949, 0x12973, 0x1297f, 0x12983, 0x12989, 0x1299d, 0x129ad, 0x129b9, 0x129c7, 0x129d5, 0x129f1, 0x129f7, 0x12a25, 0x12a29, 0x12a31, 0x12a3b, 0x12a7f, 0x12a85, 0x12a9d, 0x12aa7, 0x12acd, 0x12ad5, 0x12ad9, 0x12ae3, 0x12ae9, 0x12af1, 0x12b05, 0x12b09, 0x12b27, 0x12b33, 0x12b35, 0x12b53, 0x12b69, 0x12b6f, 0x12b7b, 0x12b7d, 0x12b93, 0x12b99, 0x12baf, 0x12bbd, 0x12bd1, 0x12bdb, 0x12bdd, 0x12bf9, 0x12c07, 0x12c0b, 0x12c1f, 0x12c3b, 0x12c3d, 0x12c43, 0x12c4f, 0x12c5d, 0x12c61, 0x12c6b, 0x12c73, 0x12c79, 0x12c89, 0x12cad, 0x12cb9, 0x12ccd, 0x12cd3, 0x12ce3, 0x12cf7, 0x12cfb, 0x12d09, 0x12d27, 0x12d2d, 0x12d35, 0x12d41, 0x12d63, 0x12d65, 0x12d71, 0x12d77, 0x12d81, 0x12d8b, 0x12d8d, 0x12d9f, 0x12da9, 0x12ddb, 0x12de1, 0x12e0f, 0x12e17, 0x12e21, 0x12e33, 0x12e35, 0x12e47, 0x12e4b, 0x12e4d, 0x12e5f, 0x12e6f, 0x12e71, 0x12e8d, 0x12ea5, 0x12ea9, 0x12ec5, 0x12ec9, 0x12eeb, 0x12ef9, 0x12eff, 0x12f01, 0x12f07, 0x12f13, 0x12f3d, 0x12f43, 0x12f5b, 0x12f67, 0x12f7f, 0x12f89, 0x12f97, 0x12f9b, 0x12fa7, 0x12fb5, 0x12fbf, 0x12fcb, 0x12fd3, 0x12fdf, 0x13005, 0x13017, 0x13027, 0x1304b, 0x13059, 0x13065, 0x13077, 0x1307b, 0x1307d, 0x13081, 0x13093, 0x130af, 0x130b7, 0x130c3, 0x130db, 0x130dd, 0x130ed, 0x130f5, 0x130f9, 0x13107, 0x1310d, 0x13125, 0x13129, 0x1315d, 0x13161, 0x13173, 0x131a7, 0x131ab, 0x131cd, 0x131d9, 0x131e3, 0x131fb, 0x1322f, 0x13237, 0x1323d, 0x13249, 0x13257, 0x1325b, 0x13267, 0x13275, 0x13291, 0x1329d, 0x132ab, 0x132ad, 0x132b5, 0x132cb, 0x132d9, 0x132ef, 0x132f1, 0x13305, 0x1331b, 0x1332b, 0x13339, 0x13347, 0x13377, 0x1339f, 0x133a9, 0x133c5, 0x133d1, 0x133e1, 0x133eb, 0x133f3, 0x1340b, 0x13415, 0x13419, 0x13425, 0x13443, 0x13451, 0x1347f, 0x13489, 0x1349b, 0x134a7, 0x134bf, 0x134cd, 0x134fd, 0x13505, 0x1351d, 0x13521, 0x13533, 0x13547, 0x1354b, 0x13559, 0x13571, 0x1357d, 0x1359f, 0x135a3, 0x135b1, 0x135c9, 0x135d7, 0x135f3, 0x1360f, 0x1361b, 0x1361d, 0x13635, 0x1363f, 0x1366f, 0x13671, 0x1368d, 0x13699, 0x136a9, 0x136b7, 0x136c3, 0x136d1, 0x136d7, 0x136ed, 0x13707, 0x1370b, 0x13719, 0x13723, 0x13743, 0x1374f, 0x13751, 0x13775, 0x13779, 0x13797, 0x137ab, 0x137b9, 0x137cd, 0x137d5, 0x137e3, 0x13801, 0x1380d, 0x1381f, 0x13837, 0x13849, 0x1384f, 0x1385b, 0x1385d, 0x1386d, 0x1388f, 0x138a1, 0x138c7, 0x138cb, 0x138cd, 0x138df, 0x138fb, 0x13911, 0x13917, 0x13921, 0x13935, 0x1393f, 0x13941, 0x1394d, 0x13953, 0x1395f, 0x13965, 0x1396f, 0x13977, 0x13981, 0x13999, 0x139a3, 0x139b7, 0x139bd, 0x139c9, 0x139eb, 0x139ff, 0x13a09, 0x13a1b, 0x13a1d, 0x13a2d, 0x13a33, 0x13a4d, 0x13a55, 0x13a63, 0x13a65, 0x13a69, 0x13a77, 0x13a95, 0x13a9f, 0x13aaf, 0x13abb, 0x13abd, 0x13acf, 0x13af3, 0x13af9, 0x13b13, 0x13b29, 0x13b3b, 0x13b3d, 0x13b45, 0x13b5b, 0x13b6d, 0x13b73, 0x13b83, 0x13b89, 0x13b9d, 0x13bcb, 0x13bd3, 0x13bd9, 0x13be3, 0x13bef, 0x13bf1, 0x13c05, 0x13c21, 0x13c27, 0x13c47, 0x13c4b, 0x13c69, 0x13c6f, 0x13c93, 0x13cb1, 0x13cdb, 0x13cf3, 0x13cf9, 0x13cff, 0x13d07, 0x13d13, 0x13d23, 0x13d31, 0x13d3d, 0x13d43, 0x13d49, 0x13d67, 0x13d6b, 0x13d6d, 0x13d83, 0x13d91, 0x13db3, 0x13db5, 0x13dc1, 0x13dcd, 0x13dd9, 0x13def, 0x13dfb, 0x13e0b, 0x13e19, 0x13e1f, 0x13e31, 0x13e3b, 0x13e43, 0x13e45, 0x13e51, 0x13e57, 0x13e79, 0x13e85, 0x13e89, 0x13e8f, 0x13eb9, 0x13ed3, 0x13edf, 0x13ee9, 0x13efb, 0x13f03, 0x13f09, 0x13f11, 0x13f1d, 0x13f41, 0x13f81, 0x13f8b, 0x13f9f, 0x13fa5, 0x13fa9, 0x13fb7, 0x13fc5, 0x13fdb, 0x13ff5, 0x14019, 0x14075, 0x14079, 0x14085, 0x1409b, 0x1409d, 0x140ad, 0x140cd, 0x140d3, 0x140e3, 0x140f7, 0x14103, 0x14109, 0x1413f, 0x1414b, 0x14153, 0x14159, 0x14163, 0x14193, 0x14199, 0x141a9, 0x141af, 0x141bb, 0x141bd, 0x141e1, 0x141e7, 0x141f3, 0x141ff, 0x14203, 0x14205, 0x14211, 0x1424b, 0x14255, 0x14271, 0x1427b, 0x1427d, 0x14281, 0x14287, 0x142a5, 0x142a9, 0x142b7, 0x142bb, 0x142cf, 0x142e1, 0x142ed, 0x142f9, 0x14307, 0x1430b, 0x14323, 0x14343, 0x14349, 0x1437f, 0x14383, 0x143a7, 0x143bf, 0x143ef, 0x143f7, 0x143fb, 0x1440f, 0x14447, 0x1444d, 0x14471, 0x14477, 0x1447b, 0x1448d, 0x14495, 0x1449f, 0x144a3, 0x144bb, 0x144c5, 0x144d1, 0x144e1, 0x144f9, 0x1450b, 0x1451f, 0x14529, 0x14537, 0x14543, 0x14573, 0x14589, 0x1458f, 0x1459b, 0x1459d, 0x145b5, 0x145b9, 0x145e5, 0x145f7, 0x145fd, 0x14623, 0x14629, 0x14637, 0x14645, 0x14649, 0x1465d, 0x14673, 0x1468f, 0x14691, 0x146a1, 0x146cb, 0x146d5, 0x146df, 0x146e9, 0x146f1, 0x146fd, 0x14709, 0x14717, 0x14721, 0x1472d, 0x1474b, 0x1475f, 0x1477d, 0x14793, 0x14795, 0x14799, 0x147af, 0x147b7, 0x147c3, 0x147c9, 0x147eb, 0x147f9, 0x14809, 0x14811, 0x1481d, 0x14827, 0x14835, 0x1483f, 0x14841, 0x14847, 0x14859, 0x14881, 0x14893, 0x148a9, 0x148c3, 0x148d7, 0x148db, 0x148f5, 0x148ff, 0x1490b, 0x14915, 0x14919, 0x1492f, 0x14931, 0x14943, 0x1495d, 0x14967, 0x14989, 0x1498f, 0x149df, 0x149e5, 0x149fb, 0x14a13, 0x14a15, 0x14a23, 0x14a2f, 0x14a67, 0x14a6d, 0x14a75, 0x14a85, 0x14a89, 0x14a91, 0x14aa7, 0x14aad, 0x14ab5, 0x14abf, 0x14acb, 0x14adf, 0x14ae9, 0x14af7, 0x14afb, 0x14b03, 0x14b0f, 0x14b21, 0x14b4d, 0x14b63, 0x14b7d, 0x14b87, 0x14b95, 0x14bb7, 0x14bbb, 0x14bc9, 0x14bcf, 0x14bdb, 0x14bdd, 0x14bf3, 0x14bf9, 0x14bff, 0x14c0d, 0x14c19, 0x14c1f, 0x14c67, 0x14c73, 0x14c83, 0x14c9b, 0x14ca7, 0x14cb9, 0x14cc7, 0x14ccb, 0x14cf7, 0x14cfd, 0x14d0f, 0x14d2d, 0x14d39, 0x14d41, 0x14d4d, 0x14d53, 0x14d5f, 0x14d69, 0x14d71, 0x14d7b, 0x14d8b, 0x14d8d, 0x14db1, 0x14dd1, 0x14de7, 0x14deb, 0x14df3, 0x14e17, 0x14e4b, 0x14e6f, 0x14e77, 0x14e81, 0x14e87, 0x14ea3, 0x14eaf, 0x14eb1, 0x14ebd, 0x14edb, 0x14eeb, 0x14ef5, 0x14eff, 0x14f13, 0x14f25, 0x14f31, 0x14f45, 0x14f49, 0x14f4f, 0x14f57, 0x14f5b, 0x14f61, 0x14f6b, 0x14f6d, 0x14f8f, 0x14fa1, 0x14fc7, 0x14fcd, 0x14fe3, 0x14ffb, 0x14ffd, 0x15003, 0x1500f, 0x15021, 0x15027, 0x1502b, 0x15059, 0x15081, 0x1509f, 0x150a5, 0x150b7, 0x150bb, 0x150c9, 0x150d7, 0x150eb, 0x150ff, 0x15107, 0x15125, 0x15149, 0x1515d, 0x1516d, 0x15175, 0x15183, 0x15189, 0x151a1, 0x151a7, 0x151b3, 0x151b5, 0x151cd, 0x151d3, 0x151df, 0x1520b, 0x1521f, 0x1522f, 0x15245, 0x1525d, 0x15261, 0x1526b, 0x15289, 0x15297, 0x152b3, 0x152b9, 0x152bf, 0x152c7, 0x152d5, 0x152f7, 0x152fb, 0x15303, 0x15309, 0x1531d, 0x15327, 0x15363, 0x1536f, 0x15377, 0x1539f, 0x153a5, 0x153bd, 0x153c5, 0x153d1, 0x153db, 0x153e1, 0x153ed, 0x153f5, 0x1540d, 0x15413, 0x1541f, 0x15431, 0x15457, 0x1545b, 0x1547f, 0x15483, 0x15485, 0x15491, 0x15497, 0x154b5, 0x154b9, 0x154cb, 0x154cd, 0x154d5, 0x154df, 0x15527, 0x1552d, 0x1554b, 0x15593, 0x155af, 0x155b1, 0x155b7, 0x155cf, 0x155db, 0x155ed, 0x155f5, 0x1560f, 0x15617, 0x15621, 0x1562b, 0x1562d, 0x15647, 0x15653, 0x15655, 0x15687, 0x1568d, 0x15695, 0x1569f, 0x156a9, 0x156af, 0x156c5, 0x156cf, 0x156d1, 0x156f5, 0x15701, 0x1570d, 0x15729, 0x15751, 0x1575b, 0x15767, 0x15783, 0x1579d, 0x157ab, 0x157c7, 0x157d3, 0x157d9, 0x15807, 0x15825, 0x1583d, 0x15851, 0x1585b, 0x1586b, 0x15883, 0x15889, 0x158a1, 0x158b3, 0x158d3, 0x158d9, 0x158df, 0x158e9, 0x158ef, 0x158fb, 0x158fd, 0x1592b, 0x15935, 0x15939, 0x1594b, 0x1594d, 0x15963, 0x15969, 0x15981, 0x1598d, 0x15993, 0x1599f, 0x159a3, 0x159a9, 0x159b7, 0x159cf, 0x159d7, 0x159dd, 0x159eb, 0x159ff, 0x15a09, 0x15a0f, 0x15a11, 0x15a41, 0x15a4b, 0x15a55, 0x15a6f, 0x15a71, 0x15a7d, 0x15a99, 0x15aa5, 0x15ab7, 0x15ad7, 0x15adb, 0x15ae7, 0x15aed, 0x15af3, 0x15b0d, 0x15b15, 0x15b3b, 0x15b45, 0x15b4f, 0x15b57, 0x15b61, 0x15b79, 0x15bab, 0x15bad, 0x15bc7, 0x15bdf, 0x15be9, 0x15c05, 0x15c2d, 0x15c33, 0x15c4b, 0x15c81, 0x15c8b, 0x15c93, 0x15c99, 0x15ca3, 0x15ca5, 0x15cc9, 0x15cd1, 0x15cdd, 0x15ceb, 0x15d01, 0x15d07, 0x15d0d, 0x15d15, 0x15d1f, 0x15d31, 0x15d37, 0x15d3b, 0x15d4f, 0x15d6b, 0x15d7f, 0x15d91, 0x15dab, 0x15dc7, 0x15dd9, 0x15ddf, 0x15df1, 0x15dfd, 0x15e01, 0x15e0b, 0x15e13, 0x15e19, 0x15e25, 0x15e29, 0x15e37, 0x15e57, 0x15e67, 0x15e73, 0x15e83, 0x15eab, 0x15ead, 0x15ec1, 0x15ecb, 0x15ed5, 0x15ee5, 0x15f2b, 0x15f3f, 0x15f41, 0x15f47, 0x15f55, 0x15f8d, 0x15f95, 0x15fa3, 0x15fbd, 0x15fd1, 0x15fdd, 0x15ff3, 0x15ff9, 0x16009, 0x16017, 0x16021, 0x1602b, 0x16039, 0x1604d, 0x16055, 0x16063, 0x16065, 0x16077, 0x1609f, 0x160a3, 0x160b1, 0x160dd, 0x1610b, 0x16119, 0x16137, 0x1613b, 0x1613d, 0x16143, 0x1615b, 0x16161, 0x16167, 0x16175, 0x1617f, 0x161ad, 0x161b5, 0x161c7, 0x161d3, 0x161d5, 0x161ef, 0x161fd, 0x16201, 0x16213, 0x16231, 0x1623b, 0x16245, 0x16249, 0x1624f, 0x1625d, 0x16261, 0x1626b, 0x16273, 0x1627f, 0x1628f, 0x16297, 0x1629d, 0x162ab, 0x162b3, 0x162d5, 0x162d9, 0x162e9, 0x162fd, 0x16327, 0x1632d, 0x16333, 0x16335, 0x1634d, 0x16353, 0x16365, 0x16369, 0x1637b, 0x16381, 0x1638b, 0x163a3, 0x163b1, 0x163ed, 0x163f5, 0x16407, 0x1640d, 0x1641f, 0x16423, 0x1643b, 0x16443, 0x16445, 0x16451, 0x1645d, 0x16497, 0x1649b, 0x164ab, 0x164b9, 0x164e9, 0x164f7, 0x16503, 0x1650f, 0x16511, 0x1651b, 0x1652b, 0x16535, 0x16539, 0x1653f, 0x16547, 0x1654b, 0x16565, 0x16577, 0x16581, 0x1658d, 0x16593, 0x165a5, 0x165bb, 0x165d1, 0x165db, 0x165e7, 0x165f3, 0x16603, 0x16605, 0x16617, 0x16627, 0x16639, 0x1664b, 0x16655, 0x16659, 0x16669, 0x16671, 0x16681, 0x166a9, 0x166bb, 0x166d7, 0x16701, 0x16707, 0x16715, 0x16719, 0x1672f, 0x16731, 0x16743, 0x16749, 0x1674f, 0x1676b, 0x16779, 0x167a1, 0x167bf, 0x167cb, 0x167d9, 0x167df, 0x167e5, 0x167f7, 0x16801, 0x1680b, 0x1681f, 0x16829, 0x1683b, 0x16849, 0x16875, 0x1687f, 0x1688f, 0x1689d, 0x168ad, 0x168b9, 0x168c7, 0x168cb, 0x168d3, 0x168d5, 0x16917, 0x1691b, 0x16933, 0x16947, 0x16955, 0x16965, 0x16969, 0x16971, 0x1698d, 0x1699f, 0x169af, 0x169bb, 0x169c5, 0x169cf, 0x169d1, 0x169d7, 0x16a03, 0x16a05, 0x16a1b, 0x16a2d, 0x16a3f, 0x16a41, 0x16a53, 0x16a69, 0x16a6f, 0x16a77, 0x16a8b, 0x16a99, 0x16aa3, 0x16aa5, 0x16abd, 0x16ac3, 0x16ac9, 0x16acf, 0x16ae7, 0x16af5, 0x16b01, 0x16b0d, 0x16b23, 0x16b29, 0x16b57, 0x16b5b, 0x16b61, 0x16b6b, 0x16b8f, 0x16b9d, 0x16bab, 0x16bb3, 0x16bb5, 0x16bc7, 0x16bef, 0x16bfb, 0x16c03, 0x16c1d, 0x16c39, 0x16c41, 0x16c6f, 0x16c77, 0x16c81, 0x16c93, 0x16ca5, 0x16cb7, 0x16cc9, 0x16ce7, 0x16cf3, 0x16d15, 0x16d31, 0x16d3b, 0x16d43, 0x16d4f, 0x16d79, 0x16d89, 0x16d9d, 0x16db3, 0x16db9, 0x16dbf, 0x16dc1, 0x16dc7, 0x16de5, 0x16df1, 0x16e19, 0x16e2f, 0x16e3d, 0x16e51, 0x16e5d, 0x16e67, 0x16e7f, 0x16e85, 0x16e91, 0x16e97, 0x16e9b, 0x16eb5, 0x16ecb, 0x16ed9, 0x16eef, 0x16efd, 0x16f0f, 0x16f11, 0x16f21, 0x16f2b, 0x16f47, 0x16f55, 0x16f71, 0x16f81, 0x16f87, 0x16f8d, 0x16f95, 0x16fb7, 0x16fc9, 0x16fdb, 0x16fed, 0x16fff, 0x17025, 0x17029, 0x17057, 0x1705b, 0x17061, 0x1706b, 0x1706d, 0x17083, 0x1708f, 0x1709d, 0x170ab, 0x170b3, 0x170b9, 0x170d9, 0x170fd, 0x17103, 0x17111, 0x17117, 0x17127, 0x17133, 0x17159, 0x1715f, 0x1716f, 0x17177, 0x1717b, 0x17181, 0x17195, 0x171b1, 0x171bd, 0x171c3, 0x171dd, 0x171f9, 0x17205, 0x1720f, 0x1721b, 0x1721d, 0x17221, 0x1722d, 0x1725f, 0x17263, 0x17271, 0x17287, 0x1728b, 0x1728d, 0x17299, 0x172a3, 0x172a9, 0x172af, 0x172cf, 0x172dd, 0x172e1, 0x172e7, 0x17329, 0x1733d, 0x17343, 0x17345, 0x17361, 0x17367, 0x1736d, 0x17373, 0x1738f, 0x17391, 0x1739b, 0x173ad, 0x173b9, 0x173bf, 0x173d5, 0x173f1, 0x17403, 0x17411, 0x17439, 0x17447, 0x1744d, 0x17469, 0x1746f, 0x17471, 0x1747d, 0x17481, 0x17487, 0x1748d, 0x17495, 0x174b1, 0x174b7, 0x174bb, 0x174c5, 0x174d7, 0x174eb, 0x174ed, 0x17501, 0x17513, 0x17515, 0x17519, 0x17523, 0x17525, 0x17549, 0x1755d, 0x17583, 0x17597, 0x1759b, 0x175a1, 0x175a7, 0x175b3, 0x175cb, 0x175fd, 0x17607, 0x1760d, 0x17619, 0x1763b, 0x1763d, 0x17643, 0x17657, 0x17661, 0x17667, 0x17675, 0x17689, 0x1769d, 0x176a1, 0x176ab, 0x176c7, 0x176df, 0x176f1, 0x17711, 0x1771b, 0x1771d, 0x17735, 0x1773f, 0x17741, 0x1774b, 0x17781, 0x1778b, 0x17793, 0x177a5, 0x177a9, 0x177b7, 0x177c3, 0x177f5, 0x17809, 0x17811, 0x17835, 0x1783f, 0x17853, 0x1785f, 0x17869, 0x17877, 0x17899, 0x178c3, 0x178c9, 0x178cf, 0x178d1, 0x178db, 0x178dd, 0x178e7, 0x178eb, 0x178ed, 0x17901, 0x17907, 0x1790d, 0x17973, 0x17979, 0x1797f, 0x17991, 0x17997, 0x1799d, 0x179ab, 0x179b9, 0x179e9, 0x179ef, 0x179f1, 0x17a01, 0x17a1f, 0x17a57, 0x17a5b, 0x17a61, 0x17a7f, 0x17a91, 0x17aa7, 0x17aab, 0x17aad, 0x17ab9, 0x17ae3, 0x17ae5, 0x17aef, 0x17af1, 0x17af7, 0x17b05, 0x17b1d, 0x17b33, 0x17b39, 0x17b63, 0x17b7b, 0x17b95, 0x17ba9, 0x17bb1, 0x17bbb, 0x17bbd, 0x17be1, 0x17be7, 0x17beb, 0x17bf3, 0x17bf5, 0x17c07, 0x17c19, 0x17c2f, 0x17c37, 0x17c4f, 0x17c5d, 0x17c7f, 0x17c85, 0x17ca1, 0x17cb5, 0x17cbf, 0x17cc1, 0x17ccb, 0x17cd3, 0x17d03, 0x17d21, 0x17d33, 0x17d47, 0x17d59, 0x17d63, 0x17d7b, 0x17d87, 0x17da5, 0x17da9, 0x17db1, 0x17dc5, 0x17dd7, 0x17ddb, 0x17e1d, 0x17e27, 0x17e2b, 0x17e35, 0x17e41, 0x17e4b, 0x17e59, 0x17e65, 0x17e8b, 0x17e8d, 0x17e93, 0x17eaf, 0x17ebb, 0x17ec3, 0x17ec5, 0x17ed1, 0x17ed7, 0x17ee1, 0x17ee7, 0x17eed, 0x17eff, 0x17f0b, 0x17f0d, 0x17f2f, 0x17f31, 0x17f45, 0x17f5d, 0x17f73, 0x17f75, 0x17fa1, 0x17fb3, 0x17fc7, 0x17fd3, 0x17fe3, 0x17fe5, 0x17ffb, 0x18013, 0x18015, 0x18049, 0x1805d, 0x1806d, 0x18085, 0x180a1, 0x180a7, 0x180ad, 0x180cd, 0x180f7, 0x18103, 0x18105, 0x18117, 0x1811d, 0x1812b, 0x1814d, 0x1816f, 0x1817d, 0x18195, 0x181a3, 0x181a5, 0x181b7, 0x181db, 0x181e1, 0x181f9, 0x18211, 0x1821b, 0x1821d, 0x18227, 0x18235, 0x18241, 0x18255, 0x18265, 0x18277, 0x1828b, 0x18293, 0x1829f, 0x182bb, 0x182c3, 0x182c9, 0x182d1, 0x182e7, 0x182f3, 0x182f5, 0x182ff, 0x18307, 0x18315, 0x18329, 0x1833b, 0x18357, 0x1835d, 0x18361, 0x1836b, 0x18379, 0x18385, 0x18389, 0x183ab, 0x183b3, 0x183b9, 0x183bf, 0x183c1, 0x183d5, 0x183df, 0x183f1, 0x183f7, 0x18411, 0x1841b, 0x18433, 0x1844d, 0x18459, 0x18469, 0x1846f, 0x18477, 0x18493, 0x184af, 0x184b1, 0x184b7, 0x184cf, 0x184d1, 0x184dd, 0x184f9, 0x1850d, 0x18513, 0x18523, 0x18525, 0x18529, 0x18537, 0x18545, 0x1854f, 0x18561, 0x1856d, 0x18579, 0x1857f, 0x18585, 0x1859d, 0x185c7, 0x185cd, 0x185d9, 0x185df, 0x185e9, 0x185fb, 0x1860b, 0x18619, 0x18625, 0x18637, 0x1863d, 0x18657, 0x18683, 0x186ab, 0x186ad, 0x186c1, 0x186d9, 0x186f1, 0x186f7, 0x186fd, 0x1870f, 0x1871d, 0x18721, 0x18733, 0x18741, 0x18753, 0x18787, 0x187af, 0x187b1, 0x187c5, 0x187dd, 0x187f3, 0x1880f, 0x18833, 0x1884d, 0x1885f, 0x18863, 0x18871, 0x18887, 0x188a5, 0x188b1, 0x188c5, 0x188c9, 0x188d7, 0x188e1, 0x188eb, 0x18913, 0x1892f, 0x18931, 0x18943, 0x18949, 0x1895d, 0x18979, 0x1897f, 0x18985, 0x1899b, 0x189a7, 0x189ad, 0x189cb, 0x189d9, 0x189ef, 0x189fb, 0x18a0d, 0x18a29, 0x18a45, 0x18a4f, 0x18a61, 0x18a67, 0x18a6b, 0x18a73, 0x18a75, 0x18a9d, 0x18aad, 0x18ab3, 0x18ac1, 0x18ae3, 0x18ae5, 0x18b03, 0x18b35, 0x18b39, 0x18b47, 0x18b4b, 0x18b59, 0x18b63, 0x18b77, 0x18b81, 0x18b8d, 0x18b9f, 0x18bb7, 0x18bd1, 0x18bdb, 0x18bf5, 0x18c0d, 0x18c23, 0x18c31, 0x18c7f, 0x18c91, 0x18c97, 0x18c9d, 0x18ca1, 0x18cb9, 0x18ccb, 0x18ce3, 0x18cef, 0x18cfb, 0x18d05, 0x18d09, 0x18d1b, 0x18d27, 0x18d35, 0x18d41, 0x18d69, 0x18d7b, 0x18d7d, 0x18d95, 0x18da3, 0x18da5, 0x18db7, 0x18dbd, 0x18dc9, 0x18dcf, 0x18de7, 0x18e05, 0x18e09, 0x18e1b, 0x18e21, 0x18e3f, 0x18e47, 0x18e63, 0x18e69, 0x18e77, 0x18e87, 0x18ea3, 0x18ea9, 0x18eb1, 0x18ebb, 0x18ebd, 0x18ecf, 0x18f0b, 0x18f19, 0x18f1f, 0x18f2f, 0x18f51, 0x18f57, 0x18f5b, 0x18f61, 0x18f73, 0x18f89, 0x18f9b, 0x18fb9, 0x18fcb, 0x18fd3, 0x18fd9, 0x18fe5, 0x18fef, 0x18ffd, 0x19003, 0x1900f, 0x1901b, 0x19027, 0x19047, 0x1904b, 0x19055, 0x19071, 0x1908d, 0x190a5, 0x190af, 0x190b7, 0x190d7, 0x190e7, 0x190f5, 0x1910b, 0x1911f, 0x19123, 0x1913b, 0x19143, 0x1914f, 0x19151, 0x19157, 0x1915d, 0x1916b, 0x19179, 0x1919b, 0x191a1, 0x191ab, 0x191b9, 0x191d3, 0x191e5, 0x191e9, 0x191f1, 0x19219, 0x19225, 0x19231, 0x19243, 0x19251, 0x1926d, 0x19275, 0x19279, 0x19283, 0x19289, 0x19291, 0x192a7, 0x192bf, 0x192df, 0x192fd, 0x19305, 0x1930f, 0x19317, 0x19327, 0x19335, 0x1934b, 0x1934d, 0x19355, 0x1937b, 0x1939f, 0x193a9, 0x193b1, 0x193c5, 0x193cf, 0x193db, 0x193dd, 0x193eb, 0x193f3, 0x193ff, 0x19401, 0x19437, 0x1943b, 0x1943d, 0x19449, 0x19457, 0x19473, 0x19489, 0x19491, 0x194a7, 0x194ab, 0x194ad, 0x194c1, 0x194d5, 0x194ef, 0x19505, 0x19509, 0x19517, 0x1951b, 0x1952b, 0x19539, 0x1953f, 0x19547, 0x1955f, 0x19565, 0x19571, 0x1957b, 0x19587, 0x1958b, 0x1958d, 0x195a9, 0x195c3, 0x195d1, 0x195f3, 0x19605, 0x1962d, 0x19635, 0x1965f, 0x19669, 0x19677, 0x1967d, 0x19681, 0x196b7, 0x196db, 0x196e7, 0x196eb, 0x196f9, 0x19707, 0x1970d, 0x19713, 0x19715, 0x1971f, 0x19737, 0x19761, 0x1977f, 0x19797, 0x197a1, 0x197a7, 0x197ab, 0x197b9, 0x197d5, 0x197e3, 0x197e9, 0x197fd, 0x1980b, 0x19823, 0x1982f, 0x19831, 0x19843, 0x19851, 0x19875, 0x1988f, 0x198b9, 0x198c7, 0x198e9, 0x198fb, 0x1990f, 0x1991d, 0x19927, 0x1992b, 0x1992d, 0x19941, 0x19947, 0x19959, 0x1997d, 0x1998b, 0x1998d, 0x199a9, 0x199bd, 0x199c3, 0x199c9, 0x199d1, 0x199e7, 0x199ff, 0x19a0f, 0x19a1d, 0x19a35, 0x19a6f, 0x19a81, 0x19a8d, 0x19a95, 0x19aa3, 0x19ab7, 0x19abb, 0x19ad7, 0x19b07, 0x19b15, 0x19b31, 0x19b37, 0x19b5b, 0x19b5d, 0x19b6d, 0x19b79, 0x19b7f, 0x19b83, 0x19b9b, 0x19ba1, 0x19bad, 0x19bcb, 0x19bdf, 0x19bef, 0x19bfd, 0x19c09, 0x19c17, 0x19c2b, 0x19c3f, 0x19c53, 0x19c65, 0x19c69, 0x19c8d, 0x19ca3, 0x19cb1, 0x19cc5, 0x19ce1, 0x19ceb, 0x19cf3, 0x19cf5, 0x19d01, 0x19d19, 0x19d29, 0x19d2f, 0x19d3d, 0x19d45, 0x19d49, 0x19d7f, 0x19d8f, 0x19d9d, 0x19db9, 0x19dcb, 0x19de3, 0x19def, 0x19df1, 0x19df7, 0x19dfd, 0x19e07, 0x19e4f, 0x19e57, 0x19e5b, 0x19e61, 0x19e6d, 0x19e73, 0x19e79, 0x19e83, 0x19e91, 0x19ea7, 0x19eb5, 0x19eb9, 0x19ec7, 0x19ecb, 0x19edf, 0x19eef, 0x19ef1, 0x19efb, 0x19f05, 0x19f11, 0x19f17, 0x19f21, 0x19f4d, 0x19f53, 0x19f59, 0x19f65, 0x19f6f, 0x19f77, 0x19f7b, 0x19f93, 0x19f99, 0x19fa5, 0x19fb7, 0x19fbd, 0x19fc3, 0x19fc9, 0x19ff5, 0x1a011, 0x1a021, 0x1a02d, 0x1a033, 0x1a041, 0x1a059, 0x1a069, 0x1a06f, 0x1a07b, 0x1a095, 0x1a0c3, 0x1a0cf, 0x1a0db, 0x1a0f5, 0x1a0f9, 0x1a107, 0x1a10d, 0x1a113, 0x1a11f, 0x1a125, 0x1a129, 0x1a131, 0x1a137, 0x1a145, 0x1a185, 0x1a197, 0x1a1ab, 0x1a1d9, 0x1a1e3, 0x1a1fd, 0x1a23b, 0x1a275, 0x1a283, 0x1a289, 0x1a291, 0x1a29d, 0x1a2a7, 0x1a2ad, 0x1a2bf, 0x1a2c1, 0x1a2c7, 0x1a2fd, 0x1a31b, 0x1a321, 0x1a32b, 0x1a333, 0x1a347, 0x1a353, 0x1a35f, 0x1a365, 0x1a369, 0x1a377, 0x1a37b, 0x1a38b, 0x1a38d, 0x1a3b1, 0x1a3cf, 0x1a3dd, 0x1a3e1, 0x1a3f9, 0x1a413, 0x1a419, 0x1a449, 0x1a44f, 0x1a451, 0x1a467, 0x1a475, 0x1a479, 0x1a485, 0x1a4b5, 0x1a4bf, 0x1a4c1, 0x1a4cb, 0x1a4cd, 0x1a4e5, 0x1a4e9, 0x1a4f7, 0x1a4fd, 0x1a505, 0x1a517, 0x1a527, 0x1a52b, 0x1a535, 0x1a54d, 0x1a555, 0x1a559, 0x1a571, 0x1a581, 0x1a593, 0x1a5a3, 0x1a5b1, 0x1a5b7, 0x1a5bb, 0x1a5c5, 0x1a5cf, 0x1a5dd, 0x1a62d, 0x1a639, 0x1a63f, 0x1a64b, 0x1a655, 0x1a663, 0x1a665, 0x1a66f, 0x1a671, 0x1a67d, 0x1a699, 0x1a6a5, 0x1a6b7, 0x1a6c5, 0x1a6e1, 0x1a6ed, 0x1a6f3, 0x1a6f5, 0x1a71f, 0x1a723, 0x1a731, 0x1a757, 0x1a75d, 0x1a767, 0x1a773, 0x1a797, 0x1a7b3, 0x1a7b9, 0x1a7bf, 0x1a7cd, 0x1a7e3, 0x1a7e9, 0x1a801, 0x1a80d, 0x1a815, 0x1a831, 0x1a83b, 0x1a84f, 0x1a857, 0x1a861, 0x1a873, 0x1a8a7, 0x1a8d5, 0x1a8df, 0x1a8ef, 0x1a8fd, 0x1a903, 0x1a917, 0x1a91b, 0x1a933, 0x1a935, 0x1a94b, 0x1a94d, 0x1a953, 0x1a98b, 0x1a999, 0x1a9af, 0x1a9b1, 0x1a9c9, 0x1a9e7, 0x1a9ed, 0x1a9f5, 0x1aa09, 0x1aa0f, 0x1aa1b, 0x1aa1d, 0x1aa21, 0x1aa4d, 0x1aa53, 0x1aa77, 0x1aa7b, 0x1aa8d, 0x1aa99, 0x1aa9f, 0x1aabd, 0x1aac3, 0x1aad1, 0x1aad7, 0x1aadd, 0x1aaf5, 0x1ab0b, 0x1ab13, 0x1ab19, 0x1ab1f, 0x1ab3d, 0x1ab51, 0x1ab57, 0x1ab75, 0x1ab83, 0x1ab8f, 0x1aba7, 0x1abad, 0x1abb5, 0x1abbf, 0x1abd3, 0x1abd5, 0x1abd9, 0x1abef, 0x1ac1d, 0x1ac27, 0x1ac35, 0x1ac47, 0x1ac5f, 0x1ac69, 0x1ac81, 0x1ac8d, 0x1ac95, 0x1aca3, 0x1acb1, 0x1accf, 0x1acd7, 0x1ad13, 0x1ad2f, 0x1ad31, 0x1ad4f, 0x1ad5b, 0x1ad6b, 0x1ad75, 0x1ad79, 0x1ad83, 0x1ad91, 0x1ada7, 0x1adad, 0x1adc1, 0x1adcd, 0x1addf, 0x1ade5, 0x1adfb, 0x1ae15, 0x1ae23, 0x1ae3d, 0x1ae4f, 0x1ae5d, 0x1ae61, 0x1ae73, 0x1ae75, 0x1ae8f, 0x1ae97, 0x1ae9b, 0x1aebf, 0x1aed3, 0x1aedf, 0x1aee5, 0x1aee9, 0x1aef1, 0x1aefb, 0x1af11, 0x1af35, 0x1af39, 0x1af41, 0x1af65, 0x1af93, 0x1af99, 0x1afaf, 0x1afbd, 0x1afc5, 0x1afd1, 0x1afd7, 0x1afe1, 0x1afff, 0x1b013, 0x1b029, 0x1b03b, 0x1b043, 0x1b051, 0x1b05b, 0x1b07f, 0x1b083, 0x1b09b, 0x1b09d, 0x1b0ab, 0x1b0ad, 0x1b0b9, 0x1b0c7, 0x1b0d9, 0x1b0e3, 0x1b0ef, 0x1b109, 0x1b12b, 0x1b12d, 0x1b14d, 0x1b153, 0x1b15f, 0x1b163, 0x1b171, 0x1b177, 0x1b18b, 0x1b199, 0x1b1af, 0x1b1bb, 0x1b1cf, 0x1b1dd, 0x1b1e1, 0x1b1e7, 0x1b205, 0x1b209, 0x1b211, 0x1b21b, 0x1b24d, 0x1b259, 0x1b265, 0x1b277, 0x1b27b, 0x1b287, 0x1b2b1, 0x1b2b7, 0x1b2c9, 0x1b2d1, 0x1b2db, 0x1b2eb, 0x1b2ed, 0x1b313, 0x1b323, 0x1b345, 0x1b349, 0x1b34f, 0x1b35d, 0x1b37f, 0x1b38f, 0x1b397, 0x1b39d, 0x1b3b3, 0x1b3c7, 0x1b3e3, 0x1b3e9, 0x1b3f1, 0x1b40f, 0x1b41b, 0x1b41d, 0x1b435, 0x1b439, 0x1b455, 0x1b46f, 0x1b481, 0x1b499, 0x1b4bd, 0x1b4c9, 0x1b4f3, 0x1b50d, 0x1b531, 0x1b53b, 0x1b56b, 0x1b597, 0x1b5ad, 0x1b5b3, 0x1b5b9, 0x1b5bf, 0x1b5c7, 0x1b5d5, 0x1b5e3, 0x1b5e5, 0x1b5e9, 0x1b607, 0x1b60b, 0x1b619, 0x1b625, 0x1b631, 0x1b63d, 0x1b64f, 0x1b679, 0x1b67f, 0x1b691, 0x1b69b, 0x1b6b5, 0x1b6bf, 0x1b6d3, 0x1b6e5, 0x1b6ef, 0x1b6f7, 0x1b703, 0x1b70f, 0x1b711, 0x1b727, 0x1b74d, 0x1b755, 0x1b769, 0x1b76f, 0x1b77d, 0x1b793, 0x1b795, 0x1b7a3, 0x1b7a5, 0x1b7a9, 0x1b7d7, 0x1b7db, 0x1b7e1, 0x1b7ed, 0x1b7f9, 0x1b81b, 0x1b821, 0x1b82b, 0x1b82d, 0x1b84d, 0x1b853, 0x1b85f, 0x1b869, 0x1b88b, 0x1b88d, 0x1b8a9, 0x1b8d7, 0x1b8dd, 0x1b8e7, 0x1b8f9, 0x1b901, 0x1b90d, 0x1b913, 0x1b91f, 0x1b929, 0x1b92f, 0x1b949, 0x1b95b, 0x1b96d, 0x1b975, 0x1b983, 0x1b991, 0x1b9b5, 0x1b9b9, 0x1b9c7, 0x1b9f1, 0x1b9f7, 0x1ba07, 0x1ba15, 0x1ba31, 0x1ba45, 0x1ba57, 0x1ba5d, 0x1ba83, 0x1ba85, 0x1ba97, 0x1baa1, 0x1bab3, 0x1bab9, 0x1bacd, 0x1bae3, 0x1bafd, 0x1bb05, 0x1bb1b, 0x1bb27, 0x1bb2d, 0x1bb3f, 0x1bb4b, 0x1bb4d, 0x1bb6f, 0x1bb81, 0x1bba5, 0x1bbb1, 0x1bbbd, 0x1bbcf, 0x1bc07, 0x1bc0b, 0x1bc19, 0x1bc29, 0x1bc45, 0x1bc61, 0x1bc67, 0x1bc85, 0x1bc89, 0x1bc9b, 0x1bcab, 0x1bcc1, 0x1bcc7, 0x1bcf1, 0x1bcf7, 0x1bd09, 0x1bd1d, 0x1bd3f, 0x1bd53, 0x1bd63, 0x1bd65, 0x1bd7d, 0x1bd8b, 0x1bd8d, 0x1bd93, 0x1bda9, 0x1bdaf, 0x1bdbd, 0x1bdd7, 0x1bdf3, 0x1be0f, 0x1be17, 0x1be21, 0x1be33, 0x1be35, 0x1be39, 0x1be5f, 0x1be63, 0x1be69, 0x1be6f, 0x1be81, 0x1be95, 0x1bea5, 0x1bec9, 0x1beeb, 0x1bef3, 0x1bef9, 0x1beff, 0x1bf19, 0x1bf23, 0x1bf25, 0x1bf2f, 0x1bf31, 0x1bf37, 0x1bf43, 0x1bf4f, 0x1bf51, 0x1bf67, 0x1bf6b, 0x1bf79, 0x1bf7f, 0x1bf85, 0x1bfa7, 0x1bfad, 0x1bfc1, 0x1bfdf, 0x1bfe5, 0x1bffd, 0x1c017, 0x1c021, 0x1c027, 0x1c035, 0x1c04d, 0x1c069, 0x1c071, 0x1c07b, 0x1c07d, 0x1c087, 0x1c09f, 0x1c0b1, 0x1c0bb, 0x1c0c9, 0x1c0cf, 0x1c0db, 0x1c0dd, 0x1c0f3, 0x1c107, 0x1c10b, 0x1c115, 0x1c119, 0x1c137, 0x1c13d, 0x1c151, 0x1c175, 0x1c179, 0x1c17f, 0x1c183, 0x1c185, 0x1c1b3, 0x1c1cd, 0x1c1d3, 0x1c1d9, 0x1c1df, 0x1c1e9, 0x1c207, 0x1c21f, 0x1c223, 0x1c231, 0x1c24f, 0x1c251, 0x1c25d, 0x1c267, 0x1c285, 0x1c29b, 0x1c29d, 0x1c2c1, 0x1c2d5, 0x1c2df, 0x1c2e3, 0x1c2e5, 0x1c309, 0x1c341, 0x1c353, 0x1c371, 0x1c37d, 0x1c381, 0x1c39f, 0x1c3a5, 0x1c3b7, 0x1c3c3, 0x1c3c9, 0x1c3d7, 0x1c3e1, 0x1c3ed, 0x1c401, 0x1c413, 0x1c425, 0x1c429, 0x1c445, 0x1c45d, 0x1c46b, 0x1c479, 0x1c47f, 0x1c491, 0x1c4a7, 0x1c4d5, 0x1c4e3, 0x1c4e9, 0x1c511, 0x1c527, 0x1c52d, 0x1c533, 0x1c541, 0x1c54d, 0x1c553, 0x1c559, 0x1c577, 0x1c57d, 0x1c58b, 0x1c599, 0x1c5a3, 0x1c5b1, 0x1c5b7, 0x1c5d1, 0x1c5ed, 0x1c5f5, 0x1c609, 0x1c61b, 0x1c62d, 0x1c633, 0x1c639, 0x1c665, 0x1c67b, 0x1c68b, 0x1c695, 0x1c6af, 0x1c6dd, 0x1c6e1, 0x1c6f3, 0x1c701, 0x1c70d, 0x1c729, 0x1c73b, 0x1c743, 0x1c75b, 0x1c767, 0x1c76d, 0x1c775, 0x1c78f, 0x1c79b, 0x1c7ad, 0x1c7b5, 0x1c7bf, 0x1c7d5, 0x1c7e5, 0x1c7fd, 0x1c807, 0x1c813, 0x1c815, 0x1c819, 0x1c825, 0x1c837, 0x1c867, 0x1c86b, 0x1c879, 0x1c883, 0x1c889, 0x1c897, 0x1c8bf, 0x1c8cd, 0x1c8df, 0x1c8ef, 0x1c8f7, 0x1c8fd, 0x1c911, 0x1c91d, 0x1c933, 0x1c947, 0x1c94b, 0x1c955, 0x1c95f, 0x1c963, 0x1c969, 0x1c96f, 0x1c98d, 0x1c993, 0x1c995, 0x1c9a9, 0x1c9b1, 0x1c9bb, 0x1c9d7, 0x1c9db, 0x1ca03, 0x1ca11, 0x1ca2b, 0x1ca41, 0x1ca47, 0x1ca53, 0x1ca59, 0x1ca65, 0x1ca8b, 0x1ca93, 0x1caa5, 0x1caa9, 0x1caaf, 0x1cab7, 0x1cabd, 0x1cae1, 0x1cae7, 0x1caf3, 0x1cb15, 0x1cb19, 0x1cb1f, 0x1cb23, 0x1cb51, 0x1cb5d, 0x1cb6b, 0x1cb85, 0x1cb89, 0x1cbab, 0x1cbbf, 0x1cbd3, 0x1cbe9, 0x1cbfb, 0x1cc27, 0x1cc41, 0x1cc4b, 0x1cc65, 0x1cc6f, 0x1cc7b, 0x1cc87, 0x1cc99, 0x1cca3, 0x1cca5, 0x1ccb7, 0x1ccdd, 0x1cced, 0x1ccf5, 0x1ccff, 0x1cd0d, 0x1cd25, 0x1cd37, 0x1cd4f, 0x1cd57, 0x1cd79, 0x1cd9d, 0x1cdc7, 0x1cdcb, 0x1cdd5, 0x1cddf, 0x1cde9, 0x1cdef, 0x1cdf1, 0x1cdfb, 0x1ce13, 0x1ce3b, 0x1ce3d, 0x1ce49, 0x1ce57, 0x1ce6d, 0x1ce7f, 0x1ce83, 0x1ce89, 0x1ce9d, 0x1cea7, 0x1cead, 0x1ceb5, 0x1cebf, 0x1ced3, 0x1ceef, 0x1cef1, 0x1cefd, 0x1cf05, 0x1cf09, 0x1cf1b, 0x1cf21, 0x1cf2b, 0x1cf33, 0x1cf3f, 0x1cf4d, 0x1cf63, 0x1cf65, 0x1cfbd, 0x1cfe1, 0x1d007, 0x1d00d, 0x1d019, 0x1d02f, 0x1d073, 0x1d089, 0x1d08f, 0x1d0bf, 0x1d0cd, 0x1d0d5, 0x1d0e5, 0x1d0e9, 0x1d0fb, 0x1d103, 0x1d10f, 0x1d11d, 0x1d12b, 0x1d12d, 0x1d139, 0x1d14b, 0x1d153, 0x1d171, 0x1d181, 0x1d193, 0x1d19f, 0x1d1c5, 0x1d1d7, 0x1d1f3, 0x1d211, 0x1d221, 0x1d227, 0x1d24d, 0x1d255, 0x1d263, 0x1d26f, 0x1d28d, 0x1d295, 0x1d29f, 0x1d2bb, 0x1d2cf, 0x1d2e1, 0x1d2eb, 0x1d2ed, 0x1d301, 0x1d30b, 0x1d32f, 0x1d33d, 0x1d35b, 0x1d35d, 0x1d37f, 0x1d389, 0x1d39b, 0x1d3a1, 0x1d3bf, 0x1d3c1, 0x1d3cb, 0x1d3d3, 0x1d3d9, 0x1d3e9, 0x1d3ef, 0x1d41d, 0x1d42b, 0x1d43f, 0x1d441, 0x1d453, 0x1d455, 0x1d45f, 0x1d471, 0x1d499, 0x1d4b1, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4dd, 0x1d4e7, 0x1d4f3, 0x1d4f5, 0x1d4f9, 0x1d513, 0x1d51f, 0x1d52f, 0x1d549, 0x1d557, 0x1d567, 0x1d57f, 0x1d583, 0x1d589, 0x1d591, 0x1d5ab, 0x1d5ad, 0x1d5b5, 0x1d5bf, 0x1d5cb, 0x1d5e3, 0x1d5e5, 0x1d5ef, 0x1d5f1, 0x1d5f7, 0x1d601, 0x1d613, 0x1d615, 0x1d623, 0x1d625, 0x1d63b, 0x1d65d, 0x1d66b, 0x1d691, 0x1d6ab, 0x1d6b3, 0x1d6b5, 0x1d6cd, 0x1d6d9, 0x1d6fd, 0x1d717, 0x1d727, 0x1d72d, 0x1d735, 0x1d759, 0x1d75f, 0x1d77b, 0x1d77d, 0x1d787, 0x1d7b1, 0x1d7b7, 0x1d7c9, 0x1d7d1, 0x1d7db, 0x1d7eb, 0x1d80f, 0x1d827, 0x1d839, 0x1d853, 0x1d87d, 0x1d899, 0x1d8b7, 0x1d8c3, 0x1d8c5, 0x1d8d1, 0x1d8f5, 0x1d8ff, 0x1d907, 0x1d90b, 0x1d90d, 0x1d91f, 0x1d931, 0x1d943, 0x1d945, 0x1d94f, 0x1d967, 0x1d975, 0x1d9b3, 0x1d9d3, 0x1d9f7, 0x1d9fb, 0x1da13, 0x1da15, 0x1da19, 0x1da31, 0x1da37, 0x1da43, 0x1da49, 0x1da5d, 0x1da67, 0x1da6d, 0x1da85, 0x1da9b, 0x1daa7, 0x1dab3, 0x1dab5, 0x1dacb, 0x1dad3, 0x1dad9, 0x1daef, 0x1db03, 0x1db0f, 0x1db35, 0x1db39, 0x1db47, 0x1db4b, 0x1db55, 0x1db63, 0x1db87, 0x1dba3, 0x1dba5, 0x1dbc5, 0x1dbd7, 0x1dbdd, 0x1dbed, 0x1dbf3, 0x1dbf9, 0x1dc0d, 0x1dc19, 0x1dc2f, 0x1dc3d, 0x1dc43, 0x1dc45, 0x1dc6d, 0x1dc7f, 0x1dc83, 0x1dc91, 0x1dc9b, 0x1dcab, 0x1dcad, 0x1dcb9, 0x1dcd3, 0x1dce3, 0x1dce5, 0x1dd0f, 0x1dd1b, 0x1dd1d, 0x1dd21, 0x1dd39, 0x1dd3f, 0x1dd47, 0x1dd4d, 0x1dd69, 0x1dd71, 0x1dd8b, 0x1dd95, 0x1dd99, 0x1dda3, 0x1ddcf, 0x1dde1, 0x1ddf3, 0x1de03, 0x1de05, 0x1de27, 0x1de4b, 0x1de4d, 0x1de65, 0x1de69, 0x1de7b, 0x1de81, 0x1de95, 0x1dea5, 0x1deaf, 0x1debd, 0x1dec3, 0x1decf, 0x1ded1, 0x1dedb, 0x1df01, 0x1df29, 0x1df37, 0x1df3b, 0x1df45, 0x1df49, 0x1df57, 0x1df73, 0x1df83, 0x1df85, 0x1df8f, 0x1df91, 0x1dfa1, 0x1dfcd, 0x1dfef, 0x1e013, 0x1e015, 0x1e023, 0x1e037, 0x1e045, 0x1e049, 0x1e05b, 0x1e061, 0x1e07f, 0x1e09d, 0x1e0ab, 0x1e0b3, 0x1e0b5, 0x1e0d5, 0x1e0d9, 0x1e0df, 0x1e0e9, 0x1e0fb, 0x1e117, 0x1e133, 0x1e14d, 0x1e165, 0x1e177, 0x1e193, 0x1e1a5, 0x1e1b7, 0x1e1c3, 0x1e1d1, 0x1e1db, 0x1e1ed, 0x1e209, 0x1e217, 0x1e21d, 0x1e22d, 0x1e233, 0x1e239, 0x1e25f, 0x1e28d, 0x1e2c5, 0x1e2eb, 0x1e2f9, 0x1e301, 0x1e31f, 0x1e325, 0x1e32f, 0x1e345, 0x1e351, 0x1e361, 0x1e373, 0x1e38f, 0x1e39b, 0x1e39d, 0x1e3ab, 0x1e3ad, 0x1e3c1, 0x1e3c7, 0x1e3e5, 0x1e3f7, 0x1e411, 0x1e42b, 0x1e439, 0x1e44b, 0x1e469, 0x1e46f, 0x1e471, 0x1e47d, 0x1e487, 0x1e48d, 0x1e4a3, 0x1e4cf, 0x1e4db, 0x1e4eb, 0x1e4f3, 0x1e501, 0x1e513, 0x1e537, 0x1e543, 0x1e567, 0x1e56b, 0x1e56d, 0x1e575, 0x1e57f, 0x1e59b, 0x1e5b5, 0x1e5bf, 0x1e5cd, 0x1e5d9, 0x1e5df, 0x1e5e5, 0x1e5fb, 0x1e607, 0x1e60b, 0x1e62f, 0x1e631, 0x1e63d, 0x1e643, 0x1e64f, 0x1e66b, 0x1e685, 0x1e689, 0x1e697, 0x1e69d, 0x1e6a1, 0x1e6ad, 0x1e6b9, 0x1e6d5, 0x1e6e3, 0x1e6f1, 0x1e6f7, 0x1e709, 0x1e71b, 0x1e72d, 0x1e735, 0x1e73f, 0x1e741, 0x1e74b, 0x1e755, 0x1e763, 0x1e76f, 0x1e777, 0x1e781, 0x1e78b, 0x1e793, 0x1e79f, 0x1e7a5, 0x1e7af, 0x1e7bb, 0x1e7e1, 0x1e817, 0x1e833, 0x1e85f, 0x1e86f, 0x1e877, 0x1e87d, 0x1e881, 0x1e895, 0x1e899, 0x1e8a5, 0x1e8cf, 0x1e8d1, 0x1e8ed, 0x1e901, 0x1e923, 0x1e925, 0x1e929, 0x1e93b, 0x1e957, 0x1e96b, 0x1e973, 0x1e97f, 0x1e98f, 0x1e997, 0x1e9cd, 0x1e9e3, 0x1e9ef, 0x1e9f1, 0x1e9fb, 0x1e9fd, 0x1ea13, 0x1ea19, 0x1ea1f, 0x1ea29, 0x1ea43, 0x1ea51, 0x1ea61, 0x1ea89, 0x1ea91, 0x1ea9d, 0x1eaa7, 0x1eab9, 0x1eac1, 0x1eac7, 0x1ead5, 0x1eae5, 0x1eaef, 0x1eaf7, 0x1eafd, 0x1eb05, 0x1eb1b, 0x1eb21, 0x1eb2b, 0x1eb2d, 0x1eb41, 0x1eb55, 0x1eb7b, 0x1eb9f, 0x1eba9, 0x1ebb1, 0x1ebc3, 0x1ebc5, 0x1ebcf, 0x1ebeb, 0x1ec0b, 0x1ec2f, 0x1ec31, 0x1ec43, 0x1ec4f, 0x1ec5b, 0x1ec5d, 0x1ec67, 0x1ec6d, 0x1ec79, 0x1ec97, 0x1ecad, 0x1ecb3, 0x1ecb5, 0x1eccb, 0x1ecd9, 0x1ece5, 0x1ece9, 0x1ecfb, 0x1ed03, 0x1ed11, 0x1ed1d, 0x1ed27, 0x1ed39, 0x1ed5f, 0x1ed6f, 0x1ed81, 0x1ed95, 0x1ed9f, 0x1eda9, 0x1edbb, 0x1edcf, 0x1eddb, 0x1edf3, 0x1ee1b, 0x1ee27, 0x1ee2b, 0x1ee35, 0x1ee53, 0x1ee63, 0x1ee71, 0x1ee99, 0x1eeaf, 0x1eeb7, 0x1eebd, 0x1eedb, 0x1eee7, 0x1eeed, 0x1eef3, 0x1ef0d, 0x1ef23, 0x1ef2f, 0x1ef3d, 0x1ef57, 0x1ef67, 0x1ef73, 0x1ef79, 0x1ef85, 0x1ef97, 0x1efa1, 0x1efab, 0x1efad, 0x1efb3, 0x1efb9, 0x1efc1, 0x1efdf, 0x1efe3, 0x1eff7, 0x1f009, 0x1f02d, 0x1f039, 0x1f04d, 0x1f055, 0x1f05f, 0x1f065, 0x1f069, 0x1f087, 0x1f095, 0x1f0af, 0x1f0bd, 0x1f0d1, 0x1f0f9, 0x1f10b, 0x1f113, 0x1f137, 0x1f13b, 0x1f145, 0x1f157, 0x1f161, 0x1f175, 0x1f189, 0x1f18f, 0x1f1a7, 0x1f1ab, 0x1f1bf, 0x1f1cb, 0x1f1d3, 0x1f1e3, 0x1f207, 0x1f20d, 0x1f215, 0x1f229, 0x1f245, 0x1f249, 0x1f27f, 0x1f283, 0x1f297, 0x1f2a1, 0x1f2ab, 0x1f2b9, 0x1f2d5, 0x1f2df, 0x1f2f1, 0x1f317, 0x1f32d, 0x1f335, 0x1f359, 0x1f369, 0x1f36f, 0x1f381, 0x1f387, 0x1f393, 0x1f395, 0x1f399, 0x1f3a3, 0x1f3af, 0x1f3cf, 0x1f3f9, 0x1f41f, 0x1f423, 0x1f42f, 0x1f43b, 0x1f43d, 0x1f451, 0x1f457, 0x1f46b, 0x1f489, 0x1f48f, 0x1f49d, 0x1f4a1, 0x1f4c1, 0x1f4d3, 0x1f4e9, 0x1f4f1, 0x1f4fb, 0x1f511, 0x1f51b, 0x1f51d, 0x1f527, 0x1f539, 0x1f553, 0x1f565, 0x1f56f, 0x1f571, 0x1f58b, 0x1f5c5, 0x1f5d7, 0x1f5ff, 0x1f60f, 0x1f621, 0x1f627, 0x1f62b, 0x1f635, 0x1f639, 0x1f655, 0x1f687, 0x1f693, 0x1f69f, 0x1f6a5, 0x1f6c5, 0x1f6dd, 0x1f6eb, 0x1f6f3, 0x1f6f9, 0x1f707, 0x1f715, 0x1f725, 0x1f743, 0x1f74f, 0x1f751, 0x1f767, 0x1f76b, 0x1f775, 0x1f783, 0x1f791, 0x1f7b3, 0x1f7b5, 0x1f7bf, 0x1f7cd, 0x1f7e9, 0x1f7ef, 0x1f7fb, 0x1f801, 0x1f825, 0x1f83d, 0x1f849, 0x1f857, 0x1f873, 0x1f8ad, 0x1f8bf, 0x1f8cb, 0x1f8d9, 0x1f8e3, 0x1f8f1, 0x1f905, 0x1f939, 0x1f93f, 0x1f94d, 0x1f953, 0x1f971, 0x1f977, 0x1f97b, 0x1f9bb, 0x1f9cf, 0x1f9d1, 0x1f9dd, 0x1f9e7, 0x1f9f5, 0x1fa17, 0x1fa21, 0x1fa27, 0x1fa3f, 0x1fa41, 0x1fa4b, 0x1fa59, 0x1fa7d, 0x1fa8b, 0x1fa93, 0x1fa95, 0x1faa5, 0x1fab1, 0x1fadb, 0x1fae7, 0x1faeb, 0x1fb01, 0x1fb1f, 0x1fb49, 0x1fb4f, 0x1fb57, 0x1fb5b, 0x1fb6d, 0x1fb7f, 0x1fb83, 0x1fb85, 0x1fb97, 0x1fb9d, 0x1fba7, 0x1fbab, 0x1fbc7, 0x1fbcb, 0x1fbcd, 0x1fbdf, 0x1fbe9, 0x1fbf1, 0x1fc0f, 0x1fc11, 0x1fc1b, 0x1fc2d, 0x1fc47, 0x1fc55, 0x1fc59, 0x1fc63, 0x1fc71, 0x1fc77, 0x1fc7d, 0x1fc8d, 0x1fc9f, 0x1fca9, 0x1fcbd, 0x1fcc9, 0x1fcdb, 0x1fce1, 0x1fce7, 0x1fced, 0x1fd07, 0x1fd0d, 0x1fd23, 0x1fd29, 0x1fd2f, 0x1fd3d, 0x1fd43, 0x1fd4f, 0x1fd57, 0x1fd73, 0x1fd75, 0x1fd85, 0x1fd97, 0x1fd9b, 0x1fdb3, 0x1fdbf, 0x1fdc1, 0x1fdd3, 0x1fde9, 0x1fdfb, 0x1fe15, 0x1fe25, 0x1fe31, 0x1fe37, 0x1fe49, 0x1fe67, 0x1fe79, 0x1fe83, 0x1fe91, 0x1fea1, 0x1fec1, 0x1fee5, 0x1fee9, 0x1fefb, 0x1fefd, 0x1ff05, 0x1ff33, 0x1ff35, 0x1ff39, 0x1ff5f, 0x1ff71, 0x1ff93, 0x1ffa5, 0x1ffb1, 0x1ffeb, 0x1ffed }; const word* irreducible_polynomials[17] = {NULL, _irreducible_polynomials_degree_01, _irreducible_polynomials_degree_02, _irreducible_polynomials_degree_03, _irreducible_polynomials_degree_04, _irreducible_polynomials_degree_05, _irreducible_polynomials_degree_06, _irreducible_polynomials_degree_07, _irreducible_polynomials_degree_08, _irreducible_polynomials_degree_09, _irreducible_polynomials_degree_10, _irreducible_polynomials_degree_11, _irreducible_polynomials_degree_12, _irreducible_polynomials_degree_13, _irreducible_polynomials_degree_14, _irreducible_polynomials_degree_15, _irreducible_polynomials_degree_16}; m4rie-20200125/m4rie/mzed.c0000644000175000017500000006475513206144356012060 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include #include "config.h" #include "mzed.h" #include "strassen.h" #include "mzd_slice.h" #include "conversion.h" mzed_t *mzed_init(const gf2e* k, rci_t m, rci_t n) { mzed_t *A = (mzed_t *)m4ri_mm_malloc(sizeof(mzed_t)); A->finite_field = k; A->w = gf2e_degree_to_w(A->finite_field); A->nrows = m; A->ncols = n; A->x = mzd_init(m, A->w*n); return A; } void mzed_free(mzed_t *A) { mzd_free(A->x); m4ri_mm_free(A); } void mzed_randomize(mzed_t *A) { unsigned int bitmask = (1<finite_field->degree)-1; for(rci_t r=0; rnrows; r++) { for(rci_t c=0; cncols; c++) { mzed_write_elem(A,r,c, random()&bitmask); } } } mzed_t *mzed_add(mzed_t *C, const mzed_t *A, const mzed_t *B) { if (A->nrows != B->nrows || A->ncols != B->ncols || A->finite_field != B->finite_field) { m4ri_die("mzed_add: rows, columns and fields must match.\n"); } if (C == NULL) { C = mzed_init(A->finite_field, A->nrows, A->ncols); } else if (C != A) { if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != A->ncols) { m4ri_die("mzed_add: rows and columns of returned matrix must match.\n"); } } mzd_add(C->x, A->x, B->x); return C; } mzed_t *_mzed_add(mzed_t *C, const mzed_t *A, const mzed_t *B) { mzd_add(C->x, A->x, B->x); return C; } mzed_t *_mzed_mul_init(mzed_t *C, const mzed_t *A, const mzed_t *B, int clear) { if (A->ncols != B->nrows || A->finite_field != B->finite_field) { m4ri_die("mzed_mul: rows, columns and fields must match.\n"); } if (C == NULL) { C = mzed_init(A->finite_field, A->nrows, B->ncols); } else { if (C->finite_field != A->finite_field || C->nrows != A->nrows || C->ncols != B->ncols) { m4ri_die("mzed_mul: rows and columns of returned matrix must match.\n"); } if (clear) mzed_set_ui(C,0); } return C; } mzed_t *mzed_mul(mzed_t *C, const mzed_t *A, const mzed_t *B) { C = _mzed_mul_init(C,A,B, TRUE); _mzed_mul(C, A, B); return C; } mzed_t *mzed_addmul(mzed_t *C, const mzed_t *A, const mzed_t *B) { C = _mzed_mul_init(C,A,B, FALSE); _mzed_addmul(C, A, B); return C; } mzed_t *_mzed_mul(mzed_t *C, const mzed_t *A, const mzed_t *B) { if (A->nrows >= 512 && A->ncols >= 512 && B->ncols >= 512) return _mzed_addmul_karatsuba(C, A, B); const rci_t cutoff = _mzed_strassen_cutoff(C, A, B); return _mzed_mul_strassen(C, A, B, cutoff); } mzed_t *_mzed_addmul(mzed_t *C, const mzed_t *A, const mzed_t *B) { if (A->nrows >= 512 && A->ncols >= 512 && B->ncols >= 512) return _mzed_addmul_karatsuba(C, A, B); const rci_t cutoff = _mzed_strassen_cutoff(C, A, B); return _mzed_addmul_strassen(C, A, B, cutoff); } mzed_t *mzed_mul_naive(mzed_t *C, const mzed_t *A, const mzed_t *B) { C = _mzed_mul_init(C,A,B, TRUE); return _mzed_mul_naive(C, A, B); } mzed_t *mzed_addmul_naive(mzed_t *C, const mzed_t *A, const mzed_t *B) { C = _mzed_mul_init(C,A,B, FALSE); return _mzed_mul_naive(C, A, B); } mzed_t *_mzed_mul_naive(mzed_t *C, const mzed_t *A, const mzed_t *B) { const gf2e* ff = C->finite_field; for (rci_t i=0; inrows; ++i) { for (rci_t j=0; jncols; ++j) { for (rci_t k=0; kncols; ++k) { mzed_add_elem(C, i, j, ff->mul(ff, mzed_read_elem(A,i, k), mzed_read_elem(B, k, j))); } } } return C; } mzed_t *mzed_mul_scalar(mzed_t *C, const word a, const mzed_t *B) { /** * The algorithm proceeds as follows: */ if(C == NULL) C = mzed_init(B->finite_field, B->nrows, B->ncols); const gf2e *ff = B->finite_field; /** * 0) If a direct approach would need less lookups we use that. */ if(ff->degree > 8 || B->nrows*B->ncols < 1<<17) { mzed_copy(C, B); for(rci_t i=0; inrows; i++) mzed_rescale_row(C, i, 0, a); return C; } /** * 1) We generate a lookup table of 16-bit wide entries */ const word mask_16 = (1<<16)-1; const word *mul = (const word*)gf2e_t16_init(B->finite_field, a); /** * 2) We use that lookup table to do 4 lookups per word */ for(rci_t i=0; inrows; i++) { word *c_row = C->x->rows[i]; const word *b_row = B->x->rows[i]; for(wi_t j=0; jx->width-1; j++) { const word tmp = b_row[j]; const word a0 = tmp & mask_16; const word a1 = tmp>>16 & mask_16; const word a2 = tmp>>32 & mask_16; const word a3 = tmp>>48 & mask_16; c_row[j] = mul[a3]<<48 | mul[a2]<<32 | mul[a1]<<16 | mul[a0]; } /* deal with rest */ const word tmp = b_row[B->x->width-1] & B->x->high_bitmask; const word a0 = tmp & mask_16; const word a1 = tmp>>16 & mask_16; const word a2 = tmp>>32 & mask_16; const word a3 = tmp>>48 & mask_16; c_row[C->x->width-1] &= ~B->x->high_bitmask; c_row[C->x->width-1] |= mul[a3]<<48 | mul[a2]<<32 | mul[a1]<<16 | mul[a0]; } gf2e_t16_free((word*)mul); return C; } mzed_t *mzed_copy(mzed_t *A, const mzed_t *B) { if (A == B) return A; if (A == NULL) A = mzed_init(B->finite_field, B->nrows, B->ncols); if (A->finite_field != B->finite_field || A->nrows != B->nrows || A->ncols != B->ncols) { m4ri_die("mzed_copy: target matrix has wrong dimensions or base field."); } mzd_copy(A->x, B->x); return A; } rci_t mzed_echelonize_naive(mzed_t *A, int full) { rci_t start_row,r,c,i,elim_start; word x = 0; rci_t nr = A->nrows; rci_t nc = A->ncols; const gf2e *ff = A->finite_field; start_row = 0; for(c=0; cx, r, start_row); if (full) elim_start = 0; else elim_start = start_row + 1; for(i=elim_start; ix, 0); if(!value) return; for(rci_t i=0; i< MIN(A->ncols,A->nrows); i++) { mzed_write_elem(A, i, i, value); } } void mzed_print(const mzed_t *A) { char formatstr[10]; int width = (A->w/4); if (A->w%4) width += 1; sprintf(formatstr,"%%%dx",width); for (rci_t i=0; i < A->nrows; ++i) { printf("["); for (rci_t j=0; j < A->ncols; j++) { word tmp = mzed_read_elem(A,i,j); printf(formatstr,(int)tmp); if(jncols-1) printf(" "); } printf("]\n"); } } void mzed_add_multiple_of_row(mzed_t *A, rci_t ar, const mzed_t *B, rci_t br, word x, rci_t start_col) { assert(A->ncols == B->ncols && A->finite_field == B->finite_field); assert(start_col < A->ncols); const gf2e *ff = A->finite_field; if (x == 0) { return; } else if(x == 1) { mzed_add_row(A, ar, B, br, start_col); return; } const rci_t start = A->w*start_col; const wi_t startblock = start/m4ri_radix; const word bitmask_end = A->x->high_bitmask; mzd_t *from_x = B->x; mzd_t *to_x = A->x; word *_f = from_x->rows[br]; word *_t = to_x->rows[ar]; wi_t j; register word __f = _f[startblock]>>(start%m4ri_radix); register word __t = _t[startblock]; if(A->w == 2) { switch( (start/2) % 32) { case 0: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 0; __f >>= 2; case 1: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 2; __f >>= 2; case 2: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 4; __f >>= 2; case 3: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 6; __f >>= 2; case 4: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 8; __f >>= 2; case 5: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<10; __f >>= 2; case 6: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<12; __f >>= 2; case 7: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<14; __f >>= 2; case 8: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<16; __f >>= 2; case 9: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<18; __f >>= 2; case 10: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<20; __f >>= 2; case 11: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<22; __f >>= 2; case 12: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<24; __f >>= 2; case 13: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<26; __f >>= 2; case 14: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<28; __f >>= 2; case 15: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<30; __f >>= 2; case 16: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<32; __f >>= 2; case 17: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<34; __f >>= 2; case 18: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<36; __f >>= 2; case 19: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<38; __f >>= 2; case 20: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<40; __f >>= 2; case 21: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<42; __f >>= 2; case 22: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<44; __f >>= 2; case 23: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<46; __f >>= 2; case 24: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<48; __f >>= 2; case 25: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<50; __f >>= 2; case 26: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<52; __f >>= 2; case 27: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<54; __f >>= 2; case 28: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<56; __f >>= 2; case 29: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<58; __f >>= 2; case 30: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<60; __f >>= 2; case 31: __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<62; break; default: m4ri_die("impossible"); } if(to_x->width-startblock == 1) { _t[startblock] &= ~bitmask_end; _t[startblock] ^= __t & bitmask_end; return; } else { _t[startblock] = __t; } for(j=startblock+1; jwidth -1; j++) { __f = _f[j], __t = _t[j]; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 0; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 2; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 4; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 6; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<< 8; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<10; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<12; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<14; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<16; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<18; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<20; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<22; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<24; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<26; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<28; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<30; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<32; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<34; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<36; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<38; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<40; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<42; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<44; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<46; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<48; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<50; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<52; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<54; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<56; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<58; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<60; __f >>= 2; __t ^= ff->mul(ff, x, __f & 0x0000000000000003ULL)<<62; _t[j] = __t; } switch(to_x->ncols % m4ri_radix) { case 0: _t[j] ^= ff->mul(ff, x, (_f[j] & 0xC000000000000000ULL)>>62)<<62; case 62: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x3000000000000000ULL)>>60)<<60; case 60: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0C00000000000000ULL)>>58)<<58; case 58: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0300000000000000ULL)>>56)<<56; case 56: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00C0000000000000ULL)>>54)<<54; case 54: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0030000000000000ULL)>>52)<<52; case 52: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000C000000000000ULL)>>50)<<50; case 50: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0003000000000000ULL)>>48)<<48; case 48: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000C00000000000ULL)>>46)<<46; case 46: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000300000000000ULL)>>44)<<44; case 44: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000C0000000000ULL)>>42)<<42; case 42: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000030000000000ULL)>>40)<<40; case 40: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000C000000000ULL)>>38)<<38; case 38: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000003000000000ULL)>>36)<<36; case 36: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000C00000000ULL)>>34)<<34; case 34: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000300000000ULL)>>32)<<32; case 32: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000C0000000ULL)>>30)<<30; case 30: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000030000000ULL)>>28)<<28; case 28: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000C000000ULL)>>26)<<26; case 26: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000003000000ULL)>>24)<<24; case 24: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000C00000ULL)>>22)<<22; case 22: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000300000ULL)>>20)<<20; case 20: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000000C0000ULL)>>18)<<18; case 18: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000030000ULL)>>16)<<16; case 16: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000000C000ULL)>>14)<<14; case 14: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000003000ULL)>>12)<<12; case 12: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000000C00ULL)>>10)<<10; case 10: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000000300ULL)>> 8)<< 8; case 8: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000000000C0ULL)>> 6)<< 6; case 6: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000000030ULL)>> 4)<< 4; case 4: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000000000CULL)>> 2)<< 2; case 2: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000000003ULL)>> 0)<< 0; }; } else if(A->w == 4) { switch( (start/4) % 16 ) { case 0: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<< 0; __f >>= 4; case 1: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<< 4; __f >>= 4; case 2: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<< 8; __f >>= 4; case 3: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<12; __f >>= 4; case 4: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<16; __f >>= 4; case 5: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<20; __f >>= 4; case 6: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<24; __f >>= 4; case 7: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<28; __f >>= 4; case 8: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<32; __f >>= 4; case 9: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<36; __f >>= 4; case 10: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<40; __f >>= 4; case 11: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<44; __f >>= 4; case 12: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<48; __f >>= 4; case 13: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<52; __f >>= 4; case 14: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<56; __f >>= 4; case 15: __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<60; break; default: m4ri_die("impossible"); } if(to_x->width-startblock == 1) { _t[startblock] &= ~bitmask_end; _t[startblock] ^= __t & bitmask_end; return; } else { _t[startblock] = __t; } for(j=startblock+1; jwidth -1; j++) { __f = _f[j], __t = _t[j]; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<< 0; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<< 4; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<< 8; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<12; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<16; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<20; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<24; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<28; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<32; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<36; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<40; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<44; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<48; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<52; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<56; __f >>= 4; __t ^= ff->mul(ff, x, __f & 0x000000000000000FULL)<<60; _t[j] = __t; } switch(to_x->ncols % m4ri_radix) { case 0: _t[j] ^= ff->mul(ff, x, (_f[j] & 0xF000000000000000ULL)>>60)<<60; case 60: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0F00000000000000ULL)>>56)<<56; case 56: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00F0000000000000ULL)>>52)<<52; case 52: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000F000000000000ULL)>>48)<<48; case 48: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000F00000000000ULL)>>44)<<44; case 44: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000F0000000000ULL)>>40)<<40; case 40: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000F000000000ULL)>>36)<<36; case 36: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000F00000000ULL)>>32)<<32; case 32: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000F0000000ULL)>>28)<<28; case 28: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000F000000ULL)>>24)<<24; case 24: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000F00000ULL)>>20)<<20; case 20: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000000F0000ULL)>>16)<<16; case 16: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000000F000ULL)>>12)<<12; case 12: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000000F00ULL)>> 8)<< 8; case 8: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000000000F0ULL)>> 4)<< 4; case 4: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000000000FULL)>> 0)<< 0; }; } else if (A->w == 8) { register word __t0 ,__t1, __f0, __f1; __f0 = _f[startblock]>>(start%m4ri_radix), __t0 = _t[startblock]; switch( (start/8) % 8 ) { case 0: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<< 0; __f0 >>= 8; case 1: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<< 8; __f0 >>= 8; case 2: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<16; __f0 >>= 8; case 3: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<24; __f0 >>= 8; case 4: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<32; __f0 >>= 8; case 5: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<40; __f0 >>= 8; case 6: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<48; __f0 >>= 8; case 7: __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<56; break; default: m4ri_die("impossible"); } if(to_x->width-startblock == 1) { _t[startblock] &= ~bitmask_end; _t[startblock] ^= __t0 & bitmask_end; return; } else { _t[startblock] = __t0; } for(j=startblock+1; j+2 < to_x->width; j+=2) { __f0 = _f[j], __t0 = _t[j]; __f1 = _f[j+1], __t1 = _t[j+1]; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<< 0; __f0 >>= 8; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<< 0; __f1 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<< 8; __f0 >>= 8; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<< 8; __f1 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<16; __f0 >>= 8; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<<16; __f1 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<24; __f0 >>= 8; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<<24; __f1 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<32; __f0 >>= 8; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<<32; __f1 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<40; __f0 >>= 8; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<<40; __f1 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<48; __f0 >>= 8; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<<48; __f1 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<56; __t1 ^= ff->mul(ff, x, __f1 & 0x00000000000000FFULL)<<56; _t[j+0] = __t0; _t[j+1] = __t1; } for(; j < to_x->width-1; j++) { __f0 = _f[j], __t0 = _t[j]; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<< 0; __f0 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<< 8; __f0 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<16; __f0 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<24; __f0 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<32; __f0 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<40; __f0 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<48; __f0 >>= 8; __t0 ^= ff->mul(ff, x, __f0 & 0x00000000000000FFULL)<<56; _t[j] = __t0; } switch(to_x->ncols % m4ri_radix) { case 0: _t[j] ^= ff->mul(ff, x, (_f[j] & 0xFF00000000000000ULL)>>56)<<56; case 56: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00FF000000000000ULL)>>48)<<48; case 48: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000FF0000000000ULL)>>40)<<40; case 40: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000FF00000000ULL)>>32)<<32; case 32: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000FF000000ULL)>>24)<<24; case 24: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000000000FF0000ULL)>>16)<<16; case 16: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000000FF00ULL)>> 8)<< 8; case 8: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000000000FFULL)>> 0)<< 0; }; } else if (A->w == 16) { mzd_t *from_x = B->x; mzd_t *to_x = A->x; word *_f = from_x->rows[br]; word *_t = to_x->rows[ar]; size_t j; register word __t, __f; __f = _f[startblock]>>(start%m4ri_radix), __t = _t[startblock]; switch( (start/16)%4 ) { case 0: __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<< 0; __f >>= 16; case 1: __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<16; __f >>= 16; case 2: __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<32; __f >>= 16; case 3: __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<48; break; default: m4ri_die("impossible"); } if(to_x->width-startblock == 1) { _t[startblock] &= ~bitmask_end; _t[startblock] ^= __t & bitmask_end; return; } else { _t[startblock] = __t; } for(j=startblock+1; j+4width; j+=4) { __f = _f[j], __t = _t[j]; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<< 0; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<16; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<32; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<48; _t[j] = __t; __f = _f[j+1], __t = _t[j+1]; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<< 0; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<16; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<32; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<48; _t[j+1] = __t; __f = _f[j+2], __t = _t[j+2]; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<< 0; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<16; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<32; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<48; _t[j+2] = __t; __f = _f[j+3], __t = _t[j+3]; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<< 0; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<16; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<32; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<48; _t[j+3] = __t; } for( ; jwidth-1; j++) { __f = _f[j], __t = _t[j]; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<< 0; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<16; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<32; __f >>= 16; __t ^= ff->mul(ff, x, __f & 0x000000000000FFFFULL)<<48; _t[j] = __t; } switch(to_x->ncols % m4ri_radix) { case 0: _t[j] ^= ff->mul(ff, x, (_f[j] & 0xFFFF000000000000ULL)>>48)<<48; case 48: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x0000FFFF00000000ULL)>>32)<<32; case 32: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x00000000FFFF0000ULL)>>16)<<16; case 16: _t[j] ^= ff->mul(ff, x, (_f[j] & 0x000000000000FFFFULL)>> 0)<< 0; }; } else { for(rci_t j=start_col; jncols; j++) { mzed_add_elem(A, ar, j, ff->mul(ff, x, mzed_read_elem(B, br, j))); } } } m4rie-20200125/m4rie/newton_john.c0000644000175000017500000004445013206144356013437 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "config.h" #include #include #include #include #include "newton_john.h" #include "trsm.h" #include "ple.h" #include "conversion.h" njt_mzed_t *njt_mzed_init(const gf2e *ff, const rci_t ncols) { njt_mzed_t *T = m4ri_mm_malloc(sizeof(njt_mzed_t)); T->L = (rci_t*)m4ri_mm_calloc(__M4RI_TWOPOW(ff->degree), sizeof(rci_t)); T->T = mzed_init(ff, __M4RI_TWOPOW(ff->degree), ncols); T->M = mzed_init(ff, ff->degree, ncols); return T; } void njt_mzed_free(njt_mzed_t *T) { mzed_free(T->M); mzed_free(T->T); m4ri_mm_free(T->L); m4ri_mm_free(T); } /** * Compute C[rc,i] = C[rc,i] + T0[r0,i] + ... + T3[r3,i] for 0 <= i < ncols * * \param C Matrix * \apram rc Row index * \param T0 Matrix * \param r0 Row index * \param T1 Matrix * \param r1 Row index * \param T2 Matrix * \param r2 Row index * \param T3 Matrix * \param r3 Row index */ static inline void mzed_combine4(mzed_t *C, rci_t rc, mzed_t *T0, rci_t r0, mzed_t *T1, rci_t r1, mzed_t *T2, rci_t r2, mzed_t *T3, rci_t r3) { const word *t[4] = {T0->x->rows[r0], T1->x->rows[r1], T2->x->rows[r2], T3->x->rows[r3]}; _mzd_combine_4(C->x->rows[rc], t, C->x->width); } /** * Compute C[rc,i] = C[rc,i] + T0[r0,i] + ... + T7[r7,i] for 0 <= i < ncols * * \param C Matrix * \apram rc Row index * \param T0 Matrix * \param r0 Row index * \param T1 Matrix * \param r1 Row index * \param T2 Matrix * \param r2 Row index * \param T3 Matrix * \param r3 Row index * \param T4 Matrix * \param r4 Row index * \param T5 Matrix * \param r5 Row index * \param T6 Matrix * \param r6 Row index * \param T7 Matrix * \param r7 Row index */ static inline void mzed_combine8(mzed_t *C, rci_t rc, mzed_t *T0, rci_t r0, mzed_t *T1, rci_t r1, mzed_t *T2, rci_t r2, mzed_t *T3, rci_t r3, mzed_t *T4, rci_t r4, mzed_t *T5, rci_t r5, mzed_t *T6, rci_t r6, mzed_t *T7, rci_t r7) { const word *t[8] = {T0->x->rows[r0], T1->x->rows[r1], T2->x->rows[r2], T3->x->rows[r3], T4->x->rows[r4], T5->x->rows[r5], T6->x->rows[r6], T7->x->rows[r7]}; _mzd_combine_8(C->x->rows[rc], t, C->x->width); } /** * \brief Perform Gaussian reduction to reduced row echelon form on a * submatrix. * * The submatrix has dimension at most k starting at r x c of A. Checks * for pivot rows up to row endrow (exclusive). Terminates as soon as * finding a pivot column fails. * * \param A Matrix. * \param r First row. * \param c First column. * \param k Maximal dimension of identity matrix to produce. * \param end_row Maximal row index (exclusive) for rows to consider * for inclusion. */ rci_t _mzed_gauss_submatrix_full(mzed_t *A, const rci_t r, const rci_t c, const rci_t end_row, int k) { rci_t i,j,l; rci_t start_row = r; int found; word tmp; const gf2e *ff = A->finite_field; for (j=c; jx, i, start_row); /* clear above */ for (l=r; l A->finite_field->degree); if (T == NULL) T = njt_mzed_init(A->finite_field, A->ncols); mzd_set_ui(T->M->x,0); #if 0 for(rci_t i=0; i< T->T->nrows; i+=2) { T->L[i] = i; mzed_add_multiple_of_row(T->T, i, A, r, A->finite_field->mul[i], c); T->L[i+1] = i+1; mzed_copy_row(T->T, i+1, T->T, i); mzed_add_row(T->T, i+1, A, r, c); } #else const int degree = A->finite_field->degree; const wi_t homeblock = A->w*c / m4ri_radix; const wi_t wide = T->M->x->width - homeblock; const word bitmask_end = T->M->x->high_bitmask; wi_t j; for(int i=0; iM, i, A, r, 1ULL<T->nrows; ++i) { word *ti = T->T->x->rows[i] + homeblock; word *ti1 = T->T->x->rows[i-1] + homeblock; const rci_t rowneeded = m4ri_codebook[degree]->inc[i - 1]; const int id = m4ri_codebook[degree]->ord[i]; T->L[id] = i; word *m = T->M->x->rows[rowneeded] + homeblock; /* there might still be stuff left over from the previous table creation, here we assume that this is at most 8 * m4ri_radix bits away. */ switch (homeblock) { case 0: break; default: case 8: *(ti-7) = 0; case 7: *(ti-6) = 0; case 6: *(ti-5) = 0; case 5: *(ti-4) = 0; case 4: *(ti-3) = 0; case 3: *(ti-2) = 0; case 2: *(ti-2) = 0; case 1: *(ti-1) = 0; } for(j = 0; j + 8 <= wide - 1; j += 8) { *ti++ = *m++ ^ *ti1++; *ti++ = *m++ ^ *ti1++; *ti++ = *m++ ^ *ti1++; *ti++ = *m++ ^ *ti1++; *ti++ = *m++ ^ *ti1++; *ti++ = *m++ ^ *ti1++; *ti++ = *m++ ^ *ti1++; *ti++ = *m++ ^ *ti1++; } switch(wide - j) { case 8: *ti++ = *m++ ^ *ti1++; case 7: *ti++ = *m++ ^ *ti1++; case 6: *ti++ = *m++ ^ *ti1++; case 5: *ti++ = *m++ ^ *ti1++; case 4: *ti++ = *m++ ^ *ti1++; case 3: *ti++ = *m++ ^ *ti1++; case 2: *ti++ = *m++ ^ *ti1++; case 1: *ti++ = (*m++ ^ *ti1++) & bitmask_end; } } #endif return T; } rci_t mzed_echelonize_newton_john(mzed_t *A, int full) { const gf2e* ff = A->finite_field; rci_t r,c; rci_t k = ff->degree; /* cf. mzd_echelonize_m4ri */ rci_t kk = (rci_t)m4ri_opt_k(A->x->nrows, A->x->ncols, 0); if (kk>=7) kk = 7; if ( (6*(1<ncols / 8.0) > __M4RI_CPU_L2_CACHE / 2.0 ) kk -= 1; kk = (6*kk)/k; /* enforcing bounds */ if (kk == 0) kk = 1; else if (kk > 6) kk = 6; rci_t kbar = 0; njt_mzed_t *T0 = njt_mzed_init(ff, A->ncols); njt_mzed_t *T1 = njt_mzed_init(ff, A->ncols); njt_mzed_t *T2 = njt_mzed_init(ff, A->ncols); njt_mzed_t *T3 = njt_mzed_init(ff, A->ncols); njt_mzed_t *T4 = njt_mzed_init(ff, A->ncols); njt_mzed_t *T5 = njt_mzed_init(ff, A->ncols); r = 0; c = 0; while(c < A->ncols) { if(c+kk > A->ncols) kk = A->ncols - c; /** * \todo we don't really compute the upper triangular form yet, * we need to implement _mzed_gauss_submatrix() and a better * table creation for that. */ kbar = _mzed_gauss_submatrix_full(A, r, c, A->nrows, kk); if (kbar == 6) { mzed_make_table(T0, A, r, c); mzed_make_table(T1, A, r+1, c+1); mzed_make_table(T2, A, r+2, c+2); mzed_make_table(T3, A, r+3, c+3); mzed_make_table(T4, A, r+4, c+4); mzed_make_table(T5, A, r+5, c+5); if(kbar == kk) mzed_process_rows6( A, r+6, A->nrows, c, T0, T1, T2, T3, T4, T5); if(full) mzed_process_rows6( A, 0, r, c, T0, T1, T2, T3, T4, T5); } else if(kbar == 5) { mzed_make_table(T0, A, r, c); mzed_make_table(T1, A, r+1, c+1); mzed_make_table(T2, A, r+2, c+2); mzed_make_table(T3, A, r+3, c+3); mzed_make_table(T4, A, r+4, c+4); if(kbar == kk) mzed_process_rows5( A, r+5, A->nrows, c, T0, T1, T2, T3, T4); if(full) mzed_process_rows5( A, 0, r, c, T0, T1, T2, T3, T4); } else if(kbar == 4) { mzed_make_table(T0, A, r, c); mzed_make_table(T1, A, r+1, c+1); mzed_make_table(T2, A, r+2, c+2); mzed_make_table(T3, A, r+3, c+3); if(kbar == kk) mzed_process_rows4( A, r+4, A->nrows, c, T0, T1, T2, T3); if(full) mzed_process_rows4( A, 0, r, c, T0, T1, T2, T3); } else if(kbar == 3) { mzed_make_table(T0, A, r, c ); mzed_make_table(T1, A, r+1, c+1); mzed_make_table(T2, A, r+2, c+2); if(kbar == kk) mzed_process_rows3( A, r+3, A->nrows, c, T0, T1, T2); if(full) mzed_process_rows3( A, 0, r, c, T0, T1, T2); } else if(kbar == 2) { mzed_make_table(T0, A, r, c ); mzed_make_table(T1, A, r+1, c+1); if(kbar == kk) mzed_process_rows2( A, r+2, A->nrows, c, T0, T1); if(full) mzed_process_rows2( A, 0, r, c, T0, T1); } else if (kbar == 1) { mzed_make_table(T0, A, r, c); if(kbar == kk) mzed_process_rows( A, r+1, A->nrows, c, T0); if(full) mzed_process_rows( A, 0, r, c, T0); } else { c++; } r += kbar; c += kbar; } njt_mzed_free(T0); njt_mzed_free(T1); njt_mzed_free(T2); njt_mzed_free(T3); njt_mzed_free(T4); njt_mzed_free(T5); return r; } rci_t mzed_ple_newton_john(mzed_t *A, mzp_t *P, mzp_t *Q) { rci_t col_pos = 0; rci_t row_pos = 0; word tmp = 0; const gf2e *ff = A->finite_field; rci_t i,j; int found = 0; njt_mzed_t *T0 = njt_mzed_init(A->finite_field, A->ncols); while (row_pos < A->nrows && col_pos < A->ncols) { found = 0; for(j=col_pos; jncols; j++) { for(i=row_pos; inrows; i++) { if( (tmp = mzed_read_elem(A, i,j)) != 0) { found = 1; break; } } if (found) break; } if (found) { P->values[row_pos] = i; Q->values[row_pos] = j; mzed_row_swap(A, row_pos, i); if (j+1 < A->ncols) { mzed_rescale_row(A, row_pos, j+1, gf2e_inv(ff, tmp)); mzed_make_table(T0, A, row_pos, j+1); mzed_process_rows(A, row_pos+1, A->nrows, j, T0); } row_pos++; col_pos = j + 1; } else { break; } } for (rci_t i = row_pos; i < A->nrows; ++i) P->values[i] = i; for (rci_t i = row_pos; i < A->ncols; ++i) Q->values[i] = i; for (rci_t i=0; i < row_pos; i++) { mzed_col_swap_in_rows(A, i, Q->values[i], i, A->nrows); } njt_mzed_free(T0); return row_pos; } mzed_t *_mzed_mul_newton_john0(mzed_t *C, const mzed_t *A, const mzed_t *B) { njt_mzed_t *T0 = njt_mzed_init(B->finite_field, B->ncols); for(rci_t i=0; i < A->ncols; i++) { mzed_make_table(T0, B, i, 0); for(rci_t j=0; jnrows; j++) mzd_combine(C->x, j, 0, C->x, j, 0, T0->T->x, T0->L[mzed_read_elem(A, j, i)], 0); } njt_mzed_free(T0); return C; } mzed_t *_mzed_mul_newton_john(mzed_t *C, const mzed_t *A, const mzed_t *B) { if (A->finite_field->degree > A->nrows) return _mzed_mul_naive(C, A, B); njt_mzed_t *T0 = njt_mzed_init(B->finite_field, B->ncols); njt_mzed_t *T1 = njt_mzed_init(B->finite_field, B->ncols); njt_mzed_t *T2 = njt_mzed_init(B->finite_field, B->ncols); njt_mzed_t *T3 = njt_mzed_init(B->finite_field, B->ncols); njt_mzed_t *T4 = njt_mzed_init(B->finite_field, B->ncols); njt_mzed_t *T5 = njt_mzed_init(B->finite_field, B->ncols); njt_mzed_t *T6 = njt_mzed_init(B->finite_field, B->ncols); njt_mzed_t *T7 = njt_mzed_init(B->finite_field, B->ncols); const rci_t kk = 8; const rci_t end = A->ncols/kk; rci_t blocksize = 1ULL<<30; if (A->nrows >= A->w*__M4RI_MUL_BLOCKSIZE) blocksize = __M4RI_MUL_BLOCKSIZE/A->w; rci_t giantstep, babystep; for (giantstep=0; giantstep + blocksize <= A->nrows; giantstep += blocksize) { for(rci_t i=0; i < end; i++) { mzed_make_table(T0, B, kk*i , 0); mzed_make_table(T1, B, kk*i+1, 0); mzed_make_table(T2, B, kk*i+2, 0); mzed_make_table(T3, B, kk*i+3, 0); mzed_make_table(T4, B, kk*i+4, 0); mzed_make_table(T5, B, kk*i+5, 0); mzed_make_table(T6, B, kk*i+6, 0); mzed_make_table(T7, B, kk*i+7, 0); for(babystep = 0; babystep < blocksize; babystep++) { const rci_t j = giantstep + babystep; const rci_t x0 = T0->L[mzed_read_elem(A, j, kk* i)]; const rci_t x1 = T1->L[mzed_read_elem(A, j, kk*i+1)]; const rci_t x2 = T2->L[mzed_read_elem(A, j, kk*i+2)]; const rci_t x3 = T3->L[mzed_read_elem(A, j, kk*i+3)]; const rci_t x4 = T4->L[mzed_read_elem(A, j, kk*i+4)]; const rci_t x5 = T5->L[mzed_read_elem(A, j, kk*i+5)]; const rci_t x6 = T6->L[mzed_read_elem(A, j, kk*i+6)]; const rci_t x7 = T7->L[mzed_read_elem(A, j, kk*i+7)]; mzed_combine8(C, j, T0->T, x0, T1->T, x1, T2->T, x2, T3->T, x3, T4->T, x4, T5->T, x5, T6->T, x6, T7->T, x7); } } } /* last giant step */ for(rci_t i=0; i < end; i++) { mzed_make_table(T0, B, kk*i , 0); mzed_make_table(T1, B, kk*i+1, 0); mzed_make_table(T2, B, kk*i+2, 0); mzed_make_table(T3, B, kk*i+3, 0); mzed_make_table(T4, B, kk*i+4, 0); mzed_make_table(T5, B, kk*i+5, 0); mzed_make_table(T6, B, kk*i+6, 0); mzed_make_table(T7, B, kk*i+7, 0); for(babystep = 0; babystep < A->nrows - giantstep; babystep++) { const rci_t j = giantstep + babystep; const rci_t x0 = T0->L[mzed_read_elem(A, j, kk* i)]; const rci_t x1 = T1->L[mzed_read_elem(A, j, kk*i+1)]; const rci_t x2 = T2->L[mzed_read_elem(A, j, kk*i+2)]; const rci_t x3 = T3->L[mzed_read_elem(A, j, kk*i+3)]; const rci_t x4 = T4->L[mzed_read_elem(A, j, kk*i+4)]; const rci_t x5 = T5->L[mzed_read_elem(A, j, kk*i+5)]; const rci_t x6 = T6->L[mzed_read_elem(A, j, kk*i+6)]; const rci_t x7 = T7->L[mzed_read_elem(A, j, kk*i+7)]; mzed_combine8(C, j, T0->T, x0, T1->T, x1, T2->T, x2, T3->T, x3, T4->T, x4, T5->T, x5, T6->T, x6, T7->T, x7); } } if (A->ncols%kk) { for(rci_t i=kk*end; i < A->ncols; i++) { mzed_make_table(T0, B, i, 0); for(rci_t j=0; jnrows; j++) mzd_combine(C->x, j, 0, C->x, j, 0, T0->T->x, T0->L[mzed_read_elem(A, j, i)], 0); } } njt_mzed_free(T0); njt_mzed_free(T1); njt_mzed_free(T2); njt_mzed_free(T3); njt_mzed_free(T4); njt_mzed_free(T5); njt_mzed_free(T6); njt_mzed_free(T7); return C; } mzed_t *mzed_mul_newton_john(mzed_t *C, const mzed_t *A, const mzed_t *B) { C = _mzed_mul_init(C,A,B, TRUE); return _mzed_mul_newton_john(C, A, B); } mzed_t *mzed_addmul_newton_john(mzed_t *C, const mzed_t *A, const mzed_t *B) { C = _mzed_mul_init(C,A,B, FALSE); return _mzed_mul_newton_john(C, A, B); } mzed_t *mzed_invert_newton_john(mzed_t *B, const mzed_t *A) { assert(A->nrows == A->ncols); mzed_t *I = mzed_init(A->finite_field, A->nrows, A->ncols); mzed_set_ui(I, 1); mzed_t *T = mzed_concat(NULL, A, I); mzed_free(I); rci_t r = mzed_echelonize_newton_john(T, 1); if (r != A->nrows) m4ri_die("mzed_invert_newton_john: input matrix does not have full rank."); B = mzed_submatrix(B, T, 0, A->ncols, A->nrows, T->ncols); mzed_free(T); return B; } void mzed_trsm_lower_left_newton_john(const mzed_t *L, mzed_t *B) { assert(L->finite_field == B->finite_field); assert(L->nrows == L->ncols); assert(B->nrows == L->ncols); const gf2e *ff = L->finite_field; if (__M4RI_TWOPOW(ff->degree) >= L->nrows) { mzed_trsm_lower_left_naive(L, B); return; } njt_mzed_t *T0 = njt_mzed_init(B->finite_field, B->ncols); for(rci_t i=0; inrows; i++) { mzed_rescale_row(B, i, 0, gf2e_inv(ff, mzed_read_elem(L, i, i))); mzed_make_table(T0, B, i, 0); for(rci_t j=i+1; jnrows; j++) mzd_combine(B->x, j, 0, B->x, j, 0, T0->T->x, T0->L[mzed_read_elem(L, j, i)], 0); } njt_mzed_free(T0); } void mzed_trsm_upper_left_newton_john(const mzed_t *U, mzed_t *B) { assert(U->finite_field == B->finite_field); assert(U->nrows == U->ncols); assert(B->nrows == U->ncols); const gf2e *ff = U->finite_field; if ( (__M4RI_TWOPOW(ff->degree) >= U->nrows) ) { mzed_trsm_upper_left_naive(U, B); return; } njt_mzed_t *T0 = njt_mzed_init(B->finite_field, B->ncols); for(int i=B->nrows-1; i>=0; i--) { mzed_rescale_row(B, i, 0, gf2e_inv(ff, mzed_read_elem(U, i, i))); mzed_make_table(T0, B, i, 0); for(rci_t j=0; jx, j, 0, B->x, j, 0, T0->T->x, T0->L[mzed_read_elem(U, j, i)], 0); } njt_mzed_free(T0); } void mzd_slice_trsm_lower_left_newton_john(const mzd_slice_t *L, mzd_slice_t *B) { assert(L->finite_field == B->finite_field); assert(L->nrows == L->ncols); assert(B->nrows == L->ncols); const gf2e *ff = L->finite_field; if (__M4RI_TWOPOW(ff->degree) >= L->nrows) { mzd_slice_trsm_lower_left_naive(L, B); return; } mzed_t *Be = mzed_cling(NULL, B); njt_mzed_t *T0 = njt_mzed_init(B->finite_field, B->ncols); for(rci_t i=0; inrows; i++) { mzed_rescale_row(Be, i, 0, gf2e_inv(ff, mzd_slice_read_elem(L, i, i))); mzed_make_table(T0, Be, i, 0); for(rci_t j=i+1; jnrows; j++) mzd_combine(Be->x, j, 0, Be->x, j, 0, T0->T->x, T0->L[mzd_slice_read_elem(L, j, i)], 0); } mzed_slice(B, Be); mzed_free(Be); njt_mzed_free(T0); } void mzd_slice_trsm_upper_left_newton_john(const mzd_slice_t *U, mzd_slice_t *B) { assert(U->finite_field == B->finite_field); assert(U->nrows == U->ncols); assert(B->nrows == U->ncols); const gf2e *ff = U->finite_field; if ( (__M4RI_TWOPOW(ff->degree) >= U->nrows)) { mzd_slice_trsm_upper_left_naive(U, B); return; } mzed_t *Be = mzed_cling(NULL, B); njt_mzed_t *T0 = njt_mzed_init(Be->finite_field, Be->ncols); for(int i=B->nrows-1; i>=0; i--) { mzed_rescale_row(Be, i, 0, gf2e_inv(ff, mzd_slice_read_elem(U, i, i))); mzed_make_table(T0, Be, i, 0); for(rci_t j=0; jx, j, 0, Be->x, j, 0, T0->T->x, T0->L[mzd_slice_read_elem(U, j, i)], 0); } mzed_slice(B, Be); mzed_free(Be); njt_mzed_free(T0); } m4rie-20200125/m4rie/echelonform.c0000644000175000017500000000677313206144356013416 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "echelonform.h" #include "newton_john.h" #include "permutation.h" #include "trsm.h" #include "ple.h" rci_t mzed_echelonize(mzed_t *A, int full) { if (A->finite_field->degree > A->nrows) { return mzed_echelonize_naive(A, full); } else if ((A->nrows * A->ncols * A->w <= 2*__M4RIE_PLE_CUTOFF)) { return mzed_echelonize_newton_john(A, full); } else { return mzed_echelonize_ple(A, full); } } rci_t mzd_slice_echelonize_ple(mzd_slice_t *A, int full) { mzp_t *P = mzp_init(A->nrows); mzp_t *Q = mzp_init(A->ncols); rci_t r; if(full) { r = mzd_slice_pluq(A, P, Q); mzd_slice_t *U = mzd_slice_init_window(A, 0, 0, r, r); const rci_t r_radix = m4ri_radix*(r/m4ri_radix); if(r_radix == r && r!=A->ncols) { mzd_slice_t *B = mzd_slice_init_window(A, 0, r, r, A->ncols); for(rci_t i = 0; i < r; ++i) mzd_slice_write_elem(U, i, i, 1); mzd_slice_trsm_upper_left(U, B); mzd_slice_free_window(B); } else if (r_radix != r && r!=A->ncols) { assert(r_radix < r); if(A->ncols > r_radix+m4ri_radix) { mzd_slice_t *B0 = mzd_slice_submatrix(NULL, A, 0, r_radix, r, r_radix+m4ri_radix); mzd_slice_t *B0w = mzd_slice_init_window( A, 0, r_radix, r, r_radix+m4ri_radix); mzd_slice_t *B1 = mzd_slice_init_window(A, 0, r_radix+m4ri_radix, r, A->ncols); for(rci_t i = 0; i < r; ++i) mzd_slice_write_elem(U, i, i, 1); mzd_slice_trsm_upper_left(U, B0); mzd_slice_trsm_upper_left(U, B1); mzd_slice_copy(B0w, B0); mzd_slice_free(B0); mzd_slice_free_window(B0w); mzd_slice_free_window(B1); } else { mzd_slice_t *B = mzd_slice_submatrix(NULL, A, 0, r_radix, r, A->ncols); mzd_slice_t *Bw = mzd_slice_init_window(A, 0, r_radix, r, A->ncols); for(rci_t i = 0; i < r; ++i) mzd_slice_write_elem(U, i, i, 1); mzd_slice_trsm_upper_left(U, B); mzd_slice_copy(Bw, B); mzd_slice_free_window(Bw); mzd_slice_free(B); } } mzd_slice_set_ui(U, 1); mzd_slice_free_window(U); if(r) { mzd_slice_t *A0 = mzd_slice_init_window(A, 0, 0, r, A->ncols); mzd_slice_apply_p_right(A0, Q); mzd_slice_free_window(A0); } } else { r = mzd_slice_ple(A, P, Q); for(rci_t i = 0; i < r; ++i) { for(int e=0; e < A->depth; e++) { for(rci_t j = 0; j <= i; j++) { int const length = MIN(m4ri_radix, i - j + 1); mzd_clear_bits(A->x[e], i, j, length); } } mzd_slice_write_elem(A, i, Q->values[i], 1); } } if(r != A->nrows) { mzd_slice_t *R = mzd_slice_init_window(A, r, 0, A->nrows, A->ncols); mzd_slice_set_ui(R, 0); mzd_slice_free_window(R); } mzp_free(P); mzp_free(Q); return r; } m4rie-20200125/m4rie/strassen.c0000644000175000017500000003065713206144356012755 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "config.h" #include #include #include #include "mzed.h" #include "newton_john.h" #include "mzd_slice.h" #include "strassen.h" #define CLOSER(a,b,target) (abs((long)a-(long)target)nrows| C->ncols) == 0) return C; rci_t m = A->nrows; rci_t k = A->ncols; rci_t n = B->ncols; /* handle case first, where the input matrices are too small already */ if (CLOSER(m, m/2, cutoff) || CLOSER(k, k/2, cutoff) || CLOSER(n, n/2, cutoff)) { /* we copy the matrix first since it is only constant memory overhead and improves data locality, if you remove it make sure there are no speed regressions */ /* C = _mzd_mul_m4rm(C, A, B, 0, TRUE); */ mzed_t *Cbar = mzed_init(C->finite_field, C->nrows, C->ncols); _mzed_mul_newton_john(Cbar, A, B); mzed_copy(C, Cbar); mzed_free(Cbar); return C; } rci_t mmm = m/2; rci_t kkk = k/2; rci_t nnn = n/2; mmm = (mmm - mmm%(m4ri_radix/A->w)); kkk = (kkk - kkk%(m4ri_radix/A->w)); nnn = (nnn - nnn%(m4ri_radix/A->w)); /* |A | |B | |C | * Compute | | x | | = | | */ mzed_t *A11 = mzed_init_window(A, 0, 0, mmm, kkk); mzed_t *A12 = mzed_init_window(A, 0, kkk, mmm, 2*kkk); mzed_t *A21 = mzed_init_window(A, mmm, 0, 2*mmm, kkk); mzed_t *A22 = mzed_init_window(A, mmm, kkk, 2*mmm, 2*kkk); mzed_t *B11 = mzed_init_window(B, 0, 0, kkk, nnn); mzed_t *B12 = mzed_init_window(B, 0, nnn, kkk, 2*nnn); mzed_t *B21 = mzed_init_window(B, kkk, 0, 2*kkk, nnn); mzed_t *B22 = mzed_init_window(B, kkk, nnn, 2*kkk, 2*nnn); mzed_t *C11 = mzed_init_window(C, 0, 0, mmm, nnn); mzed_t *C12 = mzed_init_window(C, 0, nnn, mmm, 2*nnn); mzed_t *C21 = mzed_init_window(C, mmm, 0, 2*mmm, nnn); mzed_t *C22 = mzed_init_window(C, mmm, nnn, 2*mmm, 2*nnn); /** * \note See Marco Bodrato; "A Strassen-like Matrix Multiplication * Suited for Squaring and Highest Power Computation"; * http://bodrato.it/papres/#CIVV2008 for reference on the used * sequence of operations. */ /* change this to mzd_init(mmm, MAX(nnn,kkk)) to fix the todo below */ mzed_t *Wmk = mzed_init(A->finite_field, mmm, kkk); mzed_t *Wkn = mzed_init(A->finite_field, kkk, nnn); _mzed_add(Wkn, B22, B12); /* Wkn = B22 + B12 */ _mzed_add(Wmk, A22, A12); /* Wmk = A22 + A12 */ _mzed_mul_strassen(C21, Wmk, Wkn, cutoff); /* C21 = Wmk * Wkn */ _mzed_add(Wmk, A22, A21); /* Wmk = A22 - A21 */ _mzed_add(Wkn, B22, B21); /* Wkn = B22 - B21 */ _mzed_mul_strassen(C22, Wmk, Wkn, cutoff); /* C22 = Wmk * Wkn */ _mzed_add(Wkn, Wkn, B12); /* Wkn = Wkn + B12 */ _mzed_add(Wmk, Wmk, A12); /* Wmk = Wmk + A12 */ _mzed_mul_strassen(C11, Wmk, Wkn, cutoff); /* C11 = Wmk * Wkn */ _mzed_add(Wmk, Wmk, A11); /* Wmk = Wmk - A11 */ _mzed_mul_strassen(C12, Wmk, B12, cutoff); /* C12 = Wmk * B12 */ _mzed_add(C12, C12, C22); /* C12 = C12 + C22 */ mzed_free(Wmk); Wmk = mzed_mul_strassen(NULL, A12, B21, cutoff);/*Wmk = A12 * B21 */ _mzed_add(C11, C11, Wmk); /* C11 = C11 + Wmk */ _mzed_add(C12, C11, C12); /* C12 = C11 - C12 */ _mzed_add(C11, C21, C11); /* C11 = C21 - C11 */ _mzed_add(Wkn, Wkn, B11); /* Wkn = Wkn - B11 */ _mzed_mul_strassen(C21, A21, Wkn, cutoff); /* C21 = A21 * Wkn */ mzed_free(Wkn); _mzed_add(C21, C11, C21); /* C21 = C11 - C21 */ _mzed_add(C22, C22, C11); /* C22 = C22 + C11 */ _mzed_mul_strassen(C11, A11, B11, cutoff); /* C11 = A11 * B11 */ _mzed_add(C11, C11, Wmk); /* C11 = C11 + Wmk */ /* clean up */ mzed_free_window(A11); mzed_free_window(A12); mzed_free_window(A21); mzed_free_window(A22); mzed_free_window(B11); mzed_free_window(B12); mzed_free_window(B21); mzed_free_window(B22); mzed_free_window(C11); mzed_free_window(C12); mzed_free_window(C21); mzed_free_window(C22); mzed_free(Wmk); /* deal with rest */ nnn*=2; if (n > nnn) { /* |AA| | B| | C| * Compute |AA| x | B| = | C| */ mzed_t *B_last_col = mzed_init_window(B, 0, nnn, k, n); mzed_t *C_last_col = mzed_init_window(C, 0, nnn, m, n); mzed_set_ui(C_last_col, 0); _mzed_mul_newton_john(C_last_col, A, B_last_col); mzed_free_window(B_last_col); mzed_free_window(C_last_col); } mmm*=2; if (m > mmm) { /* | | |B | | | * Compute |AA| x |B | = |C | */ mzed_t *A_last_row = mzed_init_window(A, mmm, 0, m, k); mzed_t *B_first_col= mzed_init_window(B, 0, 0, k, nnn); mzed_t *C_last_row = mzed_init_window(C, mmm, 0, m, nnn); mzed_set_ui(C_last_row, 0); _mzed_mul_newton_john(C_last_row, A_last_row, B_first_col); mzed_free_window(A_last_row); mzed_free_window(B_first_col); mzed_free_window(C_last_row); } kkk*=2; if (k > kkk) { /* Add to | | | B| |C | * result |A | x | | = | | */ mzed_t *A_last_col = mzed_init_window(A, 0, kkk, mmm, k); mzed_t *B_last_row = mzed_init_window(B, kkk, 0, k, nnn); mzed_t *C_bulk = mzed_init_window(C, 0, 0, mmm, nnn); _mzed_mul_newton_john(C_bulk, A_last_col, B_last_row); mzed_free_window(A_last_col); mzed_free_window(B_last_row); mzed_free_window(C_bulk); } return C; } mzed_t *_mzed_addmul_strassen(mzed_t *C, const mzed_t *A, const mzed_t *B, int cutoff) { if((C->nrows| C->ncols) == 0) return C; rci_t m = A->nrows; rci_t k = A->ncols; rci_t n = B->ncols; /* handle case first, where the input matrices are too small already */ if (CLOSER(m, m/2, cutoff) || CLOSER(k, k/2, cutoff) || CLOSER(n, n/2, cutoff)) { /* we copy the matrix first since it is only constant memory overhead and improves data locality, if you remove it make sure there are no speed regressions */ /* C = _mzd_mul_m4rm(C, A, B, 0, TRUE); */ mzed_t *Cbar = mzed_copy(NULL, C); _mzed_mul_newton_john(Cbar, A, B); mzed_copy(C, Cbar); mzed_free(Cbar); return C; } rci_t mmm = m/2; rci_t kkk = k/2; rci_t nnn = n/2; mmm = (mmm - mmm%(m4ri_radix/A->w)); kkk = (kkk - kkk%(m4ri_radix/A->w)); nnn = (nnn - nnn%(m4ri_radix/A->w)); /* |A | |B | |C | * Compute | | x | | = | | */ mzed_t *A11 = mzed_init_window(A, 0, 0, mmm, kkk); mzed_t *A12 = mzed_init_window(A, 0, kkk, mmm, 2*kkk); mzed_t *A21 = mzed_init_window(A, mmm, 0, 2*mmm, kkk); mzed_t *A22 = mzed_init_window(A, mmm, kkk, 2*mmm, 2*kkk); mzed_t *B11 = mzed_init_window(B, 0, 0, kkk, nnn); mzed_t *B12 = mzed_init_window(B, 0, nnn, kkk, 2*nnn); mzed_t *B21 = mzed_init_window(B, kkk, 0, 2*kkk, nnn); mzed_t *B22 = mzed_init_window(B, kkk, nnn, 2*kkk, 2*nnn); mzed_t *C11 = mzed_init_window(C, 0, 0, mmm, nnn); mzed_t *C12 = mzed_init_window(C, 0, nnn, mmm, 2*nnn); mzed_t *C21 = mzed_init_window(C, mmm, 0, 2*mmm, nnn); mzed_t *C22 = mzed_init_window(C, mmm, nnn, 2*mmm, 2*nnn); /** * \note See Marco Bodrato; "A Strassen-like Matrix Multiplication * Suited for Squaring and Highest Power Computation"; * http://bodrato.it/papres/#CIVV2008 for reference on the used * sequence of operations. */ mzed_t *S = mzed_init(A->finite_field, mmm, kkk); mzed_t *T = mzed_init(A->finite_field, kkk, nnn); mzed_t *U = mzed_init(A->finite_field, mmm, nnn); _mzed_add(S, A22, A21); /* 1 S = A22 - A21 */ _mzed_add(T, B22, B21); /* 2 T = B22 - B21 */ _mzed_mul_strassen(U, S, T, cutoff); /* 3 U = S*T */ _mzed_add(C22, U, C22); /* 4 C22 = U + C22 */ _mzed_add(C12, U, C12); /* 5 C12 = U + C12 */ _mzed_mul_strassen(U, A12, B21, cutoff); /* 8 U = A12*B21 */ _mzed_add(C11, U, C11); /* 9 C11 = U + C11 */ _mzed_addmul_strassen(C11, A11, B11, cutoff); /* 11 C11 = A11*B11 + C11 */ _mzed_add(S, S, A12); /* 6 S = S - A12 */ _mzed_add(T, T, B12); /* 7 T = T - B12 */ _mzed_addmul_strassen(U, S, T, cutoff); /* 10 U = S*T + U */ _mzed_add(C12, C12, U); /* 15 C12 = U + C12 */ _mzed_add(S, A11, S); /* 12 S = A11 - S */ _mzed_addmul_strassen(C12, S, B12, cutoff); /* 14 C12 = S*B12 + C12 */ _mzed_add(T, B11, T); /* 13 T = B11 - T */ _mzed_addmul_strassen(C21, A21, T, cutoff); /* 16 C21 = A21*T + C21 */ _mzed_add(S, A22, A12); /* 17 S = A22 + A21 */ _mzed_add(T, B22, B12); /* 18 T = B22 + B21 */ _mzed_addmul_strassen(U, S, T, cutoff); /* 19 U = U - S*T */ _mzed_add(C21, C21, U); /* 20 C21 = C21 - U3 */ _mzed_add(C22, C22, U); /* 21 C22 = C22 - U3 */ /* clean up */ mzed_free_window(A11); mzed_free_window(A12); mzed_free_window(A21); mzed_free_window(A22); mzed_free_window(B11); mzed_free_window(B12); mzed_free_window(B21); mzed_free_window(B22); mzed_free_window(C11); mzed_free_window(C12); mzed_free_window(C21); mzed_free_window(C22); mzed_free(S); mzed_free(T); mzed_free(U); /* deal with rest */ nnn*=2; if (n > nnn) { /* |AA| | B| | C| * Compute |AA| x | B| = | C| */ mzed_t const *B_last_col = mzed_init_window(B, 0, nnn, k, n); mzed_t *C_last_col = mzed_init_window(C, 0, nnn, m, n); _mzed_mul_newton_john(C_last_col, A, B_last_col); mzed_free_window((mzed_t*)B_last_col); mzed_free_window((mzed_t*)C_last_col); } mmm*=2; if (m > mmm) { /* | | |B | | | * Compute |AA| x |B | = |C | */ mzed_t const *A_last_row = mzed_init_window(A, mmm, 0, m, k); mzed_t const *B_first_col= mzed_init_window(B, 0, 0, k, nnn); mzed_t *C_last_row = mzed_init_window(C, mmm, 0, m, nnn); _mzed_mul_newton_john(C_last_row, A_last_row, B_first_col); mzed_free_window((mzed_t*)A_last_row); mzed_free_window((mzed_t*)B_first_col); mzed_free_window(C_last_row); } kkk*=2; if (k > kkk) { /* Add to | | | B| |C | * result |A | x | | = | | */ mzed_t const *A_last_col = mzed_init_window(A, 0, kkk, mmm, k); mzed_t const *B_last_row = mzed_init_window(B, kkk, 0, k, nnn); mzed_t *C_bulk = mzed_init_window(C, 0, 0, mmm, nnn); _mzed_mul_newton_john(C_bulk, A_last_col, B_last_row); mzed_free_window((mzed_t*)A_last_col); mzed_free_window((mzed_t*)B_last_row); mzed_free_window(C_bulk); } return C; } rci_t _mzed_strassen_cutoff(const mzed_t *C, const mzed_t *A, const mzed_t *B) { rci_t cutoff; /* it seems most of it is cache bound: 2 matrix * (n^2 *w / 8 ) <= L2 */ switch(A->finite_field->degree) { case 2: cutoff = MIN(((int)sqrt((double)(4*__M4RI_CPU_L2_CACHE)))/2,4096); break; case 3: case 4: case 5: case 6: case 7: case 8: cutoff = MIN(((int)sqrt((double)(4*__M4RI_CPU_L2_CACHE/A->w))),4096); break; case 9: /* on redhawk 2048 is much better, sage.math 1204 wins **/ cutoff = 2048; break; case 10: case 11: case 12: case 13: case 14: case 15: case 16: cutoff = 4096; break; default: cutoff = 1024; break; } if (cutoff < 2*__M4RI_TWOPOW(A->finite_field->degree)) cutoff = 2*__M4RI_TWOPOW(A->finite_field->degree); return cutoff; } m4rie-20200125/m4rie/mzd_slice.c0000644000175000017500000000542213206144356013054 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010,2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "mzd_slice.h" #include "gf2x.h" #include "mzd_ptr.h" #include "m4ri_functions.h" mzd_slice_t *mzd_slice_mul_scalar(mzd_slice_t *C, const word a, const mzd_slice_t *B) { if(C == NULL) C = mzd_slice_init(B->finite_field, B->nrows, B->ncols); else mzd_slice_set_ui(C, 0); assert( (C->finite_field == B->finite_field) && (((C->nrows ^ B->nrows) | (C->ncols ^ B->ncols)) == 0)); const gf2e *ff = B->finite_field; for(int i=0; idegree; i++) { if(a&(1<depth; j++) _mzd_ptr_add_modred(ff, B->x[j], C->x, i+j); } } return C; } mzd_slice_t *mzd_slice_addmul_scalar(mzd_slice_t *C, const word a, const mzd_slice_t *B) { assert( (C->finite_field == B->finite_field) && (((C->nrows ^ B->nrows) | (C->ncols ^ B->ncols)) == 0)); const gf2e *ff = B->finite_field; for(int i=0; idegree; i++) { if(a&(1<depth; j++) _mzd_ptr_add_modred(ff, B->x[j], C->x, i+j); } } return C; } void mzd_slice_set_ui(mzd_slice_t *A, word value) { for(int i=0; idepth; i++) { mzd_set_ui(A->x[i], (value>>i)&1); } } void mzd_slice_print(const mzd_slice_t *A) { char formatstr[10]; int width = gf2e_degree_to_w(A->finite_field)/4; if (gf2e_degree_to_w(A->finite_field)%4) width += 1; sprintf(formatstr,"%%%dx",width); for (rci_t i=0; i < A->nrows; ++i) { printf("["); for (rci_t j=0; j < A->ncols; j++) { word tmp = mzd_slice_read_elem(A,i,j); printf(formatstr,(int)tmp); if(jncols-1) printf(" "); } printf("]\n"); } } mzd_slice_t *_mzd_slice_addmul_naive(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B) { if (C == NULL) C = mzd_slice_init(A->finite_field, A->nrows, B->ncols); const unsigned int e = A->finite_field->degree; mzd_t *t0 = mzd_init(A->nrows, B->ncols); for(unsigned int i=0; ix[i], B->x[j], 0); _mzd_ptr_add_modred(A->finite_field, t0, C->x, i+j); } } mzd_free(t0); return C; } m4rie-20200125/m4rie/mzd_poly.c0000644000175000017500000000421313206144356012735 00000000000000#include "mzd_poly.h" #include "mzd_slice.h" #include "newton_john.h" static inline mzd_slice_t * mzd_slice_addmul_mzd(mzd_slice_t *C, const word a, const mzd_t *A) { for(int i=0; idepth; i++) if(a & 1ULL<x[i], C->x[i], A); return C; } mzd_poly_t *_mzd_poly_addmul_ext1(mzd_poly_t *C, mzd_poly_t *A, mzd_poly_t *B) { const int d = A->depth + B->depth-1; const int log2d = (int)ceil(log2( (double)d )); assert(log2d <= 16); gf2e *ff = gf2e_init(irreducible_polynomials[log2d][1]); mzd_slice_t *a = mzd_slice_init(ff, A->nrows, A->ncols); mzd_slice_t *b = mzd_slice_init(ff, B->nrows, B->ncols); mzd_slice_t **c = (mzd_slice_t**)calloc(sizeof(mzd_slice_t*),d); mzed_t *Phi = mzed_init(ff, d, d); mzed_t *Rho = mzed_init(ff, d, d); /* evaluation at zero */ mzed_write_elem(Phi, 0, 0, 1); c[0] = mzd_slice_init(ff, A->nrows, B->ncols); mzd_mul(c[0]->x[0], A->x[0], B->x[0], 0); /* evaluation at one */ for(int i=0; idepth; i++) mzd_add(a->x[0], a->x[0], A->x[i]); for (int i = 0; i < B->depth; i++) mzd_add(b->x[0], b->x[0], B->x[i]); c[1] = mzd_slice_init(ff, A->nrows, B->ncols); mzd_mul(c[1]->x[0], a->x[0], b->x[0], 0); /* evaluation at 2 ... d-1 */ for(int i=2; idepth) mzd_slice_addmul_mzd(a, acc, A->x[j]); if (j < B->depth) mzd_slice_addmul_mzd(b, acc, B->x[j]); acc = ff->mul(ff, alpha, acc); } c[i] = mzd_slice_mul(NULL, a, b); } mzd_slice_free(a); mzd_slice_free(b); mzed_invert_newton_john(Rho, Phi); mzd_slice_t *tmp = mzd_slice_init(ff, A->nrows, B->ncols); for(int i=0; ix[i], C->x[i], tmp->x[0]); } } mzd_slice_free(tmp); for(int i=0; inrows); for(int i = 0; i < m->nrows; ++i) iszero[i] = 1; rci_t i = m->length; while (i > 0) { --i; if (iszero[m->target[i]]) { if (m->srctyp[i] == source_source) { mzd_copy(W[m->target[i]], V[m->source[i]]); } else { mzd_copy(W[m->target[i]], W[m->source[i]]); } iszero[m->target[i]] = 0; } else { if (m->srctyp[i] == source_source) { mzd_add(W[m->target[i]], W[m->target[i]], V[m->source[i]]); } else { mzd_add(W[m->target[i]], W[m->target[i]], W[m->source[i]]); } } } m4ri_mm_free(iszero); } m4rie-20200125/m4rie/karatsuba.c0000644000175000017500000050113313206144356013060 00000000000000#include "mzd_ptr.h" #include "m4ri_functions.h" void _mzd_ptr_addmul_karatsuba2(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; mzd_t *t0 = mzd_init(a0->nrows, a0->ncols); mzd_t *t1 = mzd_init(b0->nrows, b0->ncols); mzd_addmul(X[1], mzd_add(t0, a0, a1), mzd_add(t1, b0, b1), 0); /* + (a0+a1)(b0+b1)X */ mzd_free(t0); mzd_free(t1); t0 = mzd_init(a0->nrows, b0->ncols); _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 2, 0, 1); /* + a0b0(1-X) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 2, 1, 2); /* + a1b1(X+X^2) */ mzd_free(t0); } void _mzd_ptr_addmul_karatsuba3(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_add(t1, a0, a1), mzd_add(t2, b0, b1), 0), X, 1, 1); /* + (a0+a1)(b0+b1)X */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_add(t1, a0, a2), mzd_add(t2, b0, b2), 0), X, 1, 2); /* + (a0+a2)(b0+b2)X^2 */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_add(t1, a1, a2), mzd_add(t2, b1, b2), 0), X, 1, 3); /* + (a1+a2)(b1+b2)X^3 */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 3, 0, 1, 2); /* + a0b0(1-X-X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 3, 1, 2, 3); /* + a1b1(X+X^2-X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a2, b2, 0), X, 3, 2, 3, 4); /* + a2b2(-X^2-X^3+X^4) */ mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba4(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a0 + a1 + a2 + a3)*(b0 + b1 + b2 + b3)*X^3 */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a1, a2, a3), mzd_sum(t2, 4, b0, b1, b2, b3), 0), X, 1, 3); /* (a0 + a1)*(b0 + b1)*(X + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 2, 1, 3); /* (a0 + a2)*(b0 + b2)*(X^2 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a2), mzd_sum(t2, 2, b0, b2), 0), X, 2, 2, 3); /* (a1 + a3)*(b1 + b3)*(X^3 + X^4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a1, a3), mzd_sum(t2, 2, b1, b3), 0), X, 2, 3, 4); /* (a2 + a3)*(b2 + b3)*(X^3 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a2, a3), mzd_sum(t2, 2, b2, b3), 0), X, 2, 3, 5); /* (a0*b0)*(1 + X + X^2 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 4, 0, 1, 2, 3); /* (a1*b1)*(X + X^2 + X^3 + X^4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 4, 1, 2, 3, 4); /* (a2*b2)*(X^2 + X^3 + X^4 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a2, b2, 0), X, 4, 2, 3, 4, 5); /* (a3*b3)*(X^3 + X^4 + X^5 + X^6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a3, b3, 0), X, 4, 3, 4, 5, 6); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba5(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); /* a0b0(X^6 + X^5 + X^4 + X^2 + X + 1)*/ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 6, 6, 5, 4, 2, 1, 0); /* a1b1(X^4 + X)*/ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 2, 4, 1); /* a3b3(X^7 + X^4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a3, b3, 0), X, 2, 7, 4); /* (a4b4)(X^8 + X^7 + X^6 + X^4 + X^3 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a4, b4, 0), X, 6, 8, 7, 6, 4, 3, 2); mzd_t *t1 = mzd_init(a0->nrows, a1->ncols); mzd_t *t2 = mzd_init(b0->nrows, b1->ncols); /* (a0+a4)(b0+b4)(X^6 + X^5 + X^3 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a4), mzd_sum(t2, 2, b0, b4), 0), X, 4, 6, 5, 3, 2); /* (a0+a1)(b0+b1)(X^5 + X^4 + X^2 + X) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 4, 5, 4, 2, 1); /* (a3+a4)(b3+b4)(X^7 + X^6 + X^4 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a3, a4), mzd_sum(t2, 2, b3, b4), 0), X, 4, 7, 6, 4, 3); /* (a1+a2+a4)(a1+a2+a4)(X^4 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a1, a2, a4), mzd_sum(t2, 3, b1, b2, b4), 0), X, 2, 4, 2); /* (a0+a2+a3)(b0+b2+b3)(X^6 + X^4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a0, a2, a3), mzd_sum(t2, 3, b0, b2, b3), 0), X, 2, 6, 4); /* (a0+a1+a3+a4)(b0+b1+b3+b4)(X^5 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a1, a3, a4), mzd_sum(t2, 4, b0, b1, b3, b4), 0), X, 2, 5, 3); /* (a0+a1+a2+a4)(b0+b1+b2+b4)(X^5 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a1, a2, a4), mzd_sum(t2, 4, b0, b1, b2, b4), 0), X, 2, 5, 2); /* (a0+a2+a3+a4)(b0+b2+b3+b4)(X^6 + X^3)*/ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a2, a3, a4), mzd_sum(t2, 4, b0, b2, b3, b4), 0), X, 2, 6, 3); /* (a0+a1+a2+a3+a4)(b0+b1+b2+b3+b4)(X^5 + X^4 + X^3)*/ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a2, a3, a4), mzd_sum(t2, 5, b0, b1, b2, b3, b4), 0), X, 3, 5, 4, 3); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba6(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *a5 = A[5]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; const mzd_t *b5 = B[5]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a1->ncols); mzd_t *t2 = mzd_init(b0->nrows, b1->ncols); /* a0b0 (X^6 + X^5 + X + 1) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 4, 6, 5, 1, 0); /* a1b1 (X^7 + X^6 + X^5 + X^4 + X^3 + X) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 6, 7, 6, 5, 4, 3, 1); /* a4b4 (X^9 + X^7 + X^5 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a4, b4, 0), X, 4, 9, 7, 5, 3); /* a5b5 (X^10 + X^9 + X^6 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a5, b5, 0), X, 4, 10, 9, 6, 5); /* (a4 + a5)(b4 + b5) (X^9 + X^8 + X^4+ X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a4, a5), mzd_sum(t2, 2, b4, b5), 0), X, 4, 9, 8, 4, 3); /* (a0 + a1)(b0 + b1) (X^7 + X^4 + X^2 + X) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 4, 7, 4, 2, 1); /* (a3 + a4)(b3 + b4)(X^8 + X^7 + X^6 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a3, a4), mzd_sum(t2, 2, b3, b4), 0), X, 4, 8, 7, 6, 3); /* (a1 + a2)(b1 + b2) (X^7 + X^6 + X^3 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a1, a2), mzd_sum(t2, 2, b1, b2), 0), X, 4, 7, 6, 3, 2); /* (a1 + a4)(b1 + b4) (X^4 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a1, a4), mzd_sum(t2, 2, b1, b4), 0), X, 2, 4, 5); /* (a2 + a3)(b2 + b3) (X^7 + X^6 + X^4 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a2, a3), mzd_sum(t2, 2, b2, b3), 0), X, 4, 7, 6, 4, 3); /* (a3 + a4 + a5)(b3 + b4 + b5) (X^8 + X^6 + X^4 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a3, a4, a5), mzd_sum(t2, 3, b3, b4, b5), 0), X, 4, 8, 6, 4, 3); /* (a0 + a1 + a2)(b0 + b1 + b2) (X^7 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a0, a1, a2), mzd_sum(t2, 3, b0, b1, b2), 0), X, 2, 7, 2); /* (a0 + a3 + a5)(b0 + b3 + b5) (X^7 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a0, a3, a5), mzd_sum(t2, 3, b0, b3, b5), 0), X, 2, 7, 5); /* (a0 + a2 + a5)(b0 + b2 + b5) (X^6 + X^5 + X^4 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a0, a2, a5), mzd_sum(t2, 3, b0, b2, b5), 0), X, 4, 6, 5, 4, 3); /* (a0 + a2 + a3 + a5)(b0 + b2 + b3 + b5) (X^7 + X^5 + X^4 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a2, a3, a5), mzd_sum(t2, 4, b0, b2, b3, b5), 0), X, 4, 7, 5, 4, 3); /* (a0 + a1 + a3 + a4)(b0 + b1 + b3 + b4) (X^6 + X^4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a1, a3, a4), mzd_sum(t2, 4, b0, b1, b3, b4), 0), X, 2, 6, 4); /* (a0 + a1 + a2 + a3 + a4 + a5)(b0 + b1 + b2 + b3 + b4 + b5) X^6 */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a2, a3, a4, a5), mzd_sum(t2, 6, b0, b1, b2, b3, b4, b5), 0), X, 1, 6); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba7(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 22 multiplications and three temporaries */ const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *a5 = A[5]; const mzd_t *a6 = A[6]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; const mzd_t *b5 = B[5]; const mzd_t *b6 = B[6]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a1->ncols); mzd_t *t2 = mzd_init(b0->nrows, b1->ncols); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6)(b0 + b1 + b2 + b3 + b4 + b5 + b6)(X^7 + X^6 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a2, a3, a4, a5, a6), mzd_sum(t2, 7, b0, b1, b2, b3, b4, b5, b6), 0), X, 3, 7, 6, 5); /* (a1 + a2 + a3 + a5 + a6)(b1 + b2 + b3 + b5 + b6)(X^9 + X^6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a2, a3, a5, a6), mzd_sum(t2, 5, b1, b2, b3, b5, b6), 0), X, 2, 9, 6); /* (a0 + a1 + a3 + a4 + a5)(b0 + b1 + b3 + b4 + b5)(X^6 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a3, a4, a5), mzd_sum(t2, 5, b0, b1, b3, b4, b5), 0), X, 2, 6, 3); /* (a0 + a2 + a3 + a4 + a6)(b0 + b2 + b3 + b4 + b6)(X^9 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a3, a4, a6), mzd_sum(t2, 5, b0, b2, b3, b4, b6), 0), X, 2, 9, 3); /* (a0 + a2 + a3 + a5 + a6)(b0 + b2 + b3 + b5 + b6)(X^7 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a3, a5, a6), mzd_sum(t2, 5, b0, b2, b3, b5, b6), 0), X, 2, 7, 3); /* (a0 + a1 + a3 + a4 + a6)(b0 + b1 + b3 + b4 + b6)(X^9 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a3, a4, a6), mzd_sum(t2, 5, b0, b1, b3, b4, b6), 0), X, 2, 9, 5); /* (a1 + a2 + a4 + a5)(b1 + b2 + b4 + b5)(X^9 + X^7 + X^5 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a1, a2, a4, a5), mzd_sum(t2, 4, b1, b2, b4, b5), 0), X, 4, 9, 7, 5, 3); /* (a0 + a1)(b0 + b1)(X^9 + X^7 + X^3 + X) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 4, 9, 7, 3, 1); /* (a0 + a2)(b0 + b2)(X^9 + X^6 + X^5 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a2), mzd_sum(t2, 2, b0, b2), 0), X, 4, 9, 6, 5, 2); /* (a0 + a4)(b0 + b4)(X^7 + X^4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a4), mzd_sum(t2, 2, b0, b4), 0), X, 2, 7, 4); /* (a1 + a3)(b1 + b3)(X^7 + X^6 + X^4 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a1, a3), mzd_sum(t2, 2, b1, b3), 0), X, 4, 7, 6, 4, 3); /* (a2 + a6)(b2 + b6)(X^8 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a2, a6), mzd_sum(t2, 2, b2, b6), 0), X, 2, 8, 5); /* (a3 + a5)(b3 + b5)(X^9 + X^8 + X^6 + X^5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a3, a5), mzd_sum(t2, 2, b3, b5), 0), X, 4, 9, 8, 6, 5); /* (a4 + a6)(b4 + b6)(X^10 + X^7 + X^6 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a4, a6), mzd_sum(t2, 2, b4, b6), 0), X, 4, 10, 7, 6, 3); /* (a5 + a6)(b5 + b6)(X^11 + X^9 + X^5 + X^3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a5, a6), mzd_sum(t2, 2, b5, b6), 0), X, 4, 11, 9, 5, 3); /* a0b0(X^6 + X^5 + X^4 + X^2 + X + 1) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 6, 6, 5, 4, 2, 1, 0); /* a1b1(X^5 + X^4 + X^2 + X) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 4, 5, 4, 2, 1); /* a2b2(X^8 + X^7 + X^6 + X^4 + X^3 + X^2) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a2, b2, 0), X, 6, 8, 7, 6, 4, 3, 2); /* a3b3(X^8 + X^7 + X^5 + X^4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a3, b3, 0), X, 4, 8, 7, 5, 4); /* a4b4(X^10 + X^9 + X^8 + X^6 + X^5 + X^4)*/ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a4, b4, 0), X, 6, 10, 9, 8, 6, 5, 4);; /* a5b5(X^11 + X^10 + X^8 + X^7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a5, b5, 0), X, 4, 11, 10, 8, 7); /* a6b6(X^12 + X^11 + X^10 + X^8 + X^7 + X^6)*/ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a6, b6, 0), X, 6, 12, 11, 10, 8, 7, 6); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba8(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 27 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *a5 = A[5]; const mzd_t *a6 = A[6]; const mzd_t *a7 = A[7]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; const mzd_t *b5 = B[5]; const mzd_t *b6 = B[6]; const mzd_t *b7 = B[7]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); // a0*b0 * (X^0 + X^1 + X^2 + X^3 + X^4 + X^5 + X^6 + X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 8, 0, 1, 2, 3, 4, 5, 6, 7); // a1*b1 * (X^1 + X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^8) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 8, 1, 2, 3, 4, 5, 6, 7, 8); // a2*b2 * (X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^8 + X^9) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a2, b2, 0), X, 8, 2, 3, 4, 5, 6, 7, 8, 9); // a3*b3 * (X^3 + X^4 + X^5 + X^6 + X^7 + X^8 + X^9 + X^10) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a3, b3, 0), X, 8, 3, 4, 5, 6, 7, 8, 9, 10); // a4*b4 * (X^4 + X^5 + X^6 + X^7 + X^8 + X^9 + X^10 + X^11) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a4, b4, 0), X, 8, 4, 5, 6, 7, 8, 9, 10, 11); // a5*b5 * (X^5 + X^6 + X^7 + X^8 + X^9 + X^10 + X^11 + X^12) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a5, b5, 0), X, 8, 5, 6, 7, 8, 9, 10, 11, 12); // a6*b6 * (X^6 + X^7 + X^8 + X^9 + X^10 + X^11 + X^12 + X^13) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a6, b6, 0), X, 8, 6, 7, 8, 9, 10, 11, 12, 13); // a7*b7 * (X^7 + X^8 + X^9 + X^10 + X^11 + X^12 + X^13 + X^14) _mzd_ptr_add_to_all(ff, mzd_mul(t0, a7, b7, 0), X, 8, 7, 8, 9, 10, 11, 12, 13, 14); // (b0 + b2)*(a0 + a2) * (X^2 + X^3 + X^6 + X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a2), mzd_sum(t2, 2, b0, b2), 0), X, 4, 2, 3, 6, 7); // (b2 + b3)*(a2 + a3) * (X^3 + X^5 + X^7 + X^9) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a2, a3), mzd_sum(t2, 2, b2, b3), 0), X, 4, 3, 5, 7, 9); // (b2 + b6)*(a2 + a6) * (X^6 + X^7 + X^8 + X^9) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a2, a6), mzd_sum(t2, 2, b2, b6), 0), X, 4, 6, 7, 8, 9); // (b4 + b5)*(a4 + a5) * (X^5 + X^7 + X^9 + X^11) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a4, a5), mzd_sum(t2, 2, b4, b5), 0), X, 4, 5, 7, 9, 11); // (b6 + b7)*(a6 + a7) * (X^7 + X^9 + X^11 + X^13) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a6, a7), mzd_sum(t2, 2, b6, b7), 0), X, 4, 7, 9, 11, 13); // (b0 + b1 + b2 + b3)*(a0 + a1 + a2 + a3) * (X^3 + X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a1, a2, a3), mzd_sum(t2, 4, b0, b1, b2, b3), 0), X, 2, 3, 7); // (b5 + b7)*(a5 + a7) * (X^7 + X^8 + X^11 + X^12) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a5, a7), mzd_sum(t2, 2, b5, b7), 0), X, 4, 7, 8, 11, 12); // (b0 + b4)*(a0 + a4) * (X^4 + X^5 + X^6 + X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a4), mzd_sum(t2, 2, b0, b4), 0), X, 4, 4, 5, 6, 7); // (b1 + b3)*(a1 + a3) * (X^3 + X^4 + X^7 + X^8) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a1, a3), mzd_sum(t2, 2, b1, b3), 0), X, 4, 3, 4, 7, 8); // (b1 + b3 + b5 + b7)*(a1 + a3 + a5 + a7) * (X^7 + X^8) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a1, a3, a5, a7), mzd_sum(t2, 4, b1, b3, b5, b7), 0), X, 2, 7, 8); // (b0 + b1)*(a0 + a1) * (X^1 + X^3 + X^5 + X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 4, 1, 3, 5, 7); // (b4 + b6)*(a4 + a6) * (X^6 + X^7 + X^10 + X^11) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a4, a6), mzd_sum(t2, 2, b4, b6), 0), X, 4, 6, 7, 10, 11); // (b1 + b5)*(a1 + a5) * (X^5 + X^6 + X^7 + X^8) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a1, a5), mzd_sum(t2, 2, b1, b5), 0), X, 4, 5, 6, 7, 8); // (b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7)*(a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7) * (X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a2, a3, a4, a5, a6, a7), mzd_sum(t2, 8, b0, b1, b2, b3, b4, b5, b6, b7), 0), X, 1, 7); // (b0 + b2 + b4 + b6)*(a0 + a2 + a4 + a6) * (X^6 + X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a2, a4, a6), mzd_sum(t2, 4, b0, b2, b4, b6), 0), X, 2, 6, 7); // (b0 + b1 + b4 + b5)*(a0 + a1 + a4 + a5) * (X^5 + X^7) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a1, a4, a5), mzd_sum(t2, 4, b0, b1, b4, b5), 0), X, 2, 5, 7); // (b2 + b3 + b6 + b7)*(a2 + a3 + a6 + a7) * (X^7 + X^9) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a2, a3, a6, a7), mzd_sum(t2, 4, b2, b3, b6, b7), 0), X, 2, 7, 9); // (b3 + b7)*(a3 + a7) * (X^7 + X^8 + X^9 + X^10) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a3, a7), mzd_sum(t2, 2, b3, b7), 0), X, 4, 7, 8, 9, 10); // (b4 + b5 + b6 + b7)*(a4 + a5 + a6 + a7) * (X^7 + X^11) _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a4, a5, a6, a7), mzd_sum(t2, 4, b4, b5, b6, b7), 0), X, 2, 7, 11); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba9(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 31 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *a5 = A[5]; const mzd_t *a6 = A[6]; const mzd_t *a7 = A[7]; const mzd_t *a8 = A[8]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; const mzd_t *b5 = B[5]; const mzd_t *b6 = B[6]; const mzd_t *b7 = B[7]; const mzd_t *b8 = B[8]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a8)(b8)*(X^2 + X^3 + X^5 + X0 + X2 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a8, b8, 0), X, 6, 2, 3, 5, 10, 12, 16); /* (a0)(b0)*(1 + X + X^3 + X^8 + X0 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 6, 0, 1, 3, 8, 10, 14); /* (a1)(b1)*(X + X^2 + X^4 + X^9 + X1 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 6, 1, 2, 4, 9, 11, 15); /* (a0 + a1)(b0 + b1)*(X + X^2 + X^4 + X^9 + X1 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 6, 1, 2, 4, 9, 11, 15); /* (a0 + a2 + a4 + a6 + a8)(b0 + b2 + b4 + b6 + b8)*(X^2 + X^5 + X^6 + X^7 + X^8 + X^9 + X2 + X3 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a4, a6, a8), mzd_sum(t2, 5, b0, b2, b4, b6, b8), 0), X, 10, 2, 5, 6, 7, 8, 9, 12, 13, 14, 15); /* (a1 + a3 + a5 + a7)(b1 + b3 + b5 + b7)*(X^2 + X^5 + X^6 + X^7 + X^8 + X^9 + X2 + X3 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a1, a3, a5, a7), mzd_sum(t2, 4, b1, b3, b5, b7), 0), X, 10, 2, 5, 6, 7, 8, 9, 12, 13, 14, 15); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8)*(X^2 + X^3 + X^4 + X^6 + X^8 + X2 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a2, a3, a4, a5, a6, a7, a8), mzd_sum(t2, 9, b0, b1, b2, b3, b4, b5, b6, b7, b8), 0), X, 7, 2, 3, 4, 6, 8, 12, 14); /* (a0 + a2 + a3 + a5 + a6 + a8)(b0 + b2 + b3 + b5 + b6 + b8)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^8 + X^9 + X0 + X1 + X2 + X3 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a3, a5, a6, a8), mzd_sum(t2, 6, b0, b2, b3, b5, b6, b8), 0), X, 12, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15); /* (a1 + a2 + a4 + a5 + a7 + a8)(b1 + b2 + b4 + b5 + b7 + b8)*(X^2 + X^4 + X^6 + X^7 + X^9 + X1 + X3 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a2, a4, a5, a7, a8), mzd_sum(t2, 6, b1, b2, b4, b5, b7, b8), 0), X, 8, 2, 4, 6, 7, 9, 11, 13, 14); /* (a0 + a1 + a3 + a4 + a6 + a7)(b0 + b1 + b3 + b4 + b6 + b7)*(X^3 + X^5 + X^7 + X^8 + X0 + X2 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a3, a4, a6, a7), mzd_sum(t2, 6, b0, b1, b3, b4, b6, b7), 0), X, 8, 3, 5, 7, 8, 10, 12, 14, 15); /* (a0 + a3 + a5 + a6 + a7)(b0 + b3 + b5 + b6 + b7)*(X^2 + X^3 + X0 + X2 + X3 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a3, a5, a6, a7), mzd_sum(t2, 5, b0, b3, b5, b6, b7), 0), X, 6, 2, 3, 10, 12, 13, 14); /* (a1 + a3 + a4 + a5 + a8)(b1 + b3 + b4 + b5 + b8)*(X^3 + X^4 + X1 + X3 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a4, a5, a8), mzd_sum(t2, 5, b1, b3, b4, b5, b8), 0), X, 6, 3, 4, 11, 13, 14, 15); /* (a2 + a4 + a5 + a6)(b2 + b4 + b5 + b6)*(X^2 + X^3 + X^4 + X0 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a2, a4, a5, a6), mzd_sum(t2, 4, b2, b4, b5, b6), 0), X, 6, 2, 3, 4, 10, 14, 15); /* (a0 + a1 + a4 + a6 + a7 + a8)(b0 + b1 + b4 + b6 + b7 + b8)*(X^2 + X^4 + X0 + X1 + X2 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a4, a6, a7, a8), mzd_sum(t2, 6, b0, b1, b4, b6, b7, b8), 0), X, 6, 2, 4, 10, 11, 12, 15); /* (a0 + a2 + a3 + a4 + a7)(b0 + b2 + b3 + b4 + b7)*(X^2 + X0 + X1 + X3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a3, a4, a7), mzd_sum(t2, 5, b0, b2, b3, b4, b7), 0), X, 4, 2, 10, 11, 13); /* (a1 + a2 + a3 + a6 + a8)(b1 + b2 + b3 + b6 + b8)*(X^3 + X1 + X2 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a2, a3, a6, a8), mzd_sum(t2, 5, b1, b2, b3, b6, b8), 0), X, 4, 3, 11, 12, 14); /* (a0 + a3 + a4 + a5 + a7)(b0 + b3 + b4 + b5 + b7)*(X^3 + X^4 + X^5 + X^6 + X^9 + X2 + X3 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a3, a4, a5, a7), mzd_sum(t2, 5, b0, b3, b4, b5, b7), 0), X, 8, 3, 4, 5, 6, 9, 12, 13, 14); /* (a1 + a4 + a5 + a6 + a8)(b1 + b4 + b5 + b6 + b8)*(X^4 + X^5 + X^6 + X^7 + X0 + X3 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a4, a5, a6, a8), mzd_sum(t2, 5, b1, b4, b5, b6, b8), 0), X, 8, 4, 5, 6, 7, 10, 13, 14, 15); /* (a2 + a3 + a4 + a6)(b2 + b3 + b4 + b6)*(X^2 + X^3 + X^6 + X^7 + X^8 + X0 + X1 + X2 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a2, a3, a4, a6), mzd_sum(t2, 4, b2, b3, b4, b6), 0), X, 10, 2, 3, 6, 7, 8, 10, 11, 12, 14, 15); /* (a0 + a1 + a3 + a6 + a7 + a8)(b0 + b1 + b3 + b6 + b7 + b8)*(X^2 + X^6 + X^8 + X^9 + X1 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a3, a6, a7, a8), mzd_sum(t2, 6, b0, b1, b3, b6, b7, b8), 0), X, 6, 2, 6, 8, 9, 11, 14); /* (a0 + a2 + a5 + a6 + a7)(b0 + b2 + b5 + b6 + b7)*(X^3 + X^7 + X^9 + X0 + X2 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a5, a6, a7), mzd_sum(t2, 5, b0, b2, b5, b6, b7), 0), X, 6, 3, 7, 9, 10, 12, 15); /* (a1 + a2 + a3 + a5 + a8)(b1 + b2 + b3 + b5 + b8)*(X^2 + X^3 + X^4 + X^5 + X^8 + X1 + X2 + X3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a2, a3, a5, a8), mzd_sum(t2, 5, b1, b2, b3, b5, b8), 0), X, 8, 2, 3, 4, 5, 8, 11, 12, 13); /* (a0 + a4 + a7 + a8)(b0 + b4 + b7 + b8)*(X^4 + X^7 + X1 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a4, a7, a8), mzd_sum(t2, 4, b0, b4, b7, b8), 0), X, 4, 4, 7, 11, 14); /* (a1 + a4 + a5 + a7)(b1 + b4 + b5 + b7)*(X^5 + X^8 + X2 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a1, a4, a5, a7), mzd_sum(t2, 4, b1, b4, b5, b7), 0), X, 4, 5, 8, 12, 15); /* (a2 + a5 + a6 + a8)(b2 + b5 + b6 + b8)*(X^2 + X^3 + X^5 + X^6 + X^9 + X0 + X2 + X3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a2, a5, a6, a8), mzd_sum(t2, 4, b2, b5, b6, b8), 0), X, 8, 2, 3, 5, 6, 9, 10, 12, 13); /* (a3 + a6 + a7)(b3 + b6 + b7)*(X^3 + X^4 + X^6 + X^7 + X0 + X1 + X3 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a3, a6, a7), mzd_sum(t2, 3, b3, b6, b7), 0), X, 8, 3, 4, 6, 7, 10, 11, 13, 14); /* (a0 + a1 + a2 + a3 + a7)(b0 + b1 + b2 + b3 + b7)*(X^2 + X^4 + X^5 + X^7 + X^9 + X1 + X2 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a2, a3, a7), mzd_sum(t2, 5, b0, b1, b2, b3, b7), 0), X, 8, 2, 4, 5, 7, 9, 11, 12, 14); /* (a0 + a1 + a5 + a8)(b0 + b1 + b5 + b8)*(X^2 + X^8 + X^9 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a1, a5, a8), mzd_sum(t2, 4, b0, b1, b5, b8), 0), X, 4, 2, 8, 9, 15); /* (a0 + a2 + a4 + a5 + a6 + a7)(b0 + b2 + b4 + b5 + b6 + b7)*(X^3 + X^4 + X^5 + X^6 + X^7 + X^8 + X0 + X1 + X2 + X3 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a4, a5, a6, a7), mzd_sum(t2, 6, b0, b2, b4, b5, b6, b7), 0), X, 12, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15); /* (a1 + a3 + a4 + a5 + a6)(b1 + b3 + b4 + b5 + b6)*(X^2 + X^3 + X^4 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X3 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a4, a5, a6), mzd_sum(t2, 5, b1, b3, b4, b5, b6), 0), X, 12, 2, 3, 4, 6, 7, 8, 9, 10, 11, 13, 14, 15); /* (a2 + a3 + a5 + a7 + a8)(b2 + b3 + b5 + b7 + b8)*(X^3 + X^6 + X0 + X3) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a3, a5, a7, a8), mzd_sum(t2, 5, b2, b3, b5, b7, b8), 0), X, 4, 3, 6, 10, 13); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba10(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 36 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *a5 = A[5]; const mzd_t *a6 = A[6]; const mzd_t *a7 = A[7]; const mzd_t *a8 = A[8]; const mzd_t *a9 = A[9]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; const mzd_t *b5 = B[5]; const mzd_t *b6 = B[6]; const mzd_t *b7 = B[7]; const mzd_t *b8 = B[8]; const mzd_t *b9 = B[9]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a9)(b9)*(X + X^6 + X^8 + X1 + X3 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a9, b9, 0), X, 6, 1, 6, 8, 11, 13, 18); /* (a0)(b0)*(1 + X^5 + X^7 + X0 + X2 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 6, 0, 5, 7, 10, 12, 17); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9)*(X + X^2 + X^3 + X^4 + X^5 + X^8 + X^9 + X0 + X3 + X4 + X5 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), mzd_sum(t2, 10, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9), 0), X, 13, 1, 2, 3, 4, 5, 8, 9, 10, 13, 14, 15, 16, 17); /* (a0 + a2 + a3 + a5 + a6 + a8 + a9)(b0 + b2 + b3 + b5 + b6 + b8 + b9)*(X^2 + X^3 + X^5 + X^6 + X^7 + X2 + X3 + X4 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a3, a5, a6, a8, a9), mzd_sum(t2, 7, b0, b2, b3, b5, b6, b8, b9), 0), X, 10, 2, 3, 5, 6, 7, 12, 13, 14, 16, 17); /* (a1 + a2 + a4 + a5 + a7 + a8)(b1 + b2 + b4 + b5 + b7 + b8)*(X + X^3 + X^4 + X^7 + X1 + X4 + X5 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a2, a4, a5, a7, a8), mzd_sum(t2, 6, b1, b2, b4, b5, b7, b8), 0), X, 8, 1, 3, 4, 7, 11, 14, 15, 17); /* (a0 + a1 + a3 + a4 + a6 + a7 + a9)(b0 + b1 + b3 + b4 + b6 + b7 + b9)*(X + X^2 + X^4 + X^5 + X^6 + X1 + X2 + X3 + X5 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a3, a4, a6, a7, a9), mzd_sum(t2, 7, b0, b1, b3, b4, b6, b7, b9), 0), X, 10, 1, 2, 4, 5, 6, 11, 12, 13, 15, 16); /* (a0 + a3 + a5 + a6 + a7)(b0 + b3 + b5 + b6 + b7)*(X + X^3 + X^7 + X^8 + X2 + X3 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a3, a5, a6, a7), mzd_sum(t2, 5, b0, b3, b5, b6, b7), 0), X, 8, 1, 3, 7, 8, 12, 13, 16, 17); /* (a1 + a3 + a4 + a5 + a8)(b1 + b3 + b4 + b5 + b8)*(X + X^2 + X^4 + X^6 + X^9 + X1 + X4 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a4, a5, a8), mzd_sum(t2, 5, b1, b3, b4, b5, b8), 0), X, 8, 1, 2, 4, 6, 9, 11, 14, 17); /* (a2 + a4 + a5 + a6 + a9)(b2 + b4 + b5 + b6 + b9)*(X + X^2 + X^3 + X^5 + X^6 + X^7 + X^8 + X0 + X1 + X2 + X3 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a4, a5, a6, a9), mzd_sum(t2, 5, b2, b4, b5, b6, b9), 0), X, 12, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15); /* (a0 + a1 + a4 + a6 + a7 + a8)(b0 + b1 + b4 + b6 + b7 + b8)*(X^2 + X^3 + X^4 + X^6 + X^7 + X^8 + X^9 + X1 + X2 + X3 + X4 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a4, a6, a7, a8), mzd_sum(t2, 6, b0, b1, b4, b6, b7, b8), 0), X, 12, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16); /* (a0 + a2 + a3 + a4 + a7 + a9)(b0 + b2 + b3 + b4 + b7 + b9)*(X^3 + X^4 + X^5 + X^7 + X^8 + X^9 + X0 + X2 + X3 + X4 + X5 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a3, a4, a7, a9), mzd_sum(t2, 6, b0, b2, b3, b4, b7, b9), 0), X, 12, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 17); /* (a1 + a2 + a3 + a6 + a8 + a9)(b1 + b2 + b3 + b6 + b8 + b9)*(X + X^4 + X^5 + X^9 + X0 + X4 + X5 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a2, a3, a6, a8, a9), mzd_sum(t2, 6, b1, b2, b3, b6, b8, b9), 0), X, 8, 1, 4, 5, 9, 10, 14, 15, 16); /* (a0 + a3 + a4 + a5 + a7)(b0 + b3 + b4 + b5 + b7)*(X^3 + X^5 + X^6 + X^7 + X^8 + X0 + X1 + X2 + X3 + X5 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a3, a4, a5, a7), mzd_sum(t2, 5, b0, b3, b4, b5, b7), 0), X, 12, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17); /* (a1 + a4 + a5 + a6 + a8)(b1 + b4 + b5 + b6 + b8)*(X + X^4 + X^7 + X^9 + X2 + X4 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a4, a5, a6, a8), mzd_sum(t2, 5, b1, b4, b5, b6, b8), 0), X, 8, 1, 4, 7, 9, 12, 14, 16, 17); /* (a2 + a3 + a4 + a6 + a9)(b2 + b3 + b4 + b6 + b9)*(X + X^2 + X^5 + X^6 + X0 + X1 + X5 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a3, a4, a6, a9), mzd_sum(t2, 5, b2, b3, b4, b6, b9), 0), X, 8, 1, 2, 5, 6, 10, 11, 15, 17); /* (a0 + a1 + a3 + a6 + a7 + a8)(b0 + b1 + b3 + b6 + b7 + b8)*(X^2 + X^3 + X^4 + X^8 + X^9 + X3 + X4 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a3, a6, a7, a8), mzd_sum(t2, 6, b0, b1, b3, b6, b7, b8), 0), X, 8, 2, 3, 4, 8, 9, 13, 14, 17); /* (a0 + a2 + a5 + a6 + a7 + a9)(b0 + b2 + b5 + b6 + b7 + b9)*(X + X^3 + X^4 + X^5 + X^6 + X^8 + X^9 + X0 + X1 + X3 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a5, a6, a7, a9), mzd_sum(t2, 6, b0, b2, b5, b6, b7, b9), 0), X, 12, 1, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15); /* (a1 + a2 + a3 + a5 + a8 + a9)(b1 + b2 + b3 + b5 + b8 + b9)*(X^2 + X^4 + X^5 + X^6 + X^7 + X^9 + X0 + X1 + X2 + X4 + X5 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a2, a3, a5, a8, a9), mzd_sum(t2, 6, b1, b2, b3, b5, b8, b9), 0), X, 12, 2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 16); /* (a0 + a4 + a7 + a8)(b0 + b4 + b7 + b8)*(X + X^2 + X^4 + X^8 + X0 + X1 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a4, a7, a8), mzd_sum(t2, 4, b0, b4, b7, b8), 0), X, 8, 1, 2, 4, 8, 10, 11, 16, 17); /* (a1 + a4 + a5 + a7 + a9)(b1 + b4 + b5 + b7 + b9)*(X + X^2 + X^3 + X^5 + X^6 + X^8 + X^9 + X2 + X3 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a4, a5, a7, a9), mzd_sum(t2, 5, b1, b4, b5, b7, b9), 0), X, 10, 1, 2, 3, 5, 6, 8, 9, 12, 13, 17); /* (a2 + a5 + a6 + a8)(b2 + b5 + b6 + b8)*(X + X^2 + X^3 + X^4 + X^7 + X^8 + X^9 + X0 + X1 + X4) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a2, a5, a6, a8), mzd_sum(t2, 4, b2, b5, b6, b8), 0), X, 10, 1, 2, 3, 4, 7, 8, 9, 10, 11, 14); /* (a3 + a6 + a7 + a9)(b3 + b6 + b7 + b9)*(X^2 + X^3 + X^4 + X^5 + X^8 + X^9 + X0 + X1 + X2 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a3, a6, a7, a9), mzd_sum(t2, 4, b3, b6, b7, b9), 0), X, 10, 2, 3, 4, 5, 8, 9, 10, 11, 12, 15); /* (a0 + a1 + a2 + a3 + a7)(b0 + b1 + b2 + b3 + b7)*(X + X^5 + X^7 + X2 + X4 + X5) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a2, a3, a7), mzd_sum(t2, 5, b0, b1, b2, b3, b7), 0), X, 6, 1, 5, 7, 12, 14, 15); /* (a0 + a1 + a5 + a8 + a9)(b0 + b1 + b5 + b8 + b9)*(X + X^3 + X^4 + X^6 + X^7 + X^9 + X0 + X1 + X3 + X4 + X5 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a5, a8, a9), mzd_sum(t2, 5, b0, b1, b5, b8, b9), 0), X, 12, 1, 3, 4, 6, 7, 9, 10, 11, 13, 14, 15, 16); /* (a0 + a2 + a4 + a5 + a6 + a7)(b0 + b2 + b4 + b5 + b6 + b7)*(X + X^4 + X^6 + X0 + X1 + X3 + X5 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a4, a5, a6, a7), mzd_sum(t2, 6, b0, b2, b4, b5, b6, b7), 0), X, 8, 1, 4, 6, 10, 11, 13, 15, 17); /* (a1 + a3 + a4 + a5 + a6)(b1 + b3 + b4 + b5 + b6)*(X + X^2 + X^5 + X^6 + X^7 + X^8 + X2 + X3 + X4 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a4, a5, a6), mzd_sum(t2, 5, b1, b3, b4, b5, b6), 0), X, 10, 1, 2, 5, 6, 7, 8, 12, 13, 14, 16); /* (a2 + a3 + a5 + a7 + a8 + a9)(b2 + b3 + b5 + b7 + b8 + b9)*(X + X^3 + X^5 + X^9 + X2 + X5 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a3, a5, a7, a8, a9), mzd_sum(t2, 6, b2, b3, b5, b7, b8, b9), 0), X, 8, 1, 3, 5, 9, 12, 15, 16, 17); /* (a0 + a4 + a5 + a6 + a7 + a9)(b0 + b4 + b5 + b6 + b7 + b9)*(X + X^2 + X^7 + X^8 + X0 + X4 + X6 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a4, a5, a6, a7, a9), mzd_sum(t2, 6, b0, b4, b5, b6, b7, b9), 0), X, 8, 1, 2, 7, 8, 10, 14, 16, 17); /* (a1 + a5 + a6 + a7 + a8)(b1 + b5 + b6 + b7 + b8)*(X + X^2 + X^3 + X^6 + X^9 + X3 + X5 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a5, a6, a7, a8), mzd_sum(t2, 5, b1, b5, b6, b7, b8), 0), X, 8, 1, 2, 3, 6, 9, 13, 15, 17); /* (a2 + a6 + a7 + a8 + a9)(b2 + b6 + b7 + b8 + b9)*(X + X^2 + X^3 + X^4 + X^6 + X^7 + X^8 + X0 + X1 + X3 + X4 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a6, a7, a8, a9), mzd_sum(t2, 5, b2, b6, b7, b8, b9), 0), X, 12, 1, 2, 3, 4, 6, 7, 8, 10, 11, 13, 14, 16); /* (a3 + a4 + a5 + a6 + a8)(b3 + b4 + b5 + b6 + b8)*(X^2 + X^3 + X^4 + X^5 + X^7 + X^8 + X^9 + X1 + X2 + X4 + X5 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a3, a4, a5, a6, a8), mzd_sum(t2, 5, b3, b4, b5, b6, b8), 0), X, 12, 2, 3, 4, 5, 7, 8, 9, 11, 12, 14, 15, 17); /* (a0 + a1 + a2 + a3 + a5 + a7 + a8)(b0 + b1 + b2 + b3 + b5 + b7 + b8)*(X^3 + X^6 + X^7 + X^8 + X^9 + X0 + X3 + X4 + X5 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a2, a3, a5, a7, a8), mzd_sum(t2, 7, b0, b1, b2, b3, b5, b7, b8), 0), X, 10, 3, 6, 7, 8, 9, 10, 13, 14, 15, 16); /* (a0 + a1 + a4 + a8 + a9)(b0 + b1 + b4 + b8 + b9)*(X + X^3 + X^4 + X^5 + X^9 + X0 + X1 + X2 + X5 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a4, a8, a9), mzd_sum(t2, 5, b0, b1, b4, b8, b9), 0), X, 10, 1, 3, 4, 5, 9, 10, 11, 12, 15, 16); /* (a0 + a2 + a4 + a5 + a8)(b0 + b2 + b4 + b5 + b8)*(X^2 + X^3 + X^5 + X0 + X2 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a4, a5, a8), mzd_sum(t2, 5, b0, b2, b4, b5, b8), 0), X, 6, 2, 3, 5, 10, 12, 16); /* (a1 + a3 + a4 + a7)(b1 + b3 + b4 + b7)*(X^3 + X^4 + X^6 + X1 + X3 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a1, a3, a4, a7), mzd_sum(t2, 4, b1, b3, b4, b7), 0), X, 6, 3, 4, 6, 11, 13, 17); /* (a2 + a3 + a4 + a5 + a7 + a9)(b2 + b3 + b4 + b5 + b7 + b9)*(X + X^3 + X^5 + X^7 + X^8 + X2 + X4 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a3, a4, a5, a7, a9), mzd_sum(t2, 6, b2, b3, b4, b5, b7, b9), 0), X, 8, 1, 3, 5, 7, 8, 12, 14, 17); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba11(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 40 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *a5 = A[5]; const mzd_t *a6 = A[6]; const mzd_t *a7 = A[7]; const mzd_t *a8 = A[8]; const mzd_t *a9 = A[9]; const mzd_t *a10 = A[10]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; const mzd_t *b5 = B[5]; const mzd_t *b6 = B[6]; const mzd_t *b7 = B[7]; const mzd_t *b8 = B[8]; const mzd_t *b9 = B[9]; const mzd_t *b10 = B[10]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a10)(b10)*(X^2 + X^3 + X^7 + X^8 + X^9 + X0 + X2 + X3 + X4 + X5 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a10, b10, 0), X, 12, 2, 3, 7, 8, 9, 10, 12, 13, 14, 15, 19, 20); /* (a0 + a2 + a3 + a5 + a6 + a8 + a9)(b0 + b2 + b3 + b5 + b6 + b8 + b9)*(X^3 + X^5 + X^6 + X^9 + X3 + X6 + X7 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a3, a5, a6, a8, a9), mzd_sum(t2, 7, b0, b2, b3, b5, b6, b8, b9), 0), X, 8, 3, 5, 6, 9, 13, 16, 17, 19); /* (a1 + a2 + a4 + a5 + a7 + a8 + a10)(b1 + b2 + b4 + b5 + b7 + b8 + b10)*(X^2 + X^3 + X^4 + X^6 + X^8 + X^9 + X2 + X3 + X5 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a2, a4, a5, a7, a8, a10), mzd_sum(t2, 7, b1, b2, b4, b5, b7, b8, b10), 0), X, 12, 2, 3, 4, 6, 8, 9, 12, 13, 15, 17, 18, 19); /* (a0 + a1 + a3 + a4 + a6 + a7 + a9 + a10)(b0 + b1 + b3 + b4 + b6 + b7 + b9 + b10)*(X^2 + X^4 + X^5 + X^8 + X2 + X5 + X6 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a3, a4, a6, a7, a9, a10), mzd_sum(t2, 8, b0, b1, b3, b4, b6, b7, b9, b10), 0), X, 8, 2, 4, 5, 8, 12, 15, 16, 18); /* (a0)(b0)*(1 + X + X^5 + X^6 + X^7 + X^8 + X0 + X1 + X2 + X3 + X7 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 12, 0, 1, 5, 6, 7, 8, 10, 11, 12, 13, 17, 18); /* (a1)(b1)*(X + X^2 + X^6 + X^7 + X^8 + X^9 + X1 + X2 + X3 + X4 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 12, 1, 2, 6, 7, 8, 9, 11, 12, 13, 14, 18, 19); /* (a0 + a1)(b0 + b1)*(X + X^2 + X^6 + X^7 + X^8 + X^9 + X1 + X2 + X3 + X4 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 12, 1, 2, 6, 7, 8, 9, 11, 12, 13, 14, 18, 19); /* (a0 + a2 + a4 + a6 + a8 + a10)(b0 + b2 + b4 + b6 + b8 + b10)*(X^2 + X^7 + X^9 + X2 + X4 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a4, a6, a8, a10), mzd_sum(t2, 6, b0, b2, b4, b6, b8, b10), 0), X, 6, 2, 7, 9, 12, 14, 19); /* (a1 + a3 + a5 + a7 + a9)(b1 + b3 + b5 + b7 + b9)*(X^2 + X^7 + X^9 + X2 + X4 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a5, a7, a9), mzd_sum(t2, 5, b1, b3, b5, b7, b9), 0), X, 6, 2, 7, 9, 12, 14, 19); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10)*(X^3 + X^4 + X^5 + X^6 + X^7 + X0 + X1 + X2 + X5 + X6 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 11, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10), mzd_sum(t2, 11, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10), 0), X, 13, 3, 4, 5, 6, 7, 10, 11, 12, 15, 16, 17, 18, 19); /* (a0 + a3 + a5 + a6 + a7 + a10)(b0 + b3 + b5 + b6 + b7 + b10)*(X^3 + X^6 + X^7 + X1 + X2 + X6 + X7 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a3, a5, a6, a7, a10), mzd_sum(t2, 6, b0, b3, b5, b6, b7, b10), 0), X, 8, 3, 6, 7, 11, 12, 16, 17, 18); /* (a1 + a3 + a4 + a5 + a8 + a10)(b1 + b3 + b4 + b5 + b8 + b10)*(X^4 + X^7 + X^8 + X2 + X3 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a4, a5, a8, a10), mzd_sum(t2, 6, b1, b3, b4, b5, b8, b10), 0), X, 8, 4, 7, 8, 12, 13, 17, 18, 19); /* (a2 + a4 + a5 + a6 + a9)(b2 + b4 + b5 + b6 + b9)*(X^2 + X^3 + X^5 + X^7 + X0 + X2 + X5 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a4, a5, a6, a9), mzd_sum(t2, 5, b2, b4, b5, b6, b9), 0), X, 8, 2, 3, 5, 7, 10, 12, 15, 18); /* (a0 + a1 + a4 + a6 + a7 + a8)(b0 + b1 + b4 + b6 + b7 + b8)*(X^3 + X^4 + X^6 + X^8 + X1 + X3 + X6 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a4, a6, a7, a8), mzd_sum(t2, 6, b0, b1, b4, b6, b7, b8), 0), X, 8, 3, 4, 6, 8, 11, 13, 16, 19); /* (a0 + a2 + a3 + a4 + a7 + a9 + a10)(b0 + b2 + b3 + b4 + b7 + b9 + b10)*(X^2 + X^3 + X^4 + X^5 + X^8 + X0 + X3 + X5 + X7 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a3, a4, a7, a9, a10), mzd_sum(t2, 7, b0, b2, b3, b4, b7, b9, b10), 0), X, 10, 2, 3, 4, 5, 8, 10, 13, 15, 17, 19); /* (a1 + a2 + a3 + a6 + a8 + a9 + a10)(b1 + b2 + b3 + b6 + b8 + b9 + b10)*(X^2 + X^4 + X^5 + X^6 + X^7 + X^8 + X0 + X1 + X2 + X3 + X5 + X6 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a2, a3, a6, a8, a9, a10), mzd_sum(t2, 7, b1, b2, b3, b6, b8, b9, b10), 0), X, 14, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 18, 19); /* (a0 + a3 + a4 + a5 + a7 + a10)(b0 + b3 + b4 + b5 + b7 + b10)*(X^2 + X^3 + X^5 + X^6 + X^8 + X^9 + X0 + X1 + X3 + X4 + X5 + X6 + X7 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a3, a4, a5, a7, a10), mzd_sum(t2, 6, b0, b3, b4, b5, b7, b10), 0), X, 14, 2, 3, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19); /* (a1 + a4 + a5 + a6 + a8)(b1 + b4 + b5 + b6 + b8)*(X^2 + X^4 + X^6 + X^8 + X1 + X3 + X6 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a4, a5, a6, a8), mzd_sum(t2, 5, b1, b4, b5, b6, b8), 0), X, 10, 2, 4, 6, 8, 11, 13, 16, 17, 18, 19); /* (a2 + a3 + a4 + a6 + a9 + a10)(b2 + b3 + b4 + b6 + b9 + b10)*(X^2 + X^5 + X^8 + X0 + X3 + X5 + X7 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a3, a4, a6, a9, a10), mzd_sum(t2, 6, b2, b3, b4, b6, b9, b10), 0), X, 8, 2, 5, 8, 10, 13, 15, 17, 18); /* (a0 + a1 + a3 + a6 + a7 + a8 + a10)(b0 + b1 + b3 + b6 + b7 + b8 + b10)*(X^2 + X^3 + X^4 + X^8 + X^9 + X3 + X4 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a3, a6, a7, a8, a10), mzd_sum(t2, 7, b0, b1, b3, b6, b7, b8, b10), 0), X, 8, 2, 3, 4, 8, 9, 13, 14, 17); /* (a0 + a2 + a5 + a6 + a7 + a9)(b0 + b2 + b5 + b6 + b7 + b9)*(X^3 + X^4 + X^5 + X^9 + X0 + X4 + X5 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a5, a6, a7, a9), mzd_sum(t2, 6, b0, b2, b5, b6, b7, b9), 0), X, 8, 3, 4, 5, 9, 10, 14, 15, 18); /* (a1 + a2 + a3 + a5 + a8 + a9 + a10)(b1 + b2 + b3 + b5 + b8 + b9 + b10)*(X^4 + X^5 + X^6 + X0 + X1 + X5 + X6 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a2, a3, a5, a8, a9, a10), mzd_sum(t2, 7, b1, b2, b3, b5, b8, b9, b10), 0), X, 8, 4, 5, 6, 10, 11, 15, 16, 19); /* (a0 + a4 + a7 + a8 + a10)(b0 + b4 + b7 + b8 + b10)*(X^2 + X^4 + X^6 + X0 + X3 + X6 + X7 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a4, a7, a8, a10), mzd_sum(t2, 5, b0, b4, b7, b8, b10), 0), X, 8, 2, 4, 6, 10, 13, 16, 17, 18); /* (a1 + a4 + a5 + a7 + a9 + a10)(b1 + b4 + b5 + b7 + b9 + b10)*(X^3 + X^5 + X^7 + X1 + X4 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a4, a5, a7, a9, a10), mzd_sum(t2, 6, b1, b4, b5, b7, b9, b10), 0), X, 8, 3, 5, 7, 11, 14, 17, 18, 19); /* (a2 + a5 + a6 + a8 + a10)(b2 + b5 + b6 + b8 + b10)*(X^2 + X^3 + X^4 + X^6 + X^7 + X^9 + X0 + X3 + X4 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a5, a6, a8, a10), mzd_sum(t2, 5, b2, b5, b6, b8, b10), 0), X, 10, 2, 3, 4, 6, 7, 9, 10, 13, 14, 18); /* (a3 + a6 + a7 + a9)(b3 + b6 + b7 + b9)*(X^3 + X^4 + X^5 + X^7 + X^8 + X0 + X1 + X4 + X5 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a3, a6, a7, a9), mzd_sum(t2, 4, b3, b6, b7, b9), 0), X, 10, 3, 4, 5, 7, 8, 10, 11, 14, 15, 19); /* (a0 + a1 + a2 + a3 + a7 + a10)(b0 + b1 + b2 + b3 + b7 + b10)*(X^2 + X^5 + X^6 + X^8 + X^9 + X1 + X3 + X5 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a2, a3, a7, a10), mzd_sum(t2, 6, b0, b1, b2, b3, b7, b10), 0), X, 10, 2, 5, 6, 8, 9, 11, 13, 15, 18, 19); /* (a0 + a1 + a5 + a8 + a9)(b0 + b1 + b5 + b8 + b9)*(X^3 + X^4 + X^7 + X^8 + X^9 + X0 + X4 + X5 + X6 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a1, a5, a8, a9), mzd_sum(t2, 5, b0, b1, b5, b8, b9), 0), X, 10, 3, 4, 7, 8, 9, 10, 14, 15, 16, 18); /* (a0 + a2 + a4 + a5 + a6 + a7)(b0 + b2 + b4 + b5 + b6 + b7)*(X^4 + X^8 + X0 + X5 + X7 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a4, a5, a6, a7), mzd_sum(t2, 6, b0, b2, b4, b5, b6, b7), 0), X, 6, 4, 8, 10, 15, 17, 18); /* (a1 + a3 + a4 + a5 + a6 + a10)(b1 + b3 + b4 + b5 + b6 + b10)*(X^5 + X^9 + X1 + X6 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a4, a5, a6, a10), mzd_sum(t2, 6, b1, b3, b4, b5, b6, b10), 0), X, 6, 5, 9, 11, 16, 18, 19); /* (a2 + a3 + a5 + a7 + a8 + a9 + a10)(b2 + b3 + b5 + b7 + b8 + b9 + b10)*(X^2 + X^3 + X^5 + X^6 + X^7 + X^8 + X1 + X3 + X4 + X5 + X6 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a5, a7, a8, a9, a10), mzd_sum(t2, 7, b2, b3, b5, b7, b8, b9, b10), 0), X, 14, 2, 3, 5, 6, 7, 8, 11, 13, 14, 15, 16, 17, 18, 19); /* (a0 + a4 + a5 + a6 + a7 + a9)(b0 + b4 + b5 + b6 + b7 + b9)*(X^2 + X^6 + X^7 + X0 + X1 + X3 + X4 + X6 + X7 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a4, a5, a6, a7, a9), mzd_sum(t2, 6, b0, b4, b5, b6, b7, b9), 0), X, 10, 2, 6, 7, 10, 11, 13, 14, 16, 17, 18); /* (a1 + a5 + a6 + a7 + a8 + a10)(b1 + b5 + b6 + b7 + b8 + b10)*(X^3 + X^7 + X^8 + X1 + X2 + X4 + X5 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a5, a6, a7, a8, a10), mzd_sum(t2, 6, b1, b5, b6, b7, b8, b10), 0), X, 10, 3, 7, 8, 11, 12, 14, 15, 17, 18, 19); /* (a2 + a6 + a7 + a8 + a9)(b2 + b6 + b7 + b8 + b9)*(X^2 + X^3 + X^4 + X^7 + X0 + X4 + X6 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a6, a7, a8, a9), mzd_sum(t2, 5, b2, b6, b7, b8, b9), 0), X, 8, 2, 3, 4, 7, 10, 14, 16, 18); /* (a3 + a4 + a5 + a6 + a8 + a10)(b3 + b4 + b5 + b6 + b8 + b10)*(X^3 + X^4 + X^5 + X^8 + X1 + X5 + X7 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a3, a4, a5, a6, a8, a10), mzd_sum(t2, 6, b3, b4, b5, b6, b8, b10), 0), X, 8, 3, 4, 5, 8, 11, 15, 17, 19); /* (a0 + a1 + a2 + a3 + a5 + a7 + a8)(b0 + b1 + b2 + b3 + b5 + b7 + b8)*(X^2 + X^3 + X^6 + X^8 + X0 + X2 + X3 + X5 + X6 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a2, a3, a5, a7, a8), mzd_sum(t2, 7, b0, b1, b2, b3, b5, b7, b8), 0), X, 10, 2, 3, 6, 8, 10, 12, 13, 15, 16, 19); /* (a0 + a1 + a4 + a8 + a9 + a10)(b0 + b1 + b4 + b8 + b9 + b10)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^8 + X0 + X3 + X4 + X5 + X6 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a4, a8, a9, a10), mzd_sum(t2, 6, b0, b1, b4, b8, b9, b10), 0), X, 14, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15, 16, 18, 19); /* (a0 + a2 + a4 + a5 + a8)(b0 + b2 + b4 + b5 + b8)*(X^2 + X^3 + X^5 + X0 + X2 + X6) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a4, a5, a8), mzd_sum(t2, 5, b0, b2, b4, b5, b8), 0), X, 6, 2, 3, 5, 10, 12, 16); /* (a1 + a3 + a4 + a7)(b1 + b3 + b4 + b7)*(X^3 + X^4 + X^6 + X1 + X3 + X7) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a1, a3, a4, a7), mzd_sum(t2, 4, b1, b3, b4, b7), 0), X, 6, 3, 4, 6, 11, 13, 17); /* (a2 + a3 + a4 + a5 + a7 + a9 + a10)(b2 + b3 + b4 + b5 + b7 + b9 + b10)*(X^3 + X^5 + X^6 + X^7 + X1 + X2 + X3 + X4 + X7 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a4, a5, a7, a9, a10), mzd_sum(t2, 7, b2, b3, b4, b5, b7, b9, b10), 0), X, 10, 3, 5, 6, 7, 11, 12, 13, 14, 17, 18); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba12(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 45 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[0]; const mzd_t *a1 = A[1]; const mzd_t *a2 = A[2]; const mzd_t *a3 = A[3]; const mzd_t *a4 = A[4]; const mzd_t *a5 = A[5]; const mzd_t *a6 = A[6]; const mzd_t *a7 = A[7]; const mzd_t *a8 = A[8]; const mzd_t *a9 = A[9]; const mzd_t *a10 = A[10]; const mzd_t *a11 = A[11]; const mzd_t *b0 = B[0]; const mzd_t *b1 = B[1]; const mzd_t *b2 = B[2]; const mzd_t *b3 = B[3]; const mzd_t *b4 = B[4]; const mzd_t *b5 = B[5]; const mzd_t *b6 = B[6]; const mzd_t *b7 = B[7]; const mzd_t *b8 = B[8]; const mzd_t *b9 = B[9]; const mzd_t *b10 = B[10]; const mzd_t *b11 = B[11]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a11)(b11)*(X + X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X6 + X7 + X8 + X9 + X^20 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a11, b11, 0), X, 14, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22); /* (a0)(b0)*(1 + X + X^2 + X^3 + X^4 + X^5 + X^6 + X5 + X6 + X7 + X8 + X9 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 14, 0, 1, 2, 3, 4, 5, 6, 15, 16, 17, 18, 19, 20, 21); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11)*(X + X^3 + X^5 + X^7 + X^8 + X^9 + X0 + X1 + X2 + X3 + X4 + X5 + X7 + X9 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 12, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11), mzd_sum(t2, 12, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11), 0), X, 15, 1, 3, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21); /* (a0 + a2 + a3 + a5 + a6 + a8 + a9 + a11)(b0 + b2 + b3 + b5 + b6 + b8 + b9 + b11)*(X + X^2 + X^4 + X^5 + X^7 + X^9 + X0 + X2 + X3 + X5 + X7 + X8 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a3, a5, a6, a8, a9, a11), mzd_sum(t2, 8, b0, b2, b3, b5, b6, b8, b9, b11), 0), X, 14, 1, 2, 4, 5, 7, 9, 10, 12, 13, 15, 17, 18, 20, 21); /* (a1 + a2 + a4 + a5 + a7 + a8 + a10 + a11)(b1 + b2 + b4 + b5 + b7 + b8 + b10 + b11)*(X + X^4 + X^7 + X^8 + X0 + X1 + X3 + X4 + X7 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a4, a5, a7, a8, a10, a11), mzd_sum(t2, 8, b1, b2, b4, b5, b7, b8, b10, b11), 0), X, 10, 1, 4, 7, 8, 10, 11, 13, 14, 17, 20); /* (a0 + a1 + a3 + a4 + a6 + a7 + a9 + a10)(b0 + b1 + b3 + b4 + b6 + b7 + b9 + b10)*(X^2 + X^5 + X^8 + X^9 + X1 + X2 + X4 + X5 + X8 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a3, a4, a6, a7, a9, a10), mzd_sum(t2, 8, b0, b1, b3, b4, b6, b7, b9, b10), 0), X, 10, 2, 5, 8, 9, 11, 12, 14, 15, 18, 21); /* (a0 + a3 + a5 + a6 + a7 + a10)(b0 + b3 + b5 + b6 + b7 + b10)*(X^2 + X^3 + X^4 + X^6 + X7 + X8 + X9 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a3, a5, a6, a7, a10), mzd_sum(t2, 6, b0, b3, b5, b6, b7, b10), 0), X, 8, 2, 3, 4, 6, 17, 18, 19, 21); /* (a1 + a3 + a4 + a5 + a8 + a10 + a11)(b1 + b3 + b4 + b5 + b8 + b10 + b11)*(X + X^2 + X^6 + X6 + X7 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a3, a4, a5, a8, a10, a11), mzd_sum(t2, 7, b1, b3, b4, b5, b8, b10, b11), 0), X, 6, 1, 2, 6, 16, 17, 21); /* (a2 + a4 + a5 + a6 + a9 + a11)(b2 + b4 + b5 + b6 + b9 + b11)*(X + X^4 + X^5 + X^6 + X6 + X9 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a4, a5, a6, a9, a11), mzd_sum(t2, 6, b2, b4, b5, b6, b9, b11), 0), X, 8, 1, 4, 5, 6, 16, 19, 20, 21); /* (a0 + a1 + a4 + a6 + a7 + a8 + a11)(b0 + b1 + b4 + b6 + b7 + b8 + b11)*(X + X^3 + X^4 + X6 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a4, a6, a7, a8, a11), mzd_sum(t2, 7, b0, b1, b4, b6, b7, b8, b11), 0), X, 6, 1, 3, 4, 16, 18, 19); /* (a0 + a2 + a3 + a4 + a7 + a9 + a10 + a11)(b0 + b2 + b3 + b4 + b7 + b9 + b10 + b11)*(X^2 + X^4 + X^5 + X7 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a3, a4, a7, a9, a10, a11), mzd_sum(t2, 8, b0, b2, b3, b4, b7, b9, b10, b11), 0), X, 6, 2, 4, 5, 17, 19, 20); /* (a1 + a2 + a3 + a6 + a8 + a9 + a10)(b1 + b2 + b3 + b6 + b8 + b9 + b10)*(X^3 + X^5 + X^6 + X8 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a2, a3, a6, a8, a9, a10), mzd_sum(t2, 7, b1, b2, b3, b6, b8, b9, b10), 0), X, 6, 3, 5, 6, 18, 20, 21); /* (a0 + a3 + a4 + a5 + a7 + a10 + a11)(b0 + b3 + b4 + b5 + b7 + b10 + b11)*(X^2 + X^4 + X^5 + X^6 + X7 + X9 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a3, a4, a5, a7, a10, a11), mzd_sum(t2, 7, b0, b3, b4, b5, b7, b10, b11), 0), X, 8, 2, 4, 5, 6, 17, 19, 20, 21); /* (a1 + a4 + a5 + a6 + a8 + a11)(b1 + b4 + b5 + b6 + b8 + b11)*(X + X^2 + X^4 + X6 + X7 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a4, a5, a6, a8, a11), mzd_sum(t2, 6, b1, b4, b5, b6, b8, b11), 0), X, 6, 1, 2, 4, 16, 17, 19); /* (a2 + a3 + a4 + a6 + a9 + a10 + a11)(b2 + b3 + b4 + b6 + b9 + b10 + b11)*(X^2 + X^3 + X^5 + X7 + X8 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a4, a6, a9, a10, a11), mzd_sum(t2, 7, b2, b3, b4, b6, b9, b10, b11), 0), X, 6, 2, 3, 5, 17, 18, 20); /* (a0 + a1 + a3 + a6 + a7 + a8 + a10)(b0 + b1 + b3 + b6 + b7 + b8 + b10)*(X + X^2 + X^3 + X^6 + X6 + X7 + X8 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a3, a6, a7, a8, a10), mzd_sum(t2, 7, b0, b1, b3, b6, b7, b8, b10), 0), X, 8, 1, 2, 3, 6, 16, 17, 18, 21); /* (a0 + a2 + a5 + a6 + a7 + a9)(b0 + b2 + b5 + b6 + b7 + b9)*(X + X^5 + X^6 + X6 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a5, a6, a7, a9), mzd_sum(t2, 6, b0, b2, b5, b6, b7, b9), 0), X, 6, 1, 5, 6, 16, 20, 21); /* (a1 + a2 + a3 + a5 + a8 + a9 + a10)(b1 + b2 + b3 + b5 + b8 + b9 + b10)*(X + X^3 + X^4 + X^5 + X6 + X8 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a2, a3, a5, a8, a9, a10), mzd_sum(t2, 7, b1, b2, b3, b5, b8, b9, b10), 0), X, 8, 1, 3, 4, 5, 16, 18, 19, 20); /* (a0 + a4 + a7 + a8 + a10)(b0 + b4 + b7 + b8 + b10)*(X + X^2 + X^3 + X^9 + X3 + X4 + X5 + X7 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a4, a7, a8, a10), mzd_sum(t2, 5, b0, b4, b7, b8, b10), 0), X, 10, 1, 2, 3, 9, 13, 14, 15, 17, 20, 21); /* (a1 + a4 + a5 + a7 + a9 + a10 + a11)(b1 + b4 + b5 + b7 + b9 + b10 + b11)*(X + X^5 + X^6 + X^7 + X0 + X4 + X5 + X7 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a4, a5, a7, a9, a10, a11), mzd_sum(t2, 7, b1, b4, b5, b7, b9, b10, b11), 0), X, 10, 1, 5, 6, 7, 10, 14, 15, 17, 19, 20); /* (a2 + a5 + a6 + a8 + a10 + a11)(b2 + b5 + b6 + b8 + b10 + b11)*(X^2 + X^6 + X^7 + X^8 + X1 + X5 + X6 + X8 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a5, a6, a8, a10, a11), mzd_sum(t2, 6, b2, b5, b6, b8, b10, b11), 0), X, 10, 2, 6, 7, 8, 11, 15, 16, 18, 20, 21); /* (a3 + a6 + a7 + a9 + a11)(b3 + b6 + b7 + b9 + b11)*(X + X^2 + X^4 + X^5 + X^6 + X^8 + X^9 + X2 + X8 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a3, a6, a7, a9, a11), mzd_sum(t2, 5, b3, b6, b7, b9, b11), 0), X, 10, 1, 2, 4, 5, 6, 8, 9, 12, 18, 20); /* (a0 + a1 + a2 + a3 + a7 + a10 + a11)(b0 + b1 + b2 + b3 + b7 + b10 + b11)*(X + X^4 + X^5 + X^7 + X^9 + X1 + X2 + X5 + X6 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a2, a3, a7, a10, a11), mzd_sum(t2, 7, b0, b1, b2, b3, b7, b10, b11), 0), X, 10, 1, 4, 5, 7, 9, 11, 12, 15, 16, 21); /* (a0 + a1 + a5 + a8 + a9 + a11)(b0 + b1 + b5 + b8 + b9 + b11)*(X + X^2 + X^3 + X^4 + X^6 + X0 + X1 + X2 + X3 + X5 + X6 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a5, a8, a9, a11), mzd_sum(t2, 6, b0, b1, b5, b8, b9, b11), 0), X, 12, 1, 2, 3, 4, 6, 10, 11, 12, 13, 15, 16, 19); /* (a0 + a2 + a4 + a5 + a6 + a7 + a11)(b0 + b2 + b4 + b5 + b6 + b7 + b11)*(X^2 + X^4 + X^7 + X^8 + X^9 + X0 + X2 + X4 + X5 + X7 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a4, a5, a6, a7, a11), mzd_sum(t2, 7, b0, b2, b4, b5, b6, b7, b11), 0), X, 12, 2, 4, 7, 8, 9, 10, 12, 14, 15, 17, 18, 19); /* (a1 + a3 + a4 + a5 + a6 + a10)(b1 + b3 + b4 + b5 + b6 + b10)*(X^3 + X^5 + X^8 + X^9 + X0 + X1 + X3 + X5 + X6 + X8 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a4, a5, a6, a10), mzd_sum(t2, 6, b1, b3, b4, b5, b6, b10), 0), X, 12, 3, 5, 8, 9, 10, 11, 13, 15, 16, 18, 19, 20); /* (a2 + a3 + a5 + a7 + a8 + a9 + a10)(b2 + b3 + b5 + b7 + b8 + b9 + b10)*(X^3 + X^4 + X^5 + X^6 + X^8 + X2 + X3 + X4 + X5 + X7 + X8 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a5, a7, a8, a9, a10), mzd_sum(t2, 7, b2, b3, b5, b7, b8, b9, b10), 0), X, 12, 3, 4, 5, 6, 8, 12, 13, 14, 15, 17, 18, 21); /* (a0 + a4 + a5 + a6 + a7 + a9 + a11)(b0 + b4 + b5 + b6 + b7 + b9 + b11)*(X + X^3 + X^9 + X2 + X3 + X5 + X6 + X7 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a4, a5, a6, a7, a9, a11), mzd_sum(t2, 7, b0, b4, b5, b6, b7, b9, b11), 0), X, 10, 1, 3, 9, 12, 13, 15, 16, 17, 19, 20); /* (a1 + a5 + a6 + a7 + a8 + a10)(b1 + b5 + b6 + b7 + b8 + b10)*(X^2 + X^4 + X0 + X3 + X4 + X6 + X7 + X8 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a5, a6, a7, a8, a10), mzd_sum(t2, 6, b1, b5, b6, b7, b8, b10), 0), X, 10, 2, 4, 10, 13, 14, 16, 17, 18, 20, 21); /* (a2 + a6 + a7 + a8 + a9 + a11)(b2 + b6 + b7 + b8 + b9 + b11)*(X + X^2 + X^4 + X^6 + X^7 + X1 + X4 + X5 + X6 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a6, a7, a8, a9, a11), mzd_sum(t2, 6, b2, b6, b7, b8, b9, b11), 0), X, 10, 1, 2, 4, 6, 7, 11, 14, 15, 16, 20); /* (a3 + a4 + a5 + a6 + a8 + a10 + a11)(b3 + b4 + b5 + b6 + b8 + b10 + b11)*(X^2 + X^3 + X^5 + X^7 + X^8 + X2 + X5 + X6 + X7 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a3, a4, a5, a6, a8, a10, a11), mzd_sum(t2, 7, b3, b4, b5, b6, b8, b10, b11), 0), X, 10, 2, 3, 5, 7, 8, 12, 15, 16, 17, 21); /* (a0 + a1 + a2 + a3 + a5 + a7 + a8 + a11)(b0 + b1 + b2 + b3 + b5 + b7 + b8 + b11)*(X + X^2 + X^3 + X^4 + X^9 + X0 + X2 + X4 + X5 + X8 + X9 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a2, a3, a5, a7, a8, a11), mzd_sum(t2, 8, b0, b1, b2, b3, b5, b7, b8, b11), 0), X, 12, 1, 2, 3, 4, 9, 10, 12, 14, 15, 18, 19, 21); /* (a0 + a1 + a4 + a8 + a9 + a10 + a11)(b0 + b1 + b4 + b8 + b9 + b10 + b11)*(X + X^2 + X^5 + X^7 + X^8 + X^9 + X3 + X9 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a4, a8, a9, a10, a11), mzd_sum(t2, 7, b0, b1, b4, b8, b9, b10, b11), 0), X, 10, 1, 2, 5, 7, 8, 9, 13, 19, 20, 21); /* (a0 + a2 + a4 + a5 + a8)(b0 + b2 + b4 + b5 + b8)*(X + X^2 + X^3 + X^5 + X^6 + X^8 + X0 + X1 + X2 + X3 + X6 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a4, a5, a8), mzd_sum(t2, 5, b0, b2, b4, b5, b8), 0), X, 12, 1, 2, 3, 5, 6, 8, 10, 11, 12, 13, 16, 18); /* (a1 + a3 + a4 + a7 + a11)(b1 + b3 + b4 + b7 + b11)*(X^2 + X^3 + X^4 + X^6 + X^7 + X^9 + X1 + X2 + X3 + X4 + X7 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a4, a7, a11), mzd_sum(t2, 5, b1, b3, b4, b7, b11), 0), X, 12, 2, 3, 4, 6, 7, 9, 11, 12, 13, 14, 17, 19); /* (a2 + a3 + a4 + a5 + a7 + a9 + a10)(b2 + b3 + b4 + b5 + b7 + b9 + b10)*(X^2 + X^5 + X^6 + X^8 + X^9 + X0 + X1 + X5 + X7 + X8 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a4, a5, a7, a9, a10), mzd_sum(t2, 7, b2, b3, b4, b5, b7, b9, b10), 0), X, 12, 2, 5, 6, 8, 9, 10, 11, 15, 17, 18, 19, 20); /* (a0 + a4 + a5 + a9 + a10)(b0 + b4 + b5 + b9 + b10)*(X^2 + X^3 + X^4 + X^7 + X^8 + X0 + X1 + X2 + X3 + X5 + X6 + X9 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a4, a5, a9, a10), mzd_sum(t2, 5, b0, b4, b5, b9, b10), 0), X, 14, 2, 3, 4, 7, 8, 10, 11, 12, 13, 15, 16, 19, 20, 21); /* (a1 + a4 + a6 + a9 + a11)(b1 + b4 + b6 + b9 + b11)*(X + X^2 + X^6 + X^7 + X^8 + X^9 + X1 + X2 + X3 + X4 + X8 + X9) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a4, a6, a9, a11), mzd_sum(t2, 5, b1, b4, b6, b9, b11), 0), X, 12, 1, 2, 6, 7, 8, 9, 11, 12, 13, 14, 18, 19); /* (a2 + a4 + a7 + a9)(b2 + b4 + b7 + b9)*(X^2 + X^3 + X^7 + X^8 + X^9 + X0 + X2 + X3 + X4 + X5 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a2, a4, a7, a9), mzd_sum(t2, 4, b2, b4, b7, b9), 0), X, 12, 2, 3, 7, 8, 9, 10, 12, 13, 14, 15, 19, 20); /* (a3 + a4 + a8 + a9)(b3 + b4 + b8 + b9)*(X^3 + X^4 + X^8 + X^9 + X0 + X1 + X3 + X4 + X5 + X6 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a3, a4, a8, a9), mzd_sum(t2, 4, b3, b4, b8, b9), 0), X, 12, 3, 4, 8, 9, 10, 11, 13, 14, 15, 16, 20, 21); /* (a0 + a1 + a2 + a3 + a5 + a6 + a7 + a8 + a10 + a11)(b0 + b1 + b2 + b3 + b5 + b6 + b7 + b8 + b10 + b11)*(X + X^2 + X^3 + X^6 + X^7 + X^9 + X0 + X1 + X2 + X4 + X5 + X8 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a1, a2, a3, a5, a6, a7, a8, a10, a11), mzd_sum(t2, 10, b0, b1, b2, b3, b5, b6, b7, b8, b10, b11), 0), X, 14, 1, 2, 3, 6, 7, 9, 10, 11, 12, 14, 15, 18, 19, 20); /* (a0 + a1 + a5 + a6 + a10 + a11)(b0 + b1 + b5 + b6 + b10 + b11)*(X + X^6 + X^8 + X1 + X3 + X8) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a5, a6, a10, a11), mzd_sum(t2, 6, b0, b1, b5, b6, b10, b11), 0), X, 6, 1, 6, 8, 11, 13, 18); /* (a0 + a2 + a5 + a7 + a10)(b0 + b2 + b5 + b7 + b10)*(X + X^2 + X^4 + X^6 + X^7 + X^8 + X2 + X3 + X6 + X8 + X9 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a2, a5, a7, a10), mzd_sum(t2, 5, b0, b2, b5, b7, b10), 0), X, 12, 1, 2, 4, 6, 7, 8, 12, 13, 16, 18, 19, 21); /* (a1 + a3 + a6 + a8 + a11)(b1 + b3 + b6 + b8 + b11)*(X + X^4 + X^6 + X^8 + X^9 + X3 + X4 + X6 + X8 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a6, a8, a11), mzd_sum(t2, 5, b1, b3, b6, b8, b11), 0), X, 10, 1, 4, 6, 8, 9, 13, 14, 16, 18, 21); /* (a2 + a3 + a7 + a8)(b2 + b3 + b7 + b8)*(X^3 + X^8 + X0 + X3 + X5 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a2, a3, a7, a8), mzd_sum(t2, 4, b2, b3, b7, b8), 0), X, 6, 3, 8, 10, 13, 15, 20); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba13(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 49 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[ 0]; const mzd_t *a1 = A[ 1]; const mzd_t *a2 = A[ 2]; const mzd_t *a3 = A[ 3]; const mzd_t *a4 = A[ 4]; const mzd_t *a5 = A[ 5]; const mzd_t *a6 = A[ 6]; const mzd_t *a7 = A[ 7]; const mzd_t *a8 = A[ 8]; const mzd_t *a9 = A[ 9]; const mzd_t *a10 = A[10]; const mzd_t *a11 = A[11]; const mzd_t *a12 = A[12]; const mzd_t *b0 = B[ 0]; const mzd_t *b1 = B[ 1]; const mzd_t *b2 = B[ 2]; const mzd_t *b3 = B[ 3]; const mzd_t *b4 = B[ 4]; const mzd_t *b5 = B[ 5]; const mzd_t *b6 = B[ 6]; const mzd_t *b7 = B[ 7]; const mzd_t *b8 = B[ 8]; const mzd_t *b9 = B[ 9]; const mzd_t *b10 = B[10]; const mzd_t *b11 = B[11]; const mzd_t *b12 = B[12]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a12)(b12)*(X^2 + X^9 + X7 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a12, b12, 0), X, 4, 2, 9, 17, 24); /* (a0 + a2 + a3 + a5 + a6 + a8 + a9 + a11 + a12)(b0 + b2 + b3 + b5 + b6 + b8 + b9 + b11 + b12)*(X^2 + X^4 + X^5 + X^7 + X^8 + X^9 + X0 + X2 + X3 + X5 + X6 + X7 + X8 + X^20 + X^21 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a3, a5, a6, a8, a9, a11, a12), mzd_sum(t2, 9, b0, b2, b3, b5, b6, b8, b9, b11, b12), 0), X, 16, 2, 4, 5, 7, 8, 9, 10, 12, 13, 15, 16, 17, 18, 20, 21, 23); /* (a1 + a2 + a4 + a5 + a7 + a8 + a10 + a11)(b1 + b2 + b4 + b5 + b7 + b8 + b10 + b11)*(X^2 + X^3 + X^5 + X^6 + X^8 + X0 + X1 + X3 + X4 + X6 + X8 + X9 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a4, a5, a7, a8, a10, a11), mzd_sum(t2, 8, b1, b2, b4, b5, b7, b8, b10, b11), 0), X, 14, 2, 3, 5, 6, 8, 10, 11, 13, 14, 16, 18, 19, 21, 22); /* (a0 + a1 + a3 + a4 + a6 + a7 + a9 + a10 + a12)(b0 + b1 + b3 + b4 + b6 + b7 + b9 + b10 + b12)*(X^3 + X^4 + X^6 + X^7 + X^9 + X1 + X2 + X4 + X5 + X7 + X9 + X^20 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a3, a4, a6, a7, a9, a10, a12), mzd_sum(t2, 9, b0, b1, b3, b4, b6, b7, b9, b10, b12), 0), X, 14, 3, 4, 6, 7, 9, 11, 12, 14, 15, 17, 19, 20, 22, 23); /* (a0)(b0)*(1 + X + X^7 + X^8 + X5 + X6 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 8, 0, 1, 7, 8, 15, 16, 22, 23); /* (a1)(b1)*(X + X^8 + X6 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 4, 1, 8, 16, 23); /* (a0 + a1)(b0 + b1)*(X + X^8 + X6 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 4, 1, 8, 16, 23); /* (a0 + a2 + a4 + a6 + a8 + a10 + a12)(b0 + b2 + b4 + b6 + b8 + b10 + b12)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^8 + X7 + X8 + X9 + X^20 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a4, a6, a8, a10, a12), mzd_sum(t2, 7, b0, b2, b4, b6, b8, b10, b12), 0), X, 14, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23); /* (a1 + a3 + a5 + a7 + a9 + a11)(b1 + b3 + b5 + b7 + b9 + b11)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^8 + X7 + X8 + X9 + X^20 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a5, a7, a9, a11), mzd_sum(t2, 6, b1, b3, b5, b7, b9, b11), 0), X, 14, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 + b12)*(X^3 + X^5 + X^7 + X^9 + X0 + X1 + X2 + X3 + X4 + X5 + X6 + X7 + X9 + X^21 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 13, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12), mzd_sum(t2, 13, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12), 0), X, 15, 3, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21, 23); /* (a0 + a3 + a5 + a6 + a7 + a10 + a12)(b0 + b3 + b5 + b6 + b7 + b10 + b12)*(X^2 + X^3 + X^4 + X^6 + X7 + X8 + X9 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a3, a5, a6, a7, a10, a12), mzd_sum(t2, 7, b0, b3, b5, b6, b7, b10, b12), 0), X, 8, 2, 3, 4, 6, 17, 18, 19, 21); /* (a1 + a3 + a4 + a5 + a8 + a10 + a11 + a12)(b1 + b3 + b4 + b5 + b8 + b10 + b11 + b12)*(X^3 + X^4 + X^5 + X^7 + X8 + X9 + X^20 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a4, a5, a8, a10, a11, a12), mzd_sum(t2, 8, b1, b3, b4, b5, b8, b10, b11, b12), 0), X, 8, 3, 4, 5, 7, 18, 19, 20, 22); /* (a2 + a4 + a5 + a6 + a9 + a11 + a12)(b2 + b4 + b5 + b6 + b9 + b11 + b12)*(X^4 + X^5 + X^6 + X^8 + X9 + X^20 + X^21 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a4, a5, a6, a9, a11, a12), mzd_sum(t2, 7, b2, b4, b5, b6, b9, b11, b12), 0), X, 8, 4, 5, 6, 8, 19, 20, 21, 23); /* (a0 + a1 + a4 + a6 + a7 + a8 + a11)(b0 + b1 + b4 + b6 + b7 + b8 + b11)*(X^2 + X^5 + X^6 + X^7 + X7 + X^20 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a4, a6, a7, a8, a11), mzd_sum(t2, 7, b0, b1, b4, b6, b7, b8, b11), 0), X, 8, 2, 5, 6, 7, 17, 20, 21, 22); /* (a0 + a2 + a3 + a4 + a7 + a9 + a10 + a11)(b0 + b2 + b3 + b4 + b7 + b9 + b10 + b11)*(X^3 + X^6 + X^7 + X^8 + X8 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a3, a4, a7, a9, a10, a11), mzd_sum(t2, 8, b0, b2, b3, b4, b7, b9, b10, b11), 0), X, 8, 3, 6, 7, 8, 18, 21, 22, 23); /* (a1 + a2 + a3 + a6 + a8 + a9 + a10)(b1 + b2 + b3 + b6 + b8 + b9 + b10)*(X^2 + X^4 + X^7 + X^8 + X7 + X9 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a2, a3, a6, a8, a9, a10), mzd_sum(t2, 7, b1, b2, b3, b6, b8, b9, b10), 0), X, 8, 2, 4, 7, 8, 17, 19, 22, 23); /* (a0 + a3 + a4 + a5 + a7 + a10 + a11 + a12)(b0 + b3 + b4 + b5 + b7 + b10 + b11 + b12)*(X^2 + X^4 + X^5 + X^6 + X7 + X9 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a3, a4, a5, a7, a10, a11, a12), mzd_sum(t2, 8, b0, b3, b4, b5, b7, b10, b11, b12), 0), X, 8, 2, 4, 5, 6, 17, 19, 20, 21); /* (a1 + a4 + a5 + a6 + a8 + a11 + a12)(b1 + b4 + b5 + b6 + b8 + b11 + b12)*(X^3 + X^5 + X^6 + X^7 + X8 + X^20 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a4, a5, a6, a8, a11, a12), mzd_sum(t2, 7, b1, b4, b5, b6, b8, b11, b12), 0), X, 8, 3, 5, 6, 7, 18, 20, 21, 22); /* (a2 + a3 + a4 + a6 + a9 + a10 + a11)(b2 + b3 + b4 + b6 + b9 + b10 + b11)*(X^4 + X^6 + X^7 + X^8 + X9 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a4, a6, a9, a10, a11), mzd_sum(t2, 7, b2, b3, b4, b6, b9, b10, b11), 0), X, 8, 4, 6, 7, 8, 19, 21, 22, 23); /* (a0 + a1 + a3 + a6 + a7 + a8 + a10)(b0 + b1 + b3 + b6 + b7 + b8 + b10)*(X^2 + X^3 + X^6 + X^8 + X7 + X8 + X^21 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a3, a6, a7, a8, a10), mzd_sum(t2, 7, b0, b1, b3, b6, b7, b8, b10), 0), X, 8, 2, 3, 6, 8, 17, 18, 21, 23); /* (a0 + a2 + a5 + a6 + a7 + a9 + a12)(b0 + b2 + b5 + b6 + b7 + b9 + b12)*(X^2 + X^3 + X^4 + X^7 + X7 + X8 + X9 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a5, a6, a7, a9, a12), mzd_sum(t2, 7, b0, b2, b5, b6, b7, b9, b12), 0), X, 8, 2, 3, 4, 7, 17, 18, 19, 22); /* (a1 + a2 + a3 + a5 + a8 + a9 + a10 + a12)(b1 + b2 + b3 + b5 + b8 + b9 + b10 + b12)*(X^3 + X^4 + X^5 + X^8 + X8 + X9 + X^20 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a3, a5, a8, a9, a10, a12), mzd_sum(t2, 8, b1, b2, b3, b5, b8, b9, b10, b12), 0), X, 8, 3, 4, 5, 8, 18, 19, 20, 23); /* (a0 + a4 + a7 + a8 + a10 + a12)(b0 + b4 + b7 + b8 + b10 + b12)*(X^4 + X^5 + X^6 + X^7 + X^9 + X3 + X4 + X5 + X6 + X8 + X9 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a4, a7, a8, a10, a12), mzd_sum(t2, 6, b0, b4, b7, b8, b10, b12), 0), X, 12, 4, 5, 6, 7, 9, 13, 14, 15, 16, 18, 19, 22); /* (a1 + a4 + a5 + a7 + a9 + a10 + a11 + a12)(b1 + b4 + b5 + b7 + b9 + b10 + b11 + b12)*(X^5 + X^6 + X^7 + X^8 + X0 + X4 + X5 + X6 + X7 + X9 + X^20 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a4, a5, a7, a9, a10, a11, a12), mzd_sum(t2, 8, b1, b4, b5, b7, b9, b10, b11, b12), 0), X, 12, 5, 6, 7, 8, 10, 14, 15, 16, 17, 19, 20, 23); /* (a2 + a5 + a6 + a8 + a10 + a11 + a12)(b2 + b5 + b6 + b8 + b10 + b11 + b12)*(X^2 + X^6 + X^7 + X^8 + X1 + X5 + X6 + X8 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a5, a6, a8, a10, a11, a12), mzd_sum(t2, 7, b2, b5, b6, b8, b10, b11, b12), 0), X, 10, 2, 6, 7, 8, 11, 15, 16, 18, 20, 21); /* (a3 + a6 + a7 + a9 + a11 + a12)(b3 + b6 + b7 + b9 + b11 + b12)*(X^3 + X^7 + X^8 + X^9 + X2 + X6 + X7 + X9 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a3, a6, a7, a9, a11, a12), mzd_sum(t2, 6, b3, b6, b7, b9, b11, b12), 0), X, 10, 3, 7, 8, 9, 12, 16, 17, 19, 21, 22); /* (a0 + a1 + a2 + a3 + a7 + a10 + a11)(b0 + b1 + b2 + b3 + b7 + b10 + b11)*(X^2 + X^3 + X^6 + X^9 + X1 + X2 + X5 + X7 + X8 + X9 + X^20 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a2, a3, a7, a10, a11), mzd_sum(t2, 7, b0, b1, b2, b3, b7, b10, b11), 0), X, 12, 2, 3, 6, 9, 11, 12, 15, 17, 18, 19, 20, 22); /* (a0 + a1 + a5 + a8 + a9 + a11)(b0 + b1 + b5 + b8 + b9 + b11)*(X^2 + X^3 + X^4 + X^6 + X^8 + X0 + X1 + X2 + X3 + X5 + X9 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a5, a8, a9, a11), mzd_sum(t2, 6, b0, b1, b5, b8, b9, b11), 0), X, 12, 2, 3, 4, 6, 8, 10, 11, 12, 13, 15, 19, 23); /* (a0 + a2 + a4 + a5 + a6 + a7 + a11)(b0 + b2 + b4 + b5 + b6 + b7 + b11)*(X^3 + X^5 + X^6 + X^9 + X0 + X2 + X4 + X5 + X^20 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a4, a5, a6, a7, a11), mzd_sum(t2, 7, b0, b2, b4, b5, b6, b7, b11), 0), X, 12, 3, 5, 6, 9, 10, 12, 14, 15, 20, 21, 22, 23); /* (a1 + a3 + a4 + a5 + a6 + a10)(b1 + b3 + b4 + b5 + b6 + b10)*(X^2 + X^4 + X^6 + X^7 + X^9 + X0 + X1 + X3 + X5 + X6 + X7 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a4, a5, a6, a10), mzd_sum(t2, 6, b1, b3, b4, b5, b6, b10), 0), X, 14, 2, 4, 6, 7, 9, 10, 11, 13, 15, 16, 17, 21, 22, 23); /* (a2 + a3 + a5 + a7 + a8 + a9 + a10)(b2 + b3 + b5 + b7 + b8 + b9 + b10)*(X^3 + X^4 + X^5 + X^6 + X^8 + X2 + X3 + X4 + X5 + X7 + X8 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a5, a7, a8, a9, a10), mzd_sum(t2, 7, b2, b3, b5, b7, b8, b9, b10), 0), X, 12, 3, 4, 5, 6, 8, 12, 13, 14, 15, 17, 18, 21); /* (a0 + a4 + a5 + a6 + a7 + a9 + a11 + a12)(b0 + b4 + b5 + b6 + b7 + b9 + b11 + b12)*(X^2 + X^4 + X^5 + X^6 + X^7 + X^9 + X2 + X3 + X5 + X8 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a4, a5, a6, a7, a9, a11, a12), mzd_sum(t2, 8, b0, b4, b5, b6, b7, b9, b11, b12), 0), X, 12, 2, 4, 5, 6, 7, 9, 12, 13, 15, 18, 21, 22); /* (a1 + a5 + a6 + a7 + a8 + a10 + a12)(b1 + b5 + b6 + b7 + b8 + b10 + b12)*(X^3 + X^5 + X^6 + X^7 + X^8 + X0 + X3 + X4 + X6 + X9 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a5, a6, a7, a8, a10, a12), mzd_sum(t2, 7, b1, b5, b6, b7, b8, b10, b12), 0), X, 12, 3, 5, 6, 7, 8, 10, 13, 14, 16, 19, 22, 23); /* (a2 + a6 + a7 + a8 + a9 + a11)(b2 + b6 + b7 + b8 + b9 + b11)*(X^2 + X^4 + X^6 + X^7 + X^8 + X1 + X4 + X5 + X^20 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a6, a7, a8, a9, a11), mzd_sum(t2, 6, b2, b6, b7, b8, b9, b11), 0), X, 10, 2, 4, 6, 7, 8, 11, 14, 15, 20, 23); /* (a3 + a4 + a5 + a6 + a8 + a10 + a11)(b3 + b4 + b5 + b6 + b8 + b10 + b11)*(X^2 + X^3 + X^5 + X^7 + X^8 + X2 + X5 + X6 + X7 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a3, a4, a5, a6, a8, a10, a11), mzd_sum(t2, 7, b3, b4, b5, b6, b8, b10, b11), 0), X, 10, 2, 3, 5, 7, 8, 12, 15, 16, 17, 21); /* (a0 + a1 + a2 + a3 + a5 + a7 + a8 + a11)(b0 + b1 + b2 + b3 + b5 + b7 + b8 + b11)*(X^2 + X^3 + X^4 + X^8 + X^9 + X0 + X2 + X4 + X5 + X6 + X8 + X9 + X^21 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a2, a3, a5, a7, a8, a11), mzd_sum(t2, 8, b0, b1, b2, b3, b5, b7, b8, b11), 0), X, 14, 2, 3, 4, 8, 9, 10, 12, 14, 15, 16, 18, 19, 21, 23); /* (a0 + a1 + a4 + a8 + a9 + a10 + a11)(b0 + b1 + b4 + b8 + b9 + b10 + b11)*(X^3 + X^4 + X^6 + X^8 + X^9 + X3 + X6 + X7 + X8 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a4, a8, a9, a10, a11), mzd_sum(t2, 7, b0, b1, b4, b8, b9, b10, b11), 0), X, 10, 3, 4, 6, 8, 9, 13, 16, 17, 18, 22); /* (a0 + a2 + a4 + a5 + a8 + a12)(b0 + b2 + b4 + b5 + b8 + b12)*(X^4 + X^7 + X^8 + X0 + X1 + X2 + X3 + X7 + X9 + X^20 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a4, a5, a8, a12), mzd_sum(t2, 6, b0, b2, b4, b5, b8, b12), 0), X, 12, 4, 7, 8, 10, 11, 12, 13, 17, 19, 20, 21, 22); /* (a1 + a3 + a4 + a7 + a11 + a12)(b1 + b3 + b4 + b7 + b11 + b12)*(X^5 + X^8 + X^9 + X1 + X2 + X3 + X4 + X8 + X^20 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a4, a7, a11, a12), mzd_sum(t2, 6, b1, b3, b4, b7, b11, b12), 0), X, 12, 5, 8, 9, 11, 12, 13, 14, 18, 20, 21, 22, 23); /* (a2 + a3 + a4 + a5 + a7 + a9 + a10)(b2 + b3 + b4 + b5 + b7 + b9 + b10)*(X^2 + X^5 + X^6 + X^8 + X^9 + X0 + X1 + X5 + X7 + X8 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a4, a5, a7, a9, a10), mzd_sum(t2, 7, b2, b3, b4, b5, b7, b9, b10), 0), X, 12, 2, 5, 6, 8, 9, 10, 11, 15, 17, 18, 19, 20); /* (a0 + a4 + a5 + a9 + a10)(b0 + b4 + b5 + b9 + b10)*(X^5 + X^6 + X0 + X1 + X2 + X3 + X5 + X6 + X7 + X8 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a4, a5, a9, a10), mzd_sum(t2, 5, b0, b4, b5, b9, b10), 0), X, 12, 5, 6, 10, 11, 12, 13, 15, 16, 17, 18, 22, 23); /* (a1 + a4 + a6 + a9 + a11)(b1 + b4 + b6 + b9 + b11)*(X^2 + X^6 + X^7 + X^9 + X1 + X2 + X3 + X4 + X6 + X8 + X9 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a4, a6, a9, a11), mzd_sum(t2, 5, b1, b4, b6, b9, b11), 0), X, 12, 2, 6, 7, 9, 11, 12, 13, 14, 16, 18, 19, 23); /* (a2 + a4 + a7 + a9 + a12)(b2 + b4 + b7 + b9 + b12)*(X^2 + X^3 + X^7 + X^8 + X^9 + X0 + X2 + X3 + X4 + X5 + X9 + X^20) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a4, a7, a9, a12), mzd_sum(t2, 5, b2, b4, b7, b9, b12), 0), X, 12, 2, 3, 7, 8, 9, 10, 12, 13, 14, 15, 19, 20); /* (a3 + a4 + a8 + a9)(b3 + b4 + b8 + b9)*(X^3 + X^4 + X^8 + X^9 + X0 + X1 + X3 + X4 + X5 + X6 + X^20 + X^21) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a3, a4, a8, a9), mzd_sum(t2, 4, b3, b4, b8, b9), 0), X, 12, 3, 4, 8, 9, 10, 11, 13, 14, 15, 16, 20, 21); /* (a0 + a1 + a2 + a3 + a5 + a6 + a7 + a8 + a10 + a11 + a12)(b0 + b1 + b2 + b3 + b5 + b6 + b7 + b8 + b10 + b11 + b12)*(X^4 + X^5 + X^9 + X0 + X1 + X2 + X4 + X5 + X6 + X7 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 11, a0, a1, a2, a3, a5, a6, a7, a8, a10, a11, a12), mzd_sum(t2, 11, b0, b1, b2, b3, b5, b6, b7, b8, b10, b11, b12), 0), X, 12, 4, 5, 9, 10, 11, 12, 14, 15, 16, 17, 21, 22); /* (a0 + a1 + a5 + a6 + a10 + a11)(b0 + b1 + b5 + b6 + b10 + b11)*(X^2 + X^3 + X^4 + X^5 + X^7 + X^8 + X1 + X3 + X6 + X7 + X9 + X^20 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a5, a6, a10, a11), mzd_sum(t2, 6, b0, b1, b5, b6, b10, b11), 0), X, 14, 2, 3, 4, 5, 7, 8, 11, 13, 16, 17, 19, 20, 21, 22); /* (a0 + a2 + a5 + a7 + a10 + a12)(b0 + b2 + b5 + b7 + b10 + b12)*(X^3 + X^5 + X^8 + X2 + X3 + X7 + X^20 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a5, a7, a10, a12), mzd_sum(t2, 6, b0, b2, b5, b7, b10, b12), 0), X, 8, 3, 5, 8, 12, 13, 17, 20, 22); /* (a1 + a3 + a6 + a8 + a11)(b1 + b3 + b6 + b8 + b11)*(X^4 + X^6 + X^9 + X3 + X4 + X8 + X^21 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a3, a6, a8, a11), mzd_sum(t2, 5, b1, b3, b6, b8, b11), 0), X, 8, 4, 6, 9, 13, 14, 18, 21, 23); /* (a2 + a3 + a7 + a8 + a12)(b2 + b3 + b7 + b8 + b12)*(X^2 + X^4 + X^5 + X^6 + X^7 + X0 + X3 + X5 + X7 + X8 + X9 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a3, a7, a8, a12), mzd_sum(t2, 5, b2, b3, b7, b8, b12), 0), X, 14, 2, 4, 5, 6, 7, 10, 13, 15, 17, 18, 19, 21, 22, 23); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba14(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 55 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[ 0]; const mzd_t *a1 = A[ 1]; const mzd_t *a2 = A[ 2]; const mzd_t *a3 = A[ 3]; const mzd_t *a4 = A[ 4]; const mzd_t *a5 = A[ 5]; const mzd_t *a6 = A[ 6]; const mzd_t *a7 = A[ 7]; const mzd_t *a8 = A[ 8]; const mzd_t *a9 = A[ 9]; const mzd_t *a10 = A[10]; const mzd_t *a11 = A[11]; const mzd_t *a12 = A[12]; const mzd_t *a13 = A[13]; const mzd_t *b0 = B[ 0]; const mzd_t *b1 = B[ 1]; const mzd_t *b2 = B[ 2]; const mzd_t *b3 = B[ 3]; const mzd_t *b4 = B[ 4]; const mzd_t *b5 = B[ 5]; const mzd_t *b6 = B[ 6]; const mzd_t *b7 = B[ 7]; const mzd_t *b8 = B[ 8]; const mzd_t *b9 = B[ 9]; const mzd_t *b10 = B[10]; const mzd_t *b11 = B[11]; const mzd_t *b12 = B[12]; const mzd_t *b13 = B[13]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a13)(b13)*(X^2 + X^4 + X^9 + X1 + X7 + X9 + X^24 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a13, b13, 0), X, 8, 2, 4, 9, 11, 17, 19, 24, 26); /* (a0 + a2 + a3 + a5 + a6 + a8 + a9 + a11 + a12)(b0 + b2 + b3 + b5 + b6 + b8 + b9 + b11 + b12)*(X^3 + X^4 + X^5 + X^7 + X^8 + X2 + X3 + X5 + X6 + X^20 + X^21 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a3, a5, a6, a8, a9, a11, a12), mzd_sum(t2, 9, b0, b2, b3, b5, b6, b8, b9, b11, b12), 0), X, 14, 3, 4, 5, 7, 8, 12, 13, 15, 16, 20, 21, 23, 24, 25); /* (a1 + a2 + a4 + a5 + a7 + a8 + a10 + a11 + a13)(b1 + b2 + b4 + b5 + b7 + b8 + b10 + b11 + b13)*(X^2 + X^5 + X^6 + X^8 + X1 + X3 + X4 + X6 + X9 + X^21 + X^22 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a1, a2, a4, a5, a7, a8, a10, a11, a13), mzd_sum(t2, 9, b1, b2, b4, b5, b7, b8, b10, b11, b13), 0), X, 12, 2, 5, 6, 8, 11, 13, 14, 16, 19, 21, 22, 25); /* (a0 + a1 + a3 + a4 + a6 + a7 + a9 + a10 + a12 + a13)(b0 + b1 + b3 + b4 + b6 + b7 + b9 + b10 + b12 + b13)*(X^2 + X^3 + X^4 + X^6 + X^7 + X1 + X2 + X4 + X5 + X9 + X^20 + X^22 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a1, a3, a4, a6, a7, a9, a10, a12, a13), mzd_sum(t2, 10, b0, b1, b3, b4, b6, b7, b9, b10, b12, b13), 0), X, 14, 2, 3, 4, 6, 7, 11, 12, 14, 15, 19, 20, 22, 23, 24); /* (a0)(b0)*(1 + X + X^2 + X^3 + X^7 + X^8 + X^9 + X0 + X5 + X6 + X7 + X8 + X^22 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 16, 0, 1, 2, 3, 7, 8, 9, 10, 15, 16, 17, 18, 22, 23, 24, 25); /* (a1)(b1)*(X + X^3 + X^8 + X0 + X6 + X8 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 8, 1, 3, 8, 10, 16, 18, 23, 25); /* (a0 + a1)(b0 + b1)*(X + X^3 + X^8 + X0 + X6 + X8 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 8, 1, 3, 8, 10, 16, 18, 23, 25); /* (a0 + a3 + a5 + a6 + a7 + a10 + a12 + a13)(b0 + b3 + b5 + b6 + b7 + b10 + b12 + b13)*(X^3 + X^4 + X^6 + X^9 + X8 + X9 + X^21 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a3, a5, a6, a7, a10, a12, a13), mzd_sum(t2, 8, b0, b3, b5, b6, b7, b10, b12, b13), 0), X, 8, 3, 4, 6, 9, 18, 19, 21, 24); /* (a1 + a3 + a4 + a5 + a8 + a10 + a11 + a12)(b1 + b3 + b4 + b5 + b8 + b10 + b11 + b12)*(X^4 + X^5 + X^7 + X0 + X9 + X^20 + X^22 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a4, a5, a8, a10, a11, a12), mzd_sum(t2, 8, b1, b3, b4, b5, b8, b10, b11, b12), 0), X, 8, 4, 5, 7, 10, 19, 20, 22, 25); /* (a2 + a4 + a5 + a6 + a9 + a11 + a12 + a13)(b2 + b4 + b5 + b6 + b9 + b11 + b12 + b13)*(X^2 + X^4 + X^5 + X^6 + X^8 + X^9 + X7 + X9 + X^20 + X^21 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a4, a5, a6, a9, a11, a12, a13), mzd_sum(t2, 8, b2, b4, b5, b6, b9, b11, b12, b13), 0), X, 12, 2, 4, 5, 6, 8, 9, 17, 19, 20, 21, 23, 24); /* (a0 + a1 + a4 + a6 + a7 + a8 + a11 + a13)(b0 + b1 + b4 + b6 + b7 + b8 + b11 + b13)*(X^3 + X^5 + X^6 + X^7 + X^9 + X0 + X8 + X^20 + X^21 + X^22 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a4, a6, a7, a8, a11, a13), mzd_sum(t2, 8, b0, b1, b4, b6, b7, b8, b11, b13), 0), X, 12, 3, 5, 6, 7, 9, 10, 18, 20, 21, 22, 24, 25); /* (a0 + a2 + a3 + a4 + a7 + a9 + a10 + a11)(b0 + b2 + b3 + b4 + b7 + b9 + b10 + b11)*(X^2 + X^6 + X^7 + X^8 + X^9 + X0 + X7 + X^21 + X^22 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a3, a4, a7, a9, a10, a11), mzd_sum(t2, 8, b0, b2, b3, b4, b7, b9, b10, b11), 0), X, 12, 2, 6, 7, 8, 9, 10, 17, 21, 22, 23, 24, 25); /* (a1 + a2 + a3 + a6 + a8 + a9 + a10 + a13)(b1 + b2 + b3 + b6 + b8 + b9 + b10 + b13)*(X^2 + X^3 + X^4 + X^7 + X^8 + X0 + X7 + X8 + X9 + X^22 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a3, a6, a8, a9, a10, a13), mzd_sum(t2, 8, b1, b2, b3, b6, b8, b9, b10, b13), 0), X, 12, 2, 3, 4, 7, 8, 10, 17, 18, 19, 22, 23, 25); /* (a0 + a3 + a4 + a5 + a7 + a10 + a11 + a12)(b0 + b3 + b4 + b5 + b7 + b10 + b11 + b12)*(X^2 + X^3 + X^4 + X^5 + X^6 + X0 + X7 + X8 + X9 + X^20 + X^21 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a3, a4, a5, a7, a10, a11, a12), mzd_sum(t2, 8, b0, b3, b4, b5, b7, b10, b11, b12), 0), X, 12, 2, 3, 4, 5, 6, 10, 17, 18, 19, 20, 21, 25); /* (a1 + a4 + a5 + a6 + a8 + a11 + a12 + a13)(b1 + b4 + b5 + b6 + b8 + b11 + b12 + b13)*(X^2 + X^3 + X^5 + X^6 + X^7 + X^9 + X7 + X8 + X^20 + X^21 + X^22 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a4, a5, a6, a8, a11, a12, a13), mzd_sum(t2, 8, b1, b4, b5, b6, b8, b11, b12, b13), 0), X, 12, 2, 3, 5, 6, 7, 9, 17, 18, 20, 21, 22, 24); /* (a2 + a3 + a4 + a6 + a9 + a10 + a11 + a13)(b2 + b3 + b4 + b6 + b9 + b10 + b11 + b13)*(X^3 + X^4 + X^6 + X^7 + X^8 + X0 + X8 + X9 + X^21 + X^22 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a4, a6, a9, a10, a11, a13), mzd_sum(t2, 8, b2, b3, b4, b6, b9, b10, b11, b13), 0), X, 12, 3, 4, 6, 7, 8, 10, 18, 19, 21, 22, 23, 25); /* (a0 + a1 + a3 + a6 + a7 + a8 + a10 + a13)(b0 + b1 + b3 + b6 + b7 + b8 + b10 + b13)*(X^3 + X^6 + X^8 + X^9 + X8 + X^21 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a3, a6, a7, a8, a10, a13), mzd_sum(t2, 8, b0, b1, b3, b6, b7, b8, b10, b13), 0), X, 8, 3, 6, 8, 9, 18, 21, 23, 24); /* (a0 + a2 + a5 + a6 + a7 + a9 + a12 + a13)(b0 + b2 + b5 + b6 + b7 + b9 + b12 + b13)*(X^4 + X^7 + X^9 + X0 + X9 + X^22 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a5, a6, a7, a9, a12, a13), mzd_sum(t2, 8, b0, b2, b5, b6, b7, b9, b12, b13), 0), X, 8, 4, 7, 9, 10, 19, 22, 24, 25); /* (a1 + a2 + a3 + a5 + a8 + a9 + a10 + a12)(b1 + b2 + b3 + b5 + b8 + b9 + b10 + b12)*(X^2 + X^4 + X^5 + X^8 + X^9 + X0 + X7 + X9 + X^20 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a3, a5, a8, a9, a10, a12), mzd_sum(t2, 8, b1, b2, b3, b5, b8, b9, b10, b12), 0), X, 12, 2, 4, 5, 8, 9, 10, 17, 19, 20, 23, 24, 25); /* (a0 + a4 + a7 + a8 + a10 + a12 + a13)(b0 + b4 + b7 + b8 + b10 + b12 + b13)*(X^3 + X^4 + X^5 + X^6 + X^7 + X^9 + X0 + X3 + X4 + X5 + X6 + X9 + X^22 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a4, a7, a8, a10, a12, a13), mzd_sum(t2, 7, b0, b4, b7, b8, b10, b12, b13), 0), X, 14, 3, 4, 5, 6, 7, 9, 10, 13, 14, 15, 16, 19, 22, 25); /* (a1 + a4 + a5 + a7 + a9 + a10 + a11 + a12)(b1 + b4 + b5 + b7 + b9 + b10 + b11 + b12)*(X^2 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X4 + X5 + X6 + X9 + X^20 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a4, a5, a7, a9, a10, a11, a12), mzd_sum(t2, 8, b1, b4, b5, b7, b9, b10, b11, b12), 0), X, 14, 2, 5, 6, 7, 8, 9, 10, 14, 15, 16, 19, 20, 23, 24); /* (a2 + a5 + a6 + a8 + a10 + a11 + a12 + a13)(b2 + b5 + b6 + b8 + b10 + b11 + b12 + b13)*(X^3 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X5 + X6 + X7 + X^20 + X^21 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a5, a6, a8, a10, a11, a12, a13), mzd_sum(t2, 8, b2, b5, b6, b8, b10, b11, b12, b13), 0), X, 14, 3, 6, 7, 8, 9, 10, 11, 15, 16, 17, 20, 21, 24, 25); /* (a3 + a6 + a7 + a9 + a11 + a12 + a13)(b3 + b6 + b7 + b9 + b11 + b12 + b13)*(X^2 + X^7 + X^8 + X0 + X2 + X6 + X8 + X9 + X^21 + X^22 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a3, a6, a7, a9, a11, a12, a13), mzd_sum(t2, 7, b3, b6, b7, b9, b11, b12, b13), 0), X, 12, 2, 7, 8, 10, 12, 16, 18, 19, 21, 22, 24, 25); /* (a0 + a1 + a2 + a3 + a7 + a10 + a11 + a13)(b0 + b1 + b2 + b3 + b7 + b10 + b11 + b13)*(X^2 + X^3 + X^6 + X^9 + X1 + X2 + X5 + X7 + X8 + X9 + X^20 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a2, a3, a7, a10, a11, a13), mzd_sum(t2, 8, b0, b1, b2, b3, b7, b10, b11, b13), 0), X, 12, 2, 3, 6, 9, 11, 12, 15, 17, 18, 19, 20, 22); /* (a0 + a1 + a5 + a8 + a9 + a11 + a13)(b0 + b1 + b5 + b8 + b9 + b11 + b13)*(X^4 + X^6 + X^8 + X^9 + X1 + X2 + X3 + X5 + X7 + X8 + X9 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a5, a8, a9, a11, a13), mzd_sum(t2, 7, b0, b1, b5, b8, b9, b11, b13), 0), X, 14, 4, 6, 8, 9, 11, 12, 13, 15, 17, 18, 19, 23, 24, 25); /* (a0 + a2 + a4 + a5 + a6 + a7 + a11)(b0 + b2 + b4 + b5 + b6 + b7 + b11)*(X^5 + X^6 + X^9 + X2 + X4 + X5 + X8 + X^20 + X^21 + X^22 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a4, a5, a6, a7, a11), mzd_sum(t2, 7, b0, b2, b4, b5, b6, b7, b11), 0), X, 12, 5, 6, 9, 12, 14, 15, 18, 20, 21, 22, 23, 25); /* (a1 + a3 + a4 + a5 + a6 + a10 + a13)(b1 + b3 + b4 + b5 + b6 + b10 + b13)*(X^2 + X^4 + X^6 + X^7 + X^9 + X0 + X1 + X3 + X5 + X6 + X7 + X^21 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a3, a4, a5, a6, a10, a13), mzd_sum(t2, 7, b1, b3, b4, b5, b6, b10, b13), 0), X, 14, 2, 4, 6, 7, 9, 10, 11, 13, 15, 16, 17, 21, 22, 23); /* (a2 + a3 + a5 + a7 + a8 + a9 + a10)(b2 + b3 + b5 + b7 + b8 + b9 + b10)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^8 + X^9 + X2 + X3 + X4 + X5 + X8 + X^21 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a3, a5, a7, a8, a9, a10), mzd_sum(t2, 7, b2, b3, b5, b7, b8, b9, b10), 0), X, 14, 2, 3, 4, 5, 6, 8, 9, 12, 13, 14, 15, 18, 21, 24); /* (a0 + a4 + a5 + a6 + a7 + a9 + a11 + a12)(b0 + b4 + b5 + b6 + b7 + b9 + b11 + b12)*(X^2 + X^4 + X^5 + X^6 + X^7 + X^9 + X2 + X3 + X5 + X8 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a4, a5, a6, a7, a9, a11, a12), mzd_sum(t2, 8, b0, b4, b5, b6, b7, b9, b11, b12), 0), X, 12, 2, 4, 5, 6, 7, 9, 12, 13, 15, 18, 21, 22); /* (a1 + a5 + a6 + a7 + a8 + a10 + a12 + a13)(b1 + b5 + b6 + b7 + b8 + b10 + b12 + b13)*(X^3 + X^5 + X^6 + X^7 + X^8 + X0 + X3 + X4 + X6 + X9 + X^22 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a5, a6, a7, a8, a10, a12, a13), mzd_sum(t2, 8, b1, b5, b6, b7, b8, b10, b12, b13), 0), X, 12, 3, 5, 6, 7, 8, 10, 13, 14, 16, 19, 22, 23); /* (a2 + a6 + a7 + a8 + a9 + a11 + a13)(b2 + b6 + b7 + b8 + b9 + b11 + b13)*(X^4 + X^6 + X^7 + X^8 + X^9 + X1 + X4 + X5 + X7 + X^20 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a2, a6, a7, a8, a9, a11, a13), mzd_sum(t2, 7, b2, b6, b7, b8, b9, b11, b13), 0), X, 12, 4, 6, 7, 8, 9, 11, 14, 15, 17, 20, 23, 24); /* (a3 + a4 + a5 + a6 + a8 + a10 + a11)(b3 + b4 + b5 + b6 + b8 + b10 + b11)*(X^5 + X^7 + X^8 + X^9 + X0 + X2 + X5 + X6 + X8 + X^21 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a3, a4, a5, a6, a8, a10, a11), mzd_sum(t2, 7, b3, b4, b5, b6, b8, b10, b11), 0), X, 12, 5, 7, 8, 9, 10, 12, 15, 16, 18, 21, 24, 25); /* (a0 + a1 + a2 + a3 + a5 + a7 + a8 + a11)(b0 + b1 + b2 + b3 + b5 + b7 + b8 + b11)*(X^2 + X^3 + X^4 + X^8 + X^9 + X0 + X2 + X4 + X5 + X6 + X8 + X9 + X^21 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a2, a3, a5, a7, a8, a11), mzd_sum(t2, 8, b0, b1, b2, b3, b5, b7, b8, b11), 0), X, 14, 2, 3, 4, 8, 9, 10, 12, 14, 15, 16, 18, 19, 21, 23); /* (a0 + a1 + a4 + a8 + a9 + a10 + a11 + a13)(b0 + b1 + b4 + b8 + b9 + b10 + b11 + b13)*(X^2 + X^4 + X^6 + X^8 + X0 + X3 + X6 + X^22 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a4, a8, a9, a10, a11, a13), mzd_sum(t2, 8, b0, b1, b4, b8, b9, b10, b11, b13), 0), X, 10, 2, 4, 6, 8, 10, 13, 16, 22, 24, 25); /* (a0 + a2 + a4 + a5 + a8 + a12 + a13)(b0 + b2 + b4 + b5 + b8 + b12 + b13)*(X^3 + X^4 + X^7 + X^8 + X1 + X2 + X3 + X7 + X8 + X9 + X^20 + X^21 + X^22 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a4, a5, a8, a12, a13), mzd_sum(t2, 7, b0, b2, b4, b5, b8, b12, b13), 0), X, 14, 3, 4, 7, 8, 11, 12, 13, 17, 18, 19, 20, 21, 22, 25); /* (a1 + a3 + a4 + a7 + a11 + a12 + a13)(b1 + b3 + b4 + b7 + b11 + b12 + b13)*(X^2 + X^5 + X^8 + X1 + X2 + X3 + X4 + X7 + X8 + X^20 + X^21 + X^22 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a3, a4, a7, a11, a12, a13), mzd_sum(t2, 7, b1, b3, b4, b7, b11, b12, b13), 0), X, 14, 2, 5, 8, 11, 12, 13, 14, 17, 18, 20, 21, 22, 23, 24); /* (a2 + a3 + a4 + a5 + a7 + a9 + a10 + a13)(b2 + b3 + b4 + b5 + b7 + b9 + b10 + b13)*(X^2 + X^3 + X^5 + X^6 + X^8 + X^9 + X1 + X5 + X7 + X9 + X^20 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a4, a5, a7, a9, a10, a13), mzd_sum(t2, 8, b2, b3, b4, b5, b7, b9, b10, b13), 0), X, 12, 2, 3, 5, 6, 8, 9, 11, 15, 17, 19, 20, 25); /* (a0 + a4 + a5 + a9 + a10)(b0 + b4 + b5 + b9 + b10)*(X^3 + X^5 + X^6 + X1 + X2 + X3 + X5 + X6 + X7 + X^22 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a0, a4, a5, a9, a10), mzd_sum(t2, 5, b0, b4, b5, b9, b10), 0), X, 12, 3, 5, 6, 11, 12, 13, 15, 16, 17, 22, 23, 25); /* (a1 + a4 + a6 + a9 + a11)(b1 + b4 + b6 + b9 + b11)*(X^2 + X^6 + X^7 + X^9 + X1 + X2 + X3 + X4 + X6 + X8 + X9 + X^23) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a4, a6, a9, a11), mzd_sum(t2, 5, b1, b4, b6, b9, b11), 0), X, 12, 2, 6, 7, 9, 11, 12, 13, 14, 16, 18, 19, 23); /* (a2 + a4 + a7 + a9 + a12)(b2 + b4 + b7 + b9 + b12)*(X^3 + X^7 + X^8 + X0 + X2 + X3 + X4 + X5 + X7 + X9 + X^20 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a2, a4, a7, a9, a12), mzd_sum(t2, 5, b2, b4, b7, b9, b12), 0), X, 12, 3, 7, 8, 10, 12, 13, 14, 15, 17, 19, 20, 24); /* (a3 + a4 + a8 + a9 + a13)(b3 + b4 + b8 + b9 + b13)*(X^4 + X^8 + X^9 + X1 + X3 + X4 + X5 + X6 + X8 + X^20 + X^21 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a3, a4, a8, a9, a13), mzd_sum(t2, 5, b3, b4, b8, b9, b13), 0), X, 12, 4, 8, 9, 11, 13, 14, 15, 16, 18, 20, 21, 25); /* (a0 + a1 + a2 + a3 + a5 + a6 + a7 + a8 + a10 + a11 + a12 + a13)(b0 + b1 + b2 + b3 + b5 + b6 + b7 + b8 + b10 + b11 + b12 + b13)*(X^2 + X^4 + X^5 + X0 + X1 + X2 + X4 + X5 + X6 + X^21 + X^22 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 12, a0, a1, a2, a3, a5, a6, a7, a8, a10, a11, a12, a13), mzd_sum(t2, 12, b0, b1, b2, b3, b5, b6, b7, b8, b10, b11, b12, b13), 0), X, 12, 2, 4, 5, 10, 11, 12, 14, 15, 16, 21, 22, 24); /* (a0 + a1 + a5 + a6 + a10 + a11)(b0 + b1 + b5 + b6 + b10 + b11)*(X^2 + X^3 + X^4 + X^5 + X^7 + X^8 + X1 + X3 + X6 + X7 + X9 + X^20 + X^21 + X^22) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a5, a6, a10, a11), mzd_sum(t2, 6, b0, b1, b5, b6, b10, b11), 0), X, 14, 2, 3, 4, 5, 7, 8, 11, 13, 16, 17, 19, 20, 21, 22); /* (a0 + a2 + a5 + a7 + a10 + a12)(b0 + b2 + b5 + b7 + b10 + b12)*(X^2 + X^5 + X^8 + X^9 + X0 + X2 + X3 + X8 + X^20 + X^22 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a5, a7, a10, a12), mzd_sum(t2, 6, b0, b2, b5, b7, b10, b12), 0), X, 12, 2, 5, 8, 9, 10, 12, 13, 18, 20, 22, 24, 25); /* (a1 + a3 + a6 + a8 + a11 + a13)(b1 + b3 + b6 + b8 + b11 + b13)*(X^2 + X^3 + X^4 + X^6 + X0 + X3 + X4 + X7 + X^21 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a6, a8, a11, a13), mzd_sum(t2, 6, b1, b3, b6, b8, b11, b13), 0), X, 12, 2, 3, 4, 6, 10, 13, 14, 17, 21, 23, 24, 25); /* (a2 + a3 + a7 + a8 + a12 + a13)(b2 + b3 + b7 + b8 + b12 + b13)*(X^4 + X^5 + X^6 + X^7 + X^9 + X0 + X3 + X5 + X8 + X9 + X^21 + X^22 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a3, a7, a8, a12, a13), mzd_sum(t2, 6, b2, b3, b7, b8, b12, b13), 0), X, 14, 4, 5, 6, 7, 9, 10, 13, 15, 18, 19, 21, 22, 23, 24); /* (a0 + a4 + a8 + a12)(b0 + b4 + b8 + b12)*(X^2 + X^3 + X^9 + X0 + X7 + X8 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a0, a4, a8, a12), mzd_sum(t2, 4, b0, b4, b8, b12), 0), X, 8, 2, 3, 9, 10, 17, 18, 24, 25); /* (a1 + a5 + a9 + a13)(b1 + b5 + b9 + b13)*(X^2 + X^3 + X^9 + X0 + X7 + X8 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 4, a1, a5, a9, a13), mzd_sum(t2, 4, b1, b5, b9, b13), 0), X, 8, 2, 3, 9, 10, 17, 18, 24, 25); /* (a2 + a6 + a10)(b2 + b6 + b10)*(X^2 + X^3 + X^9 + X0 + X7 + X8 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a2, a6, a10), mzd_sum(t2, 3, b2, b6, b10), 0), X, 8, 2, 3, 9, 10, 17, 18, 24, 25); /* (a3 + a7 + a11)(b3 + b7 + b11)*(X^2 + X^3 + X^9 + X0 + X7 + X8 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 3, a3, a7, a11), mzd_sum(t2, 3, b3, b7, b11), 0), X, 8, 2, 3, 9, 10, 17, 18, 24, 25); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12 + a13)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 + b12 + b13)*(X^5 + X^7 + X^9 + X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 + X^21 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 14, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13), mzd_sum(t2, 14, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13), 0), X, 15, 5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25); /* (a0 + a1 + a4 + a5 + a8 + a9 + a12 + a13)(b0 + b1 + b4 + b5 + b8 + b9 + b12 + b13)*(X^3 + X0 + X8 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a4, a5, a8, a9, a12, a13), mzd_sum(t2, 8, b0, b1, b4, b5, b8, b9, b12, b13), 0), X, 4, 3, 10, 18, 25); /* (a0 + a2 + a4 + a6 + a8 + a10 + a12)(b0 + b2 + b4 + b6 + b8 + b10 + b12)*(X^4 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X9 + X^20 + X^21 + X^22 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a4, a6, a8, a10, a12), mzd_sum(t2, 7, b0, b2, b4, b6, b8, b10, b12), 0), X, 14, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23, 24, 25); /* (a1 + a3 + a5 + a7 + a9 + a11 + a13)(b1 + b3 + b5 + b7 + b9 + b11 + b13)*(X^2 + X^4 + X^5 + X^6 + X^7 + X^8 + X0 + X7 + X9 + X^20 + X^21 + X^22 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a3, a5, a7, a9, a11, a13), mzd_sum(t2, 7, b1, b3, b5, b7, b9, b11, b13), 0), X, 14, 2, 4, 5, 6, 7, 8, 10, 17, 19, 20, 21, 22, 23, 25); /* (a2 + a3 + a6 + a7 + a10 + a11)(b2 + b3 + b6 + b7 + b10 + b11)*(X^3 + X0 + X8 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a3, a6, a7, a10, a11), mzd_sum(t2, 6, b2, b3, b6, b7, b10, b11), 0), X, 4, 3, 10, 18, 25); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba15(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 60 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[ 0]; const mzd_t *a1 = A[ 1]; const mzd_t *a2 = A[ 2]; const mzd_t *a3 = A[ 3]; const mzd_t *a4 = A[ 4]; const mzd_t *a5 = A[ 5]; const mzd_t *a6 = A[ 6]; const mzd_t *a7 = A[ 7]; const mzd_t *a8 = A[ 8]; const mzd_t *a9 = A[ 9]; const mzd_t *a10 = A[10]; const mzd_t *a11 = A[11]; const mzd_t *a12 = A[12]; const mzd_t *a13 = A[13]; const mzd_t *a14 = A[14]; const mzd_t *b0 = B[ 0]; const mzd_t *b1 = B[ 1]; const mzd_t *b2 = B[ 2]; const mzd_t *b3 = B[ 3]; const mzd_t *b4 = B[ 4]; const mzd_t *b5 = B[ 5]; const mzd_t *b6 = B[ 6]; const mzd_t *b7 = B[ 7]; const mzd_t *b8 = B[ 8]; const mzd_t *b9 = B[ 9]; const mzd_t *b10 = B[10]; const mzd_t *b11 = B[11]; const mzd_t *b12 = B[12]; const mzd_t *b13 = B[13]; const mzd_t *b14 = B[14]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a14)(b14)*(X + X^3 + X^6 + X^8 + X0 + X3 + X6 + X8 + X^21 + X^23 + X^25 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a14, b14, 0), X, 12, 1, 3, 6, 8, 10, 13, 16, 18, 21, 23, 25, 28); /* (a0)(b0)*(1 + X^2 + X^5 + X^7 + X^9 + X2 + X5 + X7 + X^20 + X^22 + X^24 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 12, 0, 2, 5, 7, 9, 12, 15, 17, 20, 22, 24, 27); /* (a0 + a2 + a3 + a5 + a6 + a8 + a9 + a11 + a12 + a14)(b0 + b2 + b3 + b5 + b6 + b8 + b9 + b11 + b12 + b14)*(X + X^2 + X^3 + X^5 + X^7 + X^9 + X1 + X2 + X3 + X5 + X7 + X9 + X^20 + X^21 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a2, a3, a5, a6, a8, a9, a11, a12, a14), mzd_sum(t2, 10, b0, b2, b3, b5, b6, b8, b9, b11, b12, b14), 0), X, 16, 1, 2, 3, 5, 7, 9, 11, 12, 13, 15, 17, 19, 20, 21, 25, 26); /* (a1 + a2 + a4 + a5 + a7 + a8 + a10 + a11 + a13 + a14)(b1 + b2 + b4 + b5 + b7 + b8 + b10 + b11 + b13 + b14)*(X^2 + X^3 + X^4 + X^6 + X^8 + X0 + X2 + X3 + X4 + X6 + X8 + X^20 + X^21 + X^22 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a1, a2, a4, a5, a7, a8, a10, a11, a13, a14), mzd_sum(t2, 10, b1, b2, b4, b5, b7, b8, b10, b11, b13, b14), 0), X, 16, 2, 3, 4, 6, 8, 10, 12, 13, 14, 16, 18, 20, 21, 22, 26, 27); /* (a0 + a1 + a3 + a4 + a6 + a7 + a9 + a10 + a12 + a13)(b0 + b1 + b3 + b4 + b6 + b7 + b9 + b10 + b12 + b13)*(X + X^4 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X4 + X5 + X6 + X7 + X8 + X9 + X^22 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a1, a3, a4, a6, a7, a9, a10, a12, a13), mzd_sum(t2, 10, b0, b1, b3, b4, b6, b7, b9, b10, b12, b13), 0), X, 18, 1, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 22, 25, 27); /* (a0 + a2 + a4 + a6 + a8 + a10 + a12 + a14)(b0 + b2 + b4 + b6 + b8 + b10 + b12 + b14)*(X + X^2 + X^6 + X^7 + X0 + X1 + X2 + X6 + X7 + X^21 + X^22 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a4, a6, a8, a10, a12, a14), mzd_sum(t2, 8, b0, b2, b4, b6, b8, b10, b12, b14), 0), X, 14, 1, 2, 6, 7, 10, 11, 12, 16, 17, 21, 22, 25, 26, 27); /* (a1 + a3 + a5 + a7 + a9 + a11 + a13)(b1 + b3 + b5 + b7 + b9 + b11 + b13)*(X + X^2 + X^6 + X^7 + X0 + X1 + X2 + X6 + X7 + X^21 + X^22 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a3, a5, a7, a9, a11, a13), mzd_sum(t2, 7, b1, b3, b5, b7, b9, b11, b13), 0), X, 14, 1, 2, 6, 7, 10, 11, 12, 16, 17, 21, 22, 25, 26, 27); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12 + a13 + a14)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 + b12 + b13 + b14)*(X^2 + X^7 + X1 + X3 + X4 + X5 + X6 + X8 + X9 + X^20 + X^21 + X^23 + X^24 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 15, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14), mzd_sum(t2, 15, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14), 0), X, 15, 2, 7, 11, 13, 14, 15, 16, 18, 19, 20, 21, 23, 24, 25, 27); /* (a0 + a3 + a5 + a6 + a7 + a10 + a12 + a13 + a14)(b0 + b3 + b5 + b6 + b7 + b10 + b12 + b13 + b14)*(X + X^2 + X^4 + X^6 + X^8 + X0 + X6 + X7 + X9 + X^21 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a3, a5, a6, a7, a10, a12, a13, a14), mzd_sum(t2, 9, b0, b3, b5, b6, b7, b10, b12, b13, b14), 0), X, 12, 1, 2, 4, 6, 8, 10, 16, 17, 19, 21, 23, 25); /* (a1 + a3 + a4 + a5 + a8 + a10 + a11 + a12)(b1 + b3 + b4 + b5 + b8 + b10 + b11 + b12)*(X^2 + X^3 + X^5 + X^7 + X^9 + X1 + X7 + X8 + X^20 + X^22 + X^24 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a4, a5, a8, a10, a11, a12), mzd_sum(t2, 8, b1, b3, b4, b5, b8, b10, b11, b12), 0), X, 12, 2, 3, 5, 7, 9, 11, 17, 18, 20, 22, 24, 26); /* (a2 + a4 + a5 + a6 + a9 + a11 + a12 + a13)(b2 + b4 + b5 + b6 + b9 + b11 + b12 + b13)*(X^3 + X^4 + X^6 + X^8 + X0 + X2 + X8 + X9 + X^21 + X^23 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a4, a5, a6, a9, a11, a12, a13), mzd_sum(t2, 8, b2, b4, b5, b6, b9, b11, b12, b13), 0), X, 12, 3, 4, 6, 8, 10, 12, 18, 19, 21, 23, 25, 27); /* (a0 + a1 + a4 + a6 + a7 + a8 + a11 + a13 + a14)(b0 + b1 + b4 + b6 + b7 + b8 + b11 + b13 + b14)*(X + X^3 + X^4 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X6 + X8 + X9 + X^20 + X^21 + X^22 + X^23 + X^24 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a4, a6, a7, a8, a11, a13, a14), mzd_sum(t2, 9, b0, b1, b4, b6, b7, b8, b11, b13, b14), 0), X, 20, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26); /* (a0 + a2 + a3 + a4 + a7 + a9 + a10 + a11 + a14)(b0 + b2 + b3 + b4 + b7 + b9 + b10 + b11 + b14)*(X^2 + X^4 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X2 + X7 + X9 + X^20 + X^21 + X^22 + X^23 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a3, a4, a7, a9, a10, a11, a14), mzd_sum(t2, 9, b0, b2, b3, b4, b7, b9, b10, b11, b14), 0), X, 20, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27); /* (a1 + a2 + a3 + a6 + a8 + a9 + a10 + a13)(b1 + b2 + b3 + b6 + b8 + b9 + b10 + b13)*(X + X^5 + X^7 + X^9 + X1 + X2 + X6 + X^20 + X^22 + X^24 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a3, a6, a8, a9, a10, a13), mzd_sum(t2, 8, b1, b2, b3, b6, b8, b9, b10, b13), 0), X, 12, 1, 5, 7, 9, 11, 12, 16, 20, 22, 24, 26, 27); /* (a0 + a3 + a4 + a5 + a7 + a10 + a11 + a12 + a14)(b0 + b3 + b4 + b5 + b7 + b10 + b11 + b12 + b14)*(X^3 + X^6 + X^9 + X0 + X1 + X2 + X8 + X^21 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a3, a4, a5, a7, a10, a11, a12, a14), mzd_sum(t2, 9, b0, b3, b4, b5, b7, b10, b11, b12, b14), 0), X, 12, 3, 6, 9, 10, 11, 12, 18, 21, 24, 25, 26, 27); /* (a1 + a4 + a5 + a6 + a8 + a11 + a12 + a13)(b1 + b4 + b5 + b6 + b8 + b11 + b12 + b13)*(X + X^3 + X^4 + X^6 + X^7 + X^8 + X1 + X2 + X6 + X8 + X9 + X^21 + X^22 + X^23 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a4, a5, a6, a8, a11, a12, a13), mzd_sum(t2, 8, b1, b4, b5, b6, b8, b11, b12, b13), 0), X, 16, 1, 3, 4, 6, 7, 8, 11, 12, 16, 18, 19, 21, 22, 23, 26, 27); /* (a2 + a3 + a4 + a6 + a9 + a10 + a11 + a13)(b2 + b3 + b4 + b6 + b9 + b10 + b11 + b13)*(X + X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^9 + X0 + X2 + X6 + X7 + X8 + X9 + X^20 + X^21 + X^22 + X^24 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a4, a6, a9, a10, a11, a13), mzd_sum(t2, 8, b2, b3, b4, b6, b9, b10, b11, b13), 0), X, 20, 1, 2, 3, 4, 5, 6, 7, 9, 10, 12, 16, 17, 18, 19, 20, 21, 22, 24, 25, 27); /* (a0 + a1 + a3 + a6 + a7 + a8 + a10 + a13 + a14)(b0 + b1 + b3 + b6 + b7 + b8 + b10 + b13 + b14)*(X^2 + X^3 + X^5 + X^6 + X^8 + X2 + X7 + X8 + X^20 + X^21 + X^23 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a3, a6, a7, a8, a10, a13, a14), mzd_sum(t2, 9, b0, b1, b3, b6, b7, b8, b10, b13, b14), 0), X, 12, 2, 3, 5, 6, 8, 12, 17, 18, 20, 21, 23, 27); /* (a0 + a2 + a5 + a6 + a7 + a9 + a12 + a13 + a14)(b0 + b2 + b5 + b6 + b7 + b9 + b12 + b13 + b14)*(X + X^4 + X^7 + X^8 + X^9 + X0 + X6 + X9 + X^22 + X^23 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a5, a6, a7, a9, a12, a13, a14), mzd_sum(t2, 9, b0, b2, b5, b6, b7, b9, b12, b13, b14), 0), X, 12, 1, 4, 7, 8, 9, 10, 16, 19, 22, 23, 24, 25); /* (a1 + a2 + a3 + a5 + a8 + a9 + a10 + a12)(b1 + b2 + b3 + b5 + b8 + b9 + b10 + b12)*(X^2 + X^5 + X^8 + X^9 + X0 + X1 + X7 + X^20 + X^23 + X^24 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a3, a5, a8, a9, a10, a12), mzd_sum(t2, 8, b1, b2, b3, b5, b8, b9, b10, b12), 0), X, 12, 2, 5, 8, 9, 10, 11, 17, 20, 23, 24, 25, 26); /* (a0 + a4 + a7 + a8 + a10 + a12 + a13 + a14)(b0 + b4 + b7 + b8 + b10 + b12 + b13 + b14)*(X + X^2 + X^4 + X^6 + X^7 + X^8 + X2 + X3 + X4 + X5 + X7 + X8 + X9 + X^20 + X^22 + X^23 + X^24 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a4, a7, a8, a10, a12, a13, a14), mzd_sum(t2, 8, b0, b4, b7, b8, b10, b12, b13, b14), 0), X, 18, 1, 2, 4, 6, 7, 8, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 24, 27); /* (a1 + a4 + a5 + a7 + a9 + a10 + a11 + a12)(b1 + b4 + b5 + b7 + b9 + b10 + b11 + b12)*(X + X^2 + X^5 + X^6 + X^7 + X^9 + X0 + X4 + X5 + X9 + X^20 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a4, a5, a7, a9, a10, a11, a12), mzd_sum(t2, 8, b1, b4, b5, b7, b9, b10, b11, b12), 0), X, 12, 1, 2, 5, 6, 7, 9, 10, 14, 15, 19, 20, 24); /* (a2 + a5 + a6 + a8 + a10 + a11 + a12 + a13)(b2 + b5 + b6 + b8 + b10 + b11 + b12 + b13)*(X^2 + X^3 + X^6 + X^7 + X^8 + X0 + X1 + X5 + X6 + X^20 + X^21 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a5, a6, a8, a10, a11, a12, a13), mzd_sum(t2, 8, b2, b5, b6, b8, b10, b11, b12, b13), 0), X, 12, 2, 3, 6, 7, 8, 10, 11, 15, 16, 20, 21, 25); /* (a3 + a6 + a7 + a9 + a11 + a12 + a13 + a14)(b3 + b6 + b7 + b9 + b11 + b12 + b13 + b14)*(X^3 + X^4 + X^7 + X^8 + X^9 + X1 + X2 + X6 + X7 + X^21 + X^22 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a3, a6, a7, a9, a11, a12, a13, a14), mzd_sum(t2, 8, b3, b6, b7, b9, b11, b12, b13, b14), 0), X, 12, 3, 4, 7, 8, 9, 11, 12, 16, 17, 21, 22, 26); /* (a0 + a1 + a2 + a3 + a7 + a10 + a11 + a13)(b0 + b1 + b2 + b3 + b7 + b10 + b11 + b13)*(X^2 + X^4 + X^6 + X^9 + X0 + X2 + X5 + X7 + X^20 + X^22 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a2, a3, a7, a10, a11, a13), mzd_sum(t2, 8, b0, b1, b2, b3, b7, b10, b11, b13), 0), X, 12, 2, 4, 6, 9, 10, 12, 15, 17, 20, 22, 25, 26); /* (a0 + a1 + a5 + a8 + a9 + a11 + a13 + a14)(b0 + b1 + b5 + b8 + b9 + b11 + b13 + b14)*(X^2 + X^5 + X^6 + X^8 + X3 + X5 + X8 + X^20 + X^23 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a5, a8, a9, a11, a13, a14), mzd_sum(t2, 8, b0, b1, b5, b8, b9, b11, b13, b14), 0), X, 12, 2, 5, 6, 8, 13, 15, 18, 20, 23, 25, 26, 27); /* (a0 + a2 + a4 + a5 + a6 + a7 + a11 + a14)(b0 + b2 + b4 + b5 + b6 + b7 + b11 + b14)*(X + X^2 + X^3 + X^4 + X^5 + X^6 + X^8 + X0 + X1 + X2 + X4 + X5 + X6 + X7 + X9 + X^20 + X^21 + X^22 + X^24 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a4, a5, a6, a7, a11, a14), mzd_sum(t2, 8, b0, b2, b4, b5, b6, b7, b11, b14), 0), X, 20, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 24, 26); /* (a1 + a3 + a4 + a5 + a6 + a10 + a13 + a14)(b1 + b3 + b4 + b5 + b6 + b10 + b13 + b14)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^9 + X1 + X2 + X3 + X5 + X6 + X7 + X8 + X^20 + X^21 + X^22 + X^23 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a4, a5, a6, a10, a13, a14), mzd_sum(t2, 8, b1, b3, b4, b5, b6, b10, b13, b14), 0), X, 20, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 25, 27); /* (a2 + a3 + a5 + a7 + a8 + a9 + a10 + a14)(b2 + b3 + b5 + b7 + b8 + b9 + b10 + b14)*(X + X^2 + X^3 + X^6 + X^9 + X1 + X3 + X4 + X5 + X6 + X8 + X9 + X^20 + X^21 + X^23 + X^24 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a5, a7, a8, a9, a10, a14), mzd_sum(t2, 8, b2, b3, b5, b7, b8, b9, b10, b14), 0), X, 18, 1, 2, 3, 6, 9, 11, 13, 14, 15, 16, 18, 19, 20, 21, 23, 24, 26, 27); /* (a0 + a4 + a5 + a6 + a7 + a9 + a11 + a12)(b0 + b4 + b5 + b6 + b7 + b9 + b11 + b12)*(X^3 + X^5 + X^6 + X^7 + X0 + X1 + X2 + X3 + X5 + X7 + X9 + X^21 + X^22 + X^24 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a4, a5, a6, a7, a9, a11, a12), mzd_sum(t2, 8, b0, b4, b5, b6, b7, b9, b11, b12), 0), X, 16, 3, 5, 6, 7, 10, 11, 12, 13, 15, 17, 19, 21, 22, 24, 25, 26); /* (a1 + a5 + a6 + a7 + a8 + a10 + a12 + a13)(b1 + b5 + b6 + b7 + b8 + b10 + b12 + b13)*(X^4 + X^6 + X^7 + X^8 + X1 + X2 + X3 + X4 + X6 + X8 + X^20 + X^22 + X^23 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a5, a6, a7, a8, a10, a12, a13), mzd_sum(t2, 8, b1, b5, b6, b7, b8, b10, b12, b13), 0), X, 16, 4, 6, 7, 8, 11, 12, 13, 14, 16, 18, 20, 22, 23, 25, 26, 27); /* (a2 + a6 + a7 + a8 + a9 + a11 + a13 + a14)(b2 + b6 + b7 + b8 + b9 + b11 + b13 + b14)*(X + X^3 + X^5 + X^6 + X^7 + X^9 + X0 + X2 + X4 + X5 + X6 + X7 + X8 + X9 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a6, a7, a8, a9, a11, a13, a14), mzd_sum(t2, 8, b2, b6, b7, b8, b9, b11, b13, b14), 0), X, 18, 1, 3, 5, 6, 7, 9, 10, 12, 14, 15, 16, 17, 18, 19, 24, 25, 26, 27); /* (a3 + a4 + a5 + a6 + a8 + a10 + a11 + a14)(b3 + b4 + b5 + b6 + b8 + b10 + b11 + b14)*(X + X^2 + X^3 + X^4 + X^7 + X1 + X5 + X7 + X9 + X^20 + X^21 + X^23 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a3, a4, a5, a6, a8, a10, a11, a14), mzd_sum(t2, 8, b3, b4, b5, b6, b8, b10, b11, b14), 0), X, 14, 1, 2, 3, 4, 7, 11, 15, 17, 19, 20, 21, 23, 26, 27); /* (a0 + a1 + a2 + a3 + a5 + a7 + a8 + a11)(b0 + b1 + b2 + b3 + b5 + b7 + b8 + b11)*(X^3 + X^4 + X^5 + X^8 + X0 + X4 + X5 + X6 + X7 + X8 + X9 + X^20 + X^21 + X^23 + X^24 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a2, a3, a5, a7, a8, a11), mzd_sum(t2, 8, b0, b1, b2, b3, b5, b7, b8, b11), 0), X, 16, 3, 4, 5, 8, 10, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 27); /* (a0 + a1 + a4 + a8 + a9 + a10 + a11 + a13)(b0 + b1 + b4 + b8 + b9 + b10 + b11 + b13)*(X + X^2 + X^4 + X^5 + X^6 + X0 + X2 + X3 + X^20 + X^22 + X^23 + X^24 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a4, a8, a9, a10, a11, a13), mzd_sum(t2, 8, b0, b1, b4, b8, b9, b10, b11, b13), 0), X, 14, 1, 2, 4, 5, 6, 10, 12, 13, 20, 22, 23, 24, 25, 27); /* (a0 + a2 + a4 + a5 + a8 + a12 + a13 + a14)(b0 + b2 + b4 + b5 + b8 + b12 + b13 + b14)*(X^2 + X^5 + X^7 + X^8 + X^9 + X0 + X3 + X^21 + X^22 + X^24 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a4, a5, a8, a12, a13, a14), mzd_sum(t2, 8, b0, b2, b4, b5, b8, b12, b13, b14), 0), X, 12, 2, 5, 7, 8, 9, 10, 13, 21, 22, 24, 26, 27); /* (a1 + a3 + a4 + a7 + a11 + a12 + a13 + a14)(b1 + b3 + b4 + b7 + b11 + b12 + b13 + b14)*(X + X^9 + X1 + X3 + X4 + X6 + X8 + X^21 + X^22 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a4, a7, a11, a12, a13, a14), mzd_sum(t2, 8, b1, b3, b4, b7, b11, b12, b13, b14), 0), X, 10, 1, 9, 11, 13, 14, 16, 18, 21, 22, 27); /* (a2 + a3 + a4 + a5 + a7 + a9 + a10 + a13)(b2 + b3 + b4 + b5 + b7 + b9 + b10 + b13)*(X^2 + X^3 + X^6 + X^8 + X^9 + X1 + X2 + X5 + X7 + X9 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a4, a5, a7, a9, a10, a13), mzd_sum(t2, 8, b2, b3, b4, b5, b7, b9, b10, b13), 0), X, 12, 2, 3, 6, 8, 9, 11, 12, 15, 17, 19, 25, 27); /* (a0 + a4 + a5 + a9 + a10 + a14)(b0 + b4 + b5 + b9 + b10 + b14)*(X^3 + X^4 + X^5 + X^6 + X2 + X3 + X5 + X6 + X7 + X9 + X^22 + X^23 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a4, a5, a9, a10, a14), mzd_sum(t2, 6, b0, b4, b5, b9, b10, b14), 0), X, 14, 3, 4, 5, 6, 12, 13, 15, 16, 17, 19, 22, 23, 25, 26); /* (a1 + a4 + a6 + a9 + a11 + a14)(b1 + b4 + b6 + b9 + b11 + b14)*(X^4 + X^5 + X^6 + X^7 + X3 + X4 + X6 + X7 + X8 + X^20 + X^23 + X^24 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a4, a6, a9, a11, a14), mzd_sum(t2, 6, b1, b4, b6, b9, b11, b14), 0), X, 14, 4, 5, 6, 7, 13, 14, 16, 17, 18, 20, 23, 24, 26, 27); /* (a2 + a4 + a7 + a9 + a12 + a14)(b2 + b4 + b7 + b9 + b12 + b14)*(X + X^3 + X^5 + X^7 + X0 + X3 + X4 + X5 + X6 + X7 + X9 + X^23 + X^24 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a4, a7, a9, a12, a14), mzd_sum(t2, 6, b2, b4, b7, b9, b12, b14), 0), X, 14, 1, 3, 5, 7, 10, 13, 14, 15, 16, 17, 19, 23, 24, 27); /* (a3 + a4 + a8 + a9 + a13 + a14)(b3 + b4 + b8 + b9 + b13 + b14)*(X + X^2 + X^3 + X^4 + X0 + X1 + X3 + X4 + X5 + X7 + X^20 + X^21 + X^23 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a3, a4, a8, a9, a13, a14), mzd_sum(t2, 6, b3, b4, b8, b9, b13, b14), 0), X, 14, 1, 2, 3, 4, 10, 11, 13, 14, 15, 17, 20, 21, 23, 24); /* (a0 + a1 + a2 + a3 + a5 + a6 + a7 + a8 + a10 + a11 + a12 + a13)(b0 + b1 + b2 + b3 + b5 + b6 + b7 + b8 + b10 + b11 + b12 + b13)*(X^2 + X^3 + X^4 + X^5 + X1 + X2 + X4 + X5 + X6 + X8 + X^21 + X^22 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 12, a0, a1, a2, a3, a5, a6, a7, a8, a10, a11, a12, a13), mzd_sum(t2, 12, b0, b1, b2, b3, b5, b6, b7, b8, b10, b11, b12, b13), 0), X, 14, 2, 3, 4, 5, 11, 12, 14, 15, 16, 18, 21, 22, 24, 25); /* (a0 + a1 + a5 + a6 + a10 + a11)(b0 + b1 + b5 + b6 + b10 + b11)*(X + X^2 + X^4 + X^7 + X0 + X1 + X2 + X3 + X7 + X8 + X9 + X^21 + X^22 + X^23 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a1, a5, a6, a10, a11), mzd_sum(t2, 6, b0, b1, b5, b6, b10, b11), 0), X, 16, 1, 2, 4, 7, 10, 11, 12, 13, 17, 18, 19, 21, 22, 23, 25, 27); /* (a0 + a2 + a5 + a7 + a10 + a12)(b0 + b2 + b5 + b7 + b10 + b12)*(X + X^5 + X0 + X2 + X3 + X6 + X7 + X8 + X^20 + X^22 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a2, a5, a7, a10, a12), mzd_sum(t2, 6, b0, b2, b5, b7, b10, b12), 0), X, 12, 1, 5, 10, 12, 13, 16, 17, 18, 20, 22, 23, 25); /* (a1 + a3 + a6 + a8 + a11 + a13)(b1 + b3 + b6 + b8 + b11 + b13)*(X^2 + X^6 + X1 + X3 + X4 + X7 + X8 + X9 + X^21 + X^23 + X^24 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a6, a8, a11, a13), mzd_sum(t2, 6, b1, b3, b6, b8, b11, b13), 0), X, 12, 2, 6, 11, 13, 14, 17, 18, 19, 21, 23, 24, 26); /* (a2 + a3 + a7 + a8 + a12 + a13)(b2 + b3 + b7 + b8 + b12 + b13)*(X^2 + X^3 + X^6 + X^7 + X1 + X2 + X3 + X5 + X7 + X^20 + X^21 + X^22 + X^23 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a3, a7, a8, a12, a13), mzd_sum(t2, 6, b2, b3, b7, b8, b12, b13), 0), X, 16, 2, 3, 6, 7, 11, 12, 13, 15, 17, 20, 21, 22, 23, 25, 26, 27); /* (a0 + a5 + a8 + a10 + a11 + a14)(b0 + b5 + b8 + b10 + b11 + b14)*(X + X^3 + X^8 + X0 + X6 + X8 + X^23 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a0, a5, a8, a10, a11, a14), mzd_sum(t2, 6, b0, b5, b8, b10, b11, b14), 0), X, 8, 1, 3, 8, 10, 16, 18, 23, 25); /* (a1 + a6 + a9 + a11 + a12)(b1 + b6 + b9 + b11 + b12)*(X + X^3 + X^4 + X^5 + X^8 + X0 + X1 + X2 + X6 + X8 + X9 + X^20 + X^23 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 5, a1, a6, a9, a11, a12), mzd_sum(t2, 5, b1, b6, b9, b11, b12), 0), X, 16, 1, 3, 4, 5, 8, 10, 11, 12, 16, 18, 19, 20, 23, 25, 26, 27); /* (a3 + a6 + a8 + a9 + a12 + a13 + a14)(b3 + b6 + b8 + b9 + b12 + b13 + b14)*(X + X^2 + X^5 + X^8 + X^9 + X2 + X6 + X7 + X^20 + X^23 + X^24 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a3, a6, a8, a9, a12, a13, a14), mzd_sum(t2, 7, b3, b6, b8, b9, b12, b13, b14), 0), X, 12, 1, 2, 5, 8, 9, 12, 16, 17, 20, 23, 24, 27); /* (a4 + a7 + a9 + a10 + a13 + a14)(b4 + b7 + b9 + b10 + b13 + b14)*(X^3 + X^5 + X0 + X2 + X8 + X^20 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a4, a7, a9, a10, a13, a14), mzd_sum(t2, 6, b4, b7, b9, b10, b13, b14), 0), X, 8, 3, 5, 10, 12, 18, 20, 25, 27); /* (a0 + a4 + a5 + a7 + a8 + a9 + a11 + a13)(b0 + b4 + b5 + b7 + b8 + b9 + b11 + b13)*(X^3 + X0 + X8 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a4, a5, a7, a8, a9, a11, a13), mzd_sum(t2, 8, b0, b4, b5, b7, b8, b9, b11, b13), 0), X, 4, 3, 10, 18, 25); /* (a0 + a1 + a5 + a6 + a8 + a9 + a10 + a12 + a14)(b0 + b1 + b5 + b6 + b8 + b9 + b10 + b12 + b14)*(X^2 + X^9 + X7 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a5, a6, a8, a9, a10, a12, a14), mzd_sum(t2, 9, b0, b1, b5, b6, b8, b9, b10, b12, b14), 0), X, 4, 2, 9, 17, 24); /* (a3 + a4 + a6 + a7 + a8 + a10 + a12)(b3 + b4 + b6 + b7 + b8 + b10 + b12)*(X^4 + X1 + X9 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a3, a4, a6, a7, a8, a10, a12), mzd_sum(t2, 7, b3, b4, b6, b7, b8, b10, b12), 0), X, 4, 4, 11, 19, 26); /* (a1 + a2 + a4 + a5 + a6 + a8 + a10)(b1 + b2 + b4 + b5 + b6 + b8 + b10)*(X + X^3 + X^5 + X^8 + X0 + X2 + X6 + X8 + X^20 + X^23 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a1, a2, a4, a5, a6, a8, a10), mzd_sum(t2, 7, b1, b2, b4, b5, b6, b8, b10), 0), X, 12, 1, 3, 5, 8, 10, 12, 16, 18, 20, 23, 25, 27); /* (a0 + a2 + a3 + a6 + a7 + a8 + a9 + a10 + a14)(b0 + b2 + b3 + b6 + b7 + b8 + b9 + b10 + b14)*(X^2 + X^3 + X^4 + X^5 + X^9 + X0 + X1 + X2 + X7 + X8 + X9 + X^20 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a3, a6, a7, a8, a9, a10, a14), mzd_sum(t2, 9, b0, b2, b3, b6, b7, b8, b9, b10, b14), 0), X, 16, 2, 3, 4, 5, 9, 10, 11, 12, 17, 18, 19, 20, 24, 25, 26, 27); /* (a0 + a1 + a3 + a4 + a5 + a7 + a9 + a14)(b0 + b1 + b3 + b4 + b5 + b7 + b9 + b14)*(X + X^2 + X^3 + X^4 + X^8 + X^9 + X0 + X1 + X6 + X7 + X8 + X9 + X^23 + X^24 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a3, a4, a5, a7, a9, a14), mzd_sum(t2, 8, b0, b1, b3, b4, b5, b7, b9, b14), 0), X, 16, 1, 2, 3, 4, 8, 9, 10, 11, 16, 17, 18, 19, 23, 24, 25, 26); /* (a0 + a1 + a2 + a4 + a6 + a11 + a14)(b0 + b1 + b2 + b4 + b6 + b11 + b14)*(X + X^2 + X^3 + X^4 + X^5 + X^8 + X^9 + X0 + X1 + X2 + X6 + X7 + X8 + X9 + X^20 + X^23 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a2, a4, a6, a11, a14), mzd_sum(t2, 7, b0, b1, b2, b4, b6, b11, b14), 0), X, 20, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27); /* (a0 + a2 + a3 + a4 + a6 + a8 + a13)(b0 + b2 + b3 + b4 + b6 + b8 + b13)*(X + X^2 + X^4 + X^5 + X^8 + X^9 + X1 + X2 + X6 + X7 + X9 + X^20 + X^23 + X^24 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a3, a4, a6, a8, a13), mzd_sum(t2, 7, b0, b2, b3, b4, b6, b8, b13), 0), X, 16, 1, 2, 4, 5, 8, 9, 11, 12, 16, 17, 19, 20, 23, 24, 26, 27); /* (a0 + a1 + a2 + a3 + a4 + a8 + a9 + a11 + a12 + a13)(b0 + b1 + b2 + b3 + b4 + b8 + b9 + b11 + b12 + b13)*(X + X^4 + X^8 + X1 + X6 + X9 + X^23 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a1, a2, a3, a4, a8, a9, a11, a12, a13), mzd_sum(t2, 10, b0, b1, b2, b3, b4, b8, b9, b11, b12, b13), 0), X, 8, 1, 4, 8, 11, 16, 19, 23, 26); mzd_free(t0); mzd_free(t1); mzd_free(t2); } void _mzd_ptr_addmul_karatsuba16(const gf2e *ff, mzd_t **X, const mzd_t **A, const mzd_t **B) { /* using 64 multiplications and three temporaries (not optimal!) */ const mzd_t *a0 = A[ 0]; const mzd_t *a1 = A[ 1]; const mzd_t *a2 = A[ 2]; const mzd_t *a3 = A[ 3]; const mzd_t *a4 = A[ 4]; const mzd_t *a5 = A[ 5]; const mzd_t *a6 = A[ 6]; const mzd_t *a7 = A[ 7]; const mzd_t *a8 = A[ 8]; const mzd_t *a9 = A[ 9]; const mzd_t *a10 = A[10]; const mzd_t *a11 = A[11]; const mzd_t *a12 = A[12]; const mzd_t *a13 = A[13]; const mzd_t *a14 = A[14]; const mzd_t *a15 = A[15]; const mzd_t *b0 = B[ 0]; const mzd_t *b1 = B[ 1]; const mzd_t *b2 = B[ 2]; const mzd_t *b3 = B[ 3]; const mzd_t *b4 = B[ 4]; const mzd_t *b5 = B[ 5]; const mzd_t *b6 = B[ 6]; const mzd_t *b7 = B[ 7]; const mzd_t *b8 = B[ 8]; const mzd_t *b9 = B[ 9]; const mzd_t *b10 = B[10]; const mzd_t *b11 = B[11]; const mzd_t *b12 = B[12]; const mzd_t *b13 = B[13]; const mzd_t *b14 = B[14]; const mzd_t *b15 = B[15]; mzd_t *t0 = mzd_init(a0->nrows, b0->ncols); mzd_t *t1 = mzd_init(a0->nrows, a0->ncols); mzd_t *t2 = mzd_init(b0->nrows, b0->ncols); /* (a0 + a2 + a3 + a5 + a6 + a8 + a9 + a11 + a12 + a14 + a15)(b0 + b2 + b3 + b5 + b6 + b8 + b9 + b11 + b12 + b14 + b15)*(X^2 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X2 + X5 + X6 + X7 + X8 + X9 + X^20 + X^23 + X^26 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 11, a0, a2, a3, a5, a6, a8, a9, a11, a12, a14, a15), mzd_sum(t2, 11, b0, b2, b3, b5, b6, b8, b9, b11, b12, b14, b15), 0), X, 18, 2, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 17, 18, 19, 20, 23, 26, 28); /* (a1 + a2 + a4 + a5 + a7 + a8 + a10 + a11 + a13 + a14)(b1 + b2 + b4 + b5 + b7 + b8 + b10 + b11 + b13 + b14)*(X^2 + X^3 + X^4 + X^6 + X^8 + X0 + X2 + X3 + X4 + X6 + X8 + X^20 + X^21 + X^22 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a1, a2, a4, a5, a7, a8, a10, a11, a13, a14), mzd_sum(t2, 10, b1, b2, b4, b5, b7, b8, b10, b11, b13, b14), 0), X, 16, 2, 3, 4, 6, 8, 10, 12, 13, 14, 16, 18, 20, 21, 22, 26, 27); /* (a0 + a1 + a3 + a4 + a6 + a7 + a9 + a10 + a12 + a13 + a15)(b0 + b1 + b3 + b4 + b6 + b7 + b9 + b10 + b12 + b13 + b15)*(X^3 + X^4 + X^5 + X^7 + X^9 + X1 + X3 + X4 + X5 + X7 + X9 + X^21 + X^22 + X^23 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 11, a0, a1, a3, a4, a6, a7, a9, a10, a12, a13, a15), mzd_sum(t2, 11, b0, b1, b3, b4, b6, b7, b9, b10, b12, b13, b15), 0), X, 16, 3, 4, 5, 7, 9, 11, 13, 14, 15, 17, 19, 21, 22, 23, 27, 28); /* (a0)(b0)*(1 + X + X^2 + X^3 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X2 + X3 + X5 + X6 + X7 + X8 + X^20 + X^21 + X^22 + X^23 + X^24 + X^25 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a0, b0, 0), X, 24, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 27, 28); /* (a1)(b1)*(X + X^3 + X^6 + X^8 + X0 + X3 + X6 + X8 + X^21 + X^23 + X^25 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a1, b1, 0), X, 12, 1, 3, 6, 8, 10, 13, 16, 18, 21, 23, 25, 28); /* (a0 + a1)(b0 + b1)*(X + X^3 + X^6 + X^8 + X0 + X3 + X6 + X8 + X^21 + X^23 + X^25 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a0, a1), mzd_sum(t2, 2, b0, b1), 0), X, 12, 1, 3, 6, 8, 10, 13, 16, 18, 21, 23, 25, 28); /* (a0 + a2 + a4 + a6 + a8 + a10 + a12 + a14)(b0 + b2 + b4 + b6 + b8 + b10 + b12 + b14)*(X^2 + X^3 + X^7 + X^8 + X1 + X2 + X3 + X7 + X8 + X^22 + X^23 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a2, a4, a6, a8, a10, a12, a14), mzd_sum(t2, 8, b0, b2, b4, b6, b8, b10, b12, b14), 0), X, 14, 2, 3, 7, 8, 11, 12, 13, 17, 18, 22, 23, 26, 27, 28); /* (a1 + a3 + a5 + a7 + a9 + a11 + a13 + a15)(b1 + b3 + b5 + b7 + b9 + b11 + b13 + b15)*(X^2 + X^3 + X^7 + X^8 + X1 + X2 + X3 + X7 + X8 + X^22 + X^23 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a5, a7, a9, a11, a13, a15), mzd_sum(t2, 8, b1, b3, b5, b7, b9, b11, b13, b15), 0), X, 14, 2, 3, 7, 8, 11, 12, 13, 17, 18, 22, 23, 26, 27, 28); /* (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12 + a13 + a14 + a15)(b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 + b12 + b13 + b14 + b15)*(X^2 + X^7 + X1 + X3 + X4 + X5 + X6 + X8 + X9 + X^20 + X^21 + X^23 + X^24 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 16, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15), mzd_sum(t2, 16, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15), 0), X, 15, 2, 7, 11, 13, 14, 15, 16, 18, 19, 20, 21, 23, 24, 25, 27); /* (a15)(b15)*(X^2 + X^3 + X^4 + X^5 + X^7 + X^8 + X^9 + X0 + X1 + X2 + X4 + X5 + X7 + X8 + X9 + X^20 + X^22 + X^23 + X^24 + X^25 + X^26 + X^27 + X^29 + X^30) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a15, b15, 0), X, 24, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30); /* (a14)(b14)*(X^2 + X^4 + X^7 + X^9 + X1 + X4 + X7 + X9 + X^22 + X^24 + X^26 + X^29) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, a14, b14, 0), X, 12, 2, 4, 7, 9, 11, 14, 17, 19, 22, 24, 26, 29); /* (a14 + a15)(b14 + b15)*(X^2 + X^4 + X^7 + X^9 + X1 + X4 + X7 + X9 + X^22 + X^24 + X^26 + X^29) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 2, a14, a15), mzd_sum(t2, 2, b14, b15), 0), X, 12, 2, 4, 7, 9, 11, 14, 17, 19, 22, 24, 26, 29); /* (a0 + a3 + a5 + a6 + a7 + a10 + a12 + a13 + a14)(b0 + b3 + b5 + b6 + b7 + b10 + b12 + b13 + b14)*(X^2 + X^3 + X^4 + X3 + X7 + X8 + X9 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a3, a5, a6, a7, a10, a12, a13, a14), mzd_sum(t2, 9, b0, b3, b5, b6, b7, b10, b12, b13, b14), 0), X, 8, 2, 3, 4, 13, 17, 18, 19, 28); /* (a1 + a3 + a4 + a5 + a8 + a10 + a11 + a12 + a15)(b1 + b3 + b4 + b5 + b8 + b10 + b11 + b12 + b15)*(X^2 + X^3 + X^5 + X^7 + X^9 + X1 + X7 + X8 + X^20 + X^22 + X^24 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a1, a3, a4, a5, a8, a10, a11, a12, a15), mzd_sum(t2, 9, b1, b3, b4, b5, b8, b10, b11, b12, b15), 0), X, 12, 2, 3, 5, 7, 9, 11, 17, 18, 20, 22, 24, 26); /* (a2 + a4 + a5 + a6 + a9 + a11 + a12 + a13)(b2 + b4 + b5 + b6 + b9 + b11 + b12 + b13)*(X^3 + X^4 + X^6 + X^8 + X0 + X2 + X8 + X9 + X^21 + X^23 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a4, a5, a6, a9, a11, a12, a13), mzd_sum(t2, 8, b2, b4, b5, b6, b9, b11, b12, b13), 0), X, 12, 3, 4, 6, 8, 10, 12, 18, 19, 21, 23, 25, 27); /* (a0 + a1 + a4 + a6 + a7 + a8 + a11 + a13 + a14 + a15)(b0 + b1 + b4 + b6 + b7 + b8 + b11 + b13 + b14 + b15)*(X^4 + X^5 + X^7 + X^9 + X1 + X3 + X9 + X^20 + X^22 + X^24 + X^26 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a1, a4, a6, a7, a8, a11, a13, a14, a15), mzd_sum(t2, 10, b0, b1, b4, b6, b7, b8, b11, b13, b14, b15), 0), X, 12, 4, 5, 7, 9, 11, 13, 19, 20, 22, 24, 26, 28); /* (a0 + a2 + a3 + a4 + a7 + a9 + a10 + a11 + a14)(b0 + b2 + b3 + b4 + b7 + b9 + b10 + b11 + b14)*(X^2 + X^4 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X2 + X7 + X9 + X^20 + X^21 + X^22 + X^23 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a3, a4, a7, a9, a10, a11, a14), mzd_sum(t2, 9, b0, b2, b3, b4, b7, b9, b10, b11, b14), 0), X, 20, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27); /* (a1 + a2 + a3 + a6 + a8 + a9 + a10 + a13 + a15)(b1 + b2 + b3 + b6 + b8 + b9 + b10 + b13 + b15)*(X^3 + X^5 + X^6 + X^7 + X^8 + X^9 + X0 + X1 + X2 + X3 + X8 + X^20 + X^21 + X^22 + X^23 + X^24 + X^25 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a1, a2, a3, a6, a8, a9, a10, a13, a15), mzd_sum(t2, 9, b1, b2, b3, b6, b8, b9, b10, b13, b15), 0), X, 20, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28); /* (a0 + a3 + a4 + a5 + a7 + a10 + a11 + a12 + a14)(b0 + b3 + b4 + b5 + b7 + b10 + b11 + b12 + b14)*(X^3 + X^6 + X^9 + X0 + X1 + X2 + X8 + X^21 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a3, a4, a5, a7, a10, a11, a12, a14), mzd_sum(t2, 9, b0, b3, b4, b5, b7, b10, b11, b12, b14), 0), X, 12, 3, 6, 9, 10, 11, 12, 18, 21, 24, 25, 26, 27); /* (a1 + a4 + a5 + a6 + a8 + a11 + a12 + a13 + a15)(b1 + b4 + b5 + b6 + b8 + b11 + b12 + b13 + b15)*(X^4 + X^7 + X0 + X1 + X2 + X3 + X9 + X^22 + X^25 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a1, a4, a5, a6, a8, a11, a12, a13, a15), mzd_sum(t2, 9, b1, b4, b5, b6, b8, b11, b12, b13, b15), 0), X, 12, 4, 7, 10, 11, 12, 13, 19, 22, 25, 26, 27, 28); /* (a2 + a3 + a4 + a6 + a9 + a10 + a11 + a13)(b2 + b3 + b4 + b6 + b9 + b10 + b11 + b13)*(X^2 + X^4 + X^5 + X^7 + X^8 + X^9 + X2 + X3 + X7 + X9 + X^20 + X^22 + X^23 + X^24 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a4, a6, a9, a10, a11, a13), mzd_sum(t2, 8, b2, b3, b4, b6, b9, b10, b11, b13), 0), X, 16, 2, 4, 5, 7, 8, 9, 12, 13, 17, 19, 20, 22, 23, 24, 27, 28); /* (a0 + a1 + a3 + a6 + a7 + a8 + a10 + a13 + a14 + a15)(b0 + b1 + b3 + b6 + b7 + b8 + b10 + b13 + b14 + b15)*(X^2 + X^3 + X^5 + X^6 + X^8 + X2 + X7 + X8 + X^20 + X^21 + X^23 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a1, a3, a6, a7, a8, a10, a13, a14, a15), mzd_sum(t2, 10, b0, b1, b3, b6, b7, b8, b10, b13, b14, b15), 0), X, 12, 2, 3, 5, 6, 8, 12, 17, 18, 20, 21, 23, 27); /* (a0 + a2 + a5 + a6 + a7 + a9 + a12 + a13 + a14)(b0 + b2 + b5 + b6 + b7 + b9 + b12 + b13 + b14)*(X^3 + X^4 + X^6 + X^7 + X^9 + X3 + X8 + X9 + X^21 + X^22 + X^24 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a5, a6, a7, a9, a12, a13, a14), mzd_sum(t2, 9, b0, b2, b5, b6, b7, b9, b12, b13, b14), 0), X, 12, 3, 4, 6, 7, 9, 13, 18, 19, 21, 22, 24, 28); /* (a1 + a2 + a3 + a5 + a8 + a9 + a10 + a12 + a15)(b1 + b2 + b3 + b5 + b8 + b9 + b10 + b12 + b15)*(X^2 + X^5 + X^8 + X^9 + X0 + X1 + X7 + X^20 + X^23 + X^24 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a1, a2, a3, a5, a8, a9, a10, a12, a15), mzd_sum(t2, 9, b1, b2, b3, b5, b8, b9, b10, b12, b15), 0), X, 12, 2, 5, 8, 9, 10, 11, 17, 20, 23, 24, 25, 26); /* (a0 + a4 + a7 + a8 + a10 + a12 + a13 + a14 + a15)(b0 + b4 + b7 + b8 + b10 + b12 + b13 + b14 + b15)*(X^2 + X^3 + X^4 + X^7 + X0 + X2 + X4 + X5 + X6 + X7 + X9 + X^20 + X^21 + X^22 + X^24 + X^25 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a4, a7, a8, a10, a12, a13, a14, a15), mzd_sum(t2, 9, b0, b4, b7, b8, b10, b12, b13, b14, b15), 0), X, 18, 2, 3, 4, 7, 10, 12, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 27, 28); /* (a1 + a4 + a5 + a7 + a9 + a10 + a11 + a12)(b1 + b4 + b5 + b7 + b9 + b10 + b11 + b12)*(X^2 + X^3 + X^5 + X^7 + X^8 + X^9 + X3 + X4 + X5 + X6 + X8 + X9 + X^20 + X^21 + X^23 + X^24 + X^25 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a4, a5, a7, a9, a10, a11, a12), mzd_sum(t2, 8, b1, b4, b5, b7, b9, b10, b11, b12), 0), X, 18, 2, 3, 5, 7, 8, 9, 13, 14, 15, 16, 18, 19, 20, 21, 23, 24, 25, 28); /* (a2 + a5 + a6 + a8 + a10 + a11 + a12 + a13)(b2 + b5 + b6 + b8 + b10 + b11 + b12 + b13)*(X^2 + X^3 + X^6 + X^7 + X^8 + X0 + X1 + X5 + X6 + X^20 + X^21 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a5, a6, a8, a10, a11, a12, a13), mzd_sum(t2, 8, b2, b5, b6, b8, b10, b11, b12, b13), 0), X, 12, 2, 3, 6, 7, 8, 10, 11, 15, 16, 20, 21, 25); /* (a3 + a6 + a7 + a9 + a11 + a12 + a13 + a14)(b3 + b6 + b7 + b9 + b11 + b12 + b13 + b14)*(X^3 + X^4 + X^7 + X^8 + X^9 + X1 + X2 + X6 + X7 + X^21 + X^22 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a3, a6, a7, a9, a11, a12, a13, a14), mzd_sum(t2, 8, b3, b6, b7, b9, b11, b12, b13, b14), 0), X, 12, 3, 4, 7, 8, 9, 11, 12, 16, 17, 21, 22, 26); /* (a0 + a1 + a2 + a3 + a7 + a10 + a11 + a13 + a15)(b0 + b1 + b2 + b3 + b7 + b10 + b11 + b13 + b15)*(X^2 + X^4 + X^6 + X^9 + X0 + X2 + X5 + X7 + X^20 + X^22 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a2, a3, a7, a10, a11, a13, a15), mzd_sum(t2, 9, b0, b1, b2, b3, b7, b10, b11, b13, b15), 0), X, 12, 2, 4, 6, 9, 10, 12, 15, 17, 20, 22, 25, 26); /* (a0 + a1 + a5 + a8 + a9 + a11 + a13 + a14 + a15)(b0 + b1 + b5 + b8 + b9 + b11 + b13 + b14 + b15)*(X^2 + X^5 + X^6 + X^8 + X3 + X5 + X8 + X^20 + X^23 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a5, a8, a9, a11, a13, a14, a15), mzd_sum(t2, 9, b0, b1, b5, b8, b9, b11, b13, b14, b15), 0), X, 12, 2, 5, 6, 8, 13, 15, 18, 20, 23, 25, 26, 27); /* (a0 + a2 + a4 + a5 + a6 + a7 + a11 + a14 + a15)(b0 + b2 + b4 + b5 + b6 + b7 + b11 + b14 + b15)*(X^2 + X^4 + X^5 + X1 + X2 + X3 + X4 + X5 + X7 + X8 + X9 + X^20 + X^22 + X^23 + X^24 + X^25 + X^26 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a4, a5, a6, a7, a11, a14, a15), mzd_sum(t2, 9, b0, b2, b4, b5, b6, b7, b11, b14, b15), 0), X, 18, 2, 4, 5, 11, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 24, 25, 26, 28); /* (a1 + a3 + a4 + a5 + a6 + a10 + a13 + a14)(b1 + b3 + b4 + b5 + b6 + b10 + b13 + b14)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^7 + X^9 + X1 + X2 + X3 + X5 + X6 + X7 + X8 + X^20 + X^21 + X^22 + X^23 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a4, a5, a6, a10, a13, a14), mzd_sum(t2, 8, b1, b3, b4, b5, b6, b10, b13, b14), 0), X, 20, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 25, 27); /* (a2 + a3 + a5 + a7 + a8 + a9 + a10 + a14)(b2 + b3 + b5 + b7 + b8 + b9 + b10 + b14)*(X^2 + X^8 + X^9 + X0 + X1 + X4 + X5 + X9 + X^20 + X^24 + X^25 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a5, a7, a8, a9, a10, a14), mzd_sum(t2, 8, b2, b3, b5, b7, b8, b9, b10, b14), 0), X, 14, 2, 8, 9, 10, 11, 14, 15, 19, 20, 24, 25, 26, 27, 28); /* (a0 + a4 + a5 + a6 + a7 + a9 + a11 + a12 + a15)(b0 + b4 + b5 + b6 + b7 + b9 + b11 + b12 + b15)*(X^3 + X^5 + X^6 + X^7 + X0 + X1 + X2 + X3 + X5 + X7 + X9 + X^21 + X^22 + X^24 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a4, a5, a6, a7, a9, a11, a12, a15), mzd_sum(t2, 9, b0, b4, b5, b6, b7, b9, b11, b12, b15), 0), X, 16, 3, 5, 6, 7, 10, 11, 12, 13, 15, 17, 19, 21, 22, 24, 25, 26); /* (a1 + a5 + a6 + a7 + a8 + a10 + a12 + a13)(b1 + b5 + b6 + b7 + b8 + b10 + b12 + b13)*(X^4 + X^6 + X^7 + X^8 + X1 + X2 + X3 + X4 + X6 + X8 + X^20 + X^22 + X^23 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a5, a6, a7, a8, a10, a12, a13), mzd_sum(t2, 8, b1, b5, b6, b7, b8, b10, b12, b13), 0), X, 16, 4, 6, 7, 8, 11, 12, 13, 14, 16, 18, 20, 22, 23, 25, 26, 27); /* (a2 + a6 + a7 + a8 + a9 + a11 + a13 + a14)(b2 + b6 + b7 + b8 + b9 + b11 + b13 + b14)*(X^5 + X^7 + X^8 + X^9 + X2 + X3 + X4 + X5 + X7 + X9 + X^21 + X^23 + X^24 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a6, a7, a8, a9, a11, a13, a14), mzd_sum(t2, 8, b2, b6, b7, b8, b9, b11, b13, b14), 0), X, 16, 5, 7, 8, 9, 12, 13, 14, 15, 17, 19, 21, 23, 24, 26, 27, 28); /* (a3 + a4 + a5 + a6 + a8 + a10 + a11 + a14)(b3 + b4 + b5 + b6 + b8 + b10 + b11 + b14)*(X^2 + X^4 + X^6 + X^7 + X^8 + X0 + X1 + X3 + X5 + X6 + X7 + X8 + X9 + X^20 + X^25 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a3, a4, a5, a6, a8, a10, a11, a14), mzd_sum(t2, 8, b3, b4, b5, b6, b8, b10, b11, b14), 0), X, 18, 2, 4, 6, 7, 8, 10, 11, 13, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28); /* (a0 + a1 + a2 + a3 + a5 + a7 + a8 + a11 + a15)(b0 + b1 + b2 + b3 + b5 + b7 + b8 + b11 + b15)*(X^3 + X^4 + X^5 + X^8 + X0 + X4 + X5 + X6 + X7 + X8 + X9 + X^20 + X^21 + X^23 + X^24 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a2, a3, a5, a7, a8, a11, a15), mzd_sum(t2, 9, b0, b1, b2, b3, b5, b7, b8, b11, b15), 0), X, 16, 3, 4, 5, 8, 10, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 27); /* (a0 + a1 + a4 + a8 + a9 + a10 + a11 + a13 + a15)(b0 + b1 + b4 + b8 + b9 + b10 + b11 + b13 + b15)*(X^2 + X^3 + X^4 + X^5 + X^8 + X2 + X6 + X8 + X^20 + X^21 + X^22 + X^24 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a4, a8, a9, a10, a11, a13, a15), mzd_sum(t2, 9, b0, b1, b4, b8, b9, b10, b11, b13, b15), 0), X, 14, 2, 3, 4, 5, 8, 12, 16, 18, 20, 21, 22, 24, 27, 28); /* (a0 + a2 + a4 + a5 + a8 + a12 + a13 + a14 + a15)(b0 + b2 + b4 + b5 + b8 + b12 + b13 + b14 + b15)*(X^2 + X^5 + X^7 + X^8 + X^9 + X0 + X3 + X^21 + X^22 + X^24 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a2, a4, a5, a8, a12, a13, a14, a15), mzd_sum(t2, 9, b0, b2, b4, b5, b8, b12, b13, b14, b15), 0), X, 12, 2, 5, 7, 8, 9, 10, 13, 21, 22, 24, 26, 27); /* (a1 + a3 + a4 + a7 + a11 + a12 + a13 + a14)(b1 + b3 + b4 + b7 + b11 + b12 + b13 + b14)*(X^3 + X^6 + X^8 + X^9 + X0 + X1 + X4 + X^22 + X^23 + X^25 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a3, a4, a7, a11, a12, a13, a14), mzd_sum(t2, 8, b1, b3, b4, b7, b11, b12, b13, b14), 0), X, 12, 3, 6, 8, 9, 10, 11, 14, 22, 23, 25, 27, 28); /* (a2 + a3 + a4 + a5 + a7 + a9 + a10 + a13)(b2 + b3 + b4 + b5 + b7 + b9 + b10 + b13)*(X^2 + X^3 + X^6 + X^8 + X^9 + X1 + X2 + X5 + X7 + X9 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a2, a3, a4, a5, a7, a9, a10, a13), mzd_sum(t2, 8, b2, b3, b4, b5, b7, b9, b10, b13), 0), X, 12, 2, 3, 6, 8, 9, 11, 12, 15, 17, 19, 25, 27); /* (a0 + a4 + a5 + a9 + a10 + a14 + a15)(b0 + b4 + b5 + b9 + b10 + b14 + b15)*(X^3 + X^4 + X^5 + X^6 + X2 + X3 + X5 + X6 + X7 + X9 + X^22 + X^23 + X^25 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a4, a5, a9, a10, a14, a15), mzd_sum(t2, 7, b0, b4, b5, b9, b10, b14, b15), 0), X, 14, 3, 4, 5, 6, 12, 13, 15, 16, 17, 19, 22, 23, 25, 26); /* (a1 + a4 + a6 + a9 + a11 + a14)(b1 + b4 + b6 + b9 + b11 + b14)*(X^4 + X^5 + X^6 + X^7 + X3 + X4 + X6 + X7 + X8 + X^20 + X^23 + X^24 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a4, a6, a9, a11, a14), mzd_sum(t2, 6, b1, b4, b6, b9, b11, b14), 0), X, 14, 4, 5, 6, 7, 13, 14, 16, 17, 18, 20, 23, 24, 26, 27); /* (a2 + a4 + a7 + a9 + a12 + a14)(b2 + b4 + b7 + b9 + b12 + b14)*(X^5 + X^6 + X^7 + X^8 + X4 + X5 + X7 + X8 + X9 + X^21 + X^24 + X^25 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a4, a7, a9, a12, a14), mzd_sum(t2, 6, b2, b4, b7, b9, b12, b14), 0), X, 14, 5, 6, 7, 8, 14, 15, 17, 18, 19, 21, 24, 25, 27, 28); /* (a3 + a4 + a8 + a9 + a13 + a14)(b3 + b4 + b8 + b9 + b13 + b14)*(X^2 + X^4 + X^6 + X^8 + X1 + X4 + X5 + X6 + X7 + X8 + X^20 + X^24 + X^25 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a3, a4, a8, a9, a13, a14), mzd_sum(t2, 6, b3, b4, b8, b9, b13, b14), 0), X, 14, 2, 4, 6, 8, 11, 14, 15, 16, 17, 18, 20, 24, 25, 28); /* (a0 + a1 + a2 + a3 + a5 + a6 + a7 + a8 + a10 + a11 + a12 + a13 + a15)(b0 + b1 + b2 + b3 + b5 + b6 + b7 + b8 + b10 + b11 + b12 + b13 + b15)*(X^2 + X^3 + X^4 + X^5 + X1 + X2 + X4 + X5 + X6 + X8 + X^21 + X^22 + X^24 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 13, a0, a1, a2, a3, a5, a6, a7, a8, a10, a11, a12, a13, a15), mzd_sum(t2, 13, b0, b1, b2, b3, b5, b6, b7, b8, b10, b11, b12, b13, b15), 0), X, 14, 2, 3, 4, 5, 11, 12, 14, 15, 16, 18, 21, 22, 24, 25); /* (a0 + a1 + a5 + a6 + a10 + a11 + a15)(b0 + b1 + b5 + b6 + b10 + b11 + b15)*(X^2 + X^3 + X^4 + X^6 + X^7 + X^8 + X1 + X2 + X6 + X7 + X9 + X^22 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a5, a6, a10, a11, a15), mzd_sum(t2, 7, b0, b1, b5, b6, b10, b11, b15), 0), X, 14, 2, 3, 4, 6, 7, 8, 11, 12, 16, 17, 19, 22, 27, 28); /* (a0 + a2 + a5 + a7 + a10 + a12 + a15)(b0 + b2 + b5 + b7 + b10 + b12 + b15)*(X^3 + X^5 + X^6 + X^8 + X2 + X7 + X^20 + X^21 + X^22 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a5, a7, a10, a12, a15), mzd_sum(t2, 7, b0, b2, b5, b7, b10, b12, b15), 0), X, 10, 3, 5, 6, 8, 12, 17, 20, 21, 22, 28); /* (a1 + a3 + a6 + a8 + a11 + a13)(b1 + b3 + b6 + b8 + b11 + b13)*(X^2 + X^6 + X1 + X3 + X4 + X7 + X8 + X9 + X^21 + X^23 + X^24 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a3, a6, a8, a11, a13), mzd_sum(t2, 6, b1, b3, b6, b8, b11, b13), 0), X, 12, 2, 6, 11, 13, 14, 17, 18, 19, 21, 23, 24, 26); /* (a2 + a3 + a7 + a8 + a12 + a13)(b2 + b3 + b7 + b8 + b12 + b13)*(X^2 + X^3 + X^6 + X^7 + X1 + X2 + X3 + X5 + X7 + X^20 + X^21 + X^22 + X^23 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a2, a3, a7, a8, a12, a13), mzd_sum(t2, 6, b2, b3, b7, b8, b12, b13), 0), X, 16, 2, 3, 6, 7, 11, 12, 13, 15, 17, 20, 21, 22, 23, 25, 26, 27); /* (a0 + a5 + a8 + a10 + a11 + a14 + a15)(b0 + b5 + b8 + b10 + b11 + b14 + b15)*(X^6 + X3 + X^21 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a5, a8, a10, a11, a14, a15), mzd_sum(t2, 7, b0, b5, b8, b10, b11, b14, b15), 0), X, 4, 6, 13, 21, 28); /* (a1 + a6 + a9 + a11 + a12 + a15)(b1 + b6 + b9 + b11 + b12 + b15)*(X^4 + X^5 + X^6 + X1 + X2 + X3 + X9 + X^20 + X^21 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 6, a1, a6, a9, a11, a12, a15), mzd_sum(t2, 6, b1, b6, b9, b11, b12, b15), 0), X, 12, 4, 5, 6, 11, 12, 13, 19, 20, 21, 26, 27, 28); /* (a3 + a6 + a8 + a9 + a12 + a13 + a14 + a15)(b3 + b6 + b8 + b9 + b12 + b13 + b14 + b15)*(X^2 + X^3 + X^5 + X^6 + X^9 + X0 + X2 + X3 + X7 + X8 + X^20 + X^21 + X^24 + X^25 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a3, a6, a8, a9, a12, a13, a14, a15), mzd_sum(t2, 8, b3, b6, b8, b9, b12, b13, b14, b15), 0), X, 16, 2, 3, 5, 6, 9, 10, 12, 13, 17, 18, 20, 21, 24, 25, 27, 28); /* (a4 + a7 + a9 + a10 + a13 + a14 + a15)(b4 + b7 + b9 + b10 + b13 + b14 + b15)*(X^3 + X^5 + X0 + X2 + X8 + X^20 + X^25 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a4, a7, a9, a10, a13, a14, a15), mzd_sum(t2, 7, b4, b7, b9, b10, b13, b14, b15), 0), X, 8, 3, 5, 10, 12, 18, 20, 25, 27); /* (a0 + a4 + a5 + a7 + a8 + a9 + a11 + a13)(b0 + b4 + b5 + b7 + b8 + b9 + b11 + b13)*(X^3 + X0 + X8 + X^25) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a4, a5, a7, a8, a9, a11, a13), mzd_sum(t2, 8, b0, b4, b5, b7, b8, b9, b11, b13), 0), X, 4, 3, 10, 18, 25); /* (a0 + a1 + a5 + a6 + a8 + a9 + a10 + a12 + a14)(b0 + b1 + b5 + b6 + b8 + b9 + b10 + b12 + b14)*(X^2 + X^9 + X7 + X^24) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 9, a0, a1, a5, a6, a8, a9, a10, a12, a14), mzd_sum(t2, 9, b0, b1, b5, b6, b8, b9, b10, b12, b14), 0), X, 4, 2, 9, 17, 24); /* (a3 + a4 + a6 + a7 + a8 + a10 + a12)(b3 + b4 + b6 + b7 + b8 + b10 + b12)*(X^4 + X1 + X9 + X^26) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a3, a4, a6, a7, a8, a10, a12), mzd_sum(t2, 7, b3, b4, b6, b7, b8, b10, b12), 0), X, 4, 4, 11, 19, 26); /* (a1 + a2 + a4 + a5 + a6 + a8 + a10 + a15)(b1 + b2 + b4 + b5 + b6 + b8 + b10 + b15)*(X^5 + X^6 + X2 + X3 + X^20 + X^21 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a1, a2, a4, a5, a6, a8, a10, a15), mzd_sum(t2, 8, b1, b2, b4, b5, b6, b8, b10, b15), 0), X, 8, 5, 6, 12, 13, 20, 21, 27, 28); /* (a0 + a2 + a3 + a6 + a7 + a8 + a9 + a10 + a14 + a15)(b0 + b2 + b3 + b6 + b7 + b8 + b9 + b10 + b14 + b15)*(X^2 + X^3 + X^4 + X^5 + X^9 + X0 + X1 + X2 + X7 + X8 + X9 + X^20 + X^24 + X^25 + X^26 + X^27) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 10, a0, a2, a3, a6, a7, a8, a9, a10, a14, a15), mzd_sum(t2, 10, b0, b2, b3, b6, b7, b8, b9, b10, b14, b15), 0), X, 16, 2, 3, 4, 5, 9, 10, 11, 12, 17, 18, 19, 20, 24, 25, 26, 27); /* (a0 + a1 + a3 + a4 + a5 + a7 + a9 + a14)(b0 + b1 + b3 + b4 + b5 + b7 + b9 + b14)*(X^2 + X^4 + X^6 + X^9 + X1 + X3 + X7 + X9 + X^21 + X^24 + X^26 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 8, a0, a1, a3, a4, a5, a7, a9, a14), mzd_sum(t2, 8, b0, b1, b3, b4, b5, b7, b9, b14), 0), X, 12, 2, 4, 6, 9, 11, 13, 17, 19, 21, 24, 26, 28); /* (a0 + a1 + a2 + a4 + a6 + a11 + a14)(b0 + b1 + b2 + b4 + b6 + b11 + b14)*(X^2 + X^4 + X^5 + X^6 + X^9 + X1 + X2 + X3 + X7 + X9 + X^20 + X^21 + X^24 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a1, a2, a4, a6, a11, a14), mzd_sum(t2, 7, b0, b1, b2, b4, b6, b11, b14), 0), X, 16, 2, 4, 5, 6, 9, 11, 12, 13, 17, 19, 20, 21, 24, 26, 27, 28); /* (a0 + a2 + a3 + a4 + a6 + a8 + a13)(b0 + b2 + b3 + b4 + b6 + b8 + b13)*(X^2 + X^3 + X^4 + X^5 + X^6 + X^9 + X0 + X1 + X2 + X3 + X7 + X8 + X9 + X^20 + X^21 + X^24 + X^25 + X^26 + X^27 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 7, a0, a2, a3, a4, a6, a8, a13), mzd_sum(t2, 7, b0, b2, b3, b4, b6, b8, b13), 0), X, 20, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28); /* (a0 + a1 + a2 + a3 + a4 + a8 + a9 + a11 + a12 + a13 + a15)(b0 + b1 + b2 + b3 + b4 + b8 + b9 + b11 + b12 + b13 + b15)*(X^3 + X^4 + X^6 + X0 + X1 + X3 + X8 + X9 + X^21 + X^25 + X^26 + X^28) */ _mzd_ptr_add_to_all(ff, mzd_mul(t0, mzd_sum(t1, 11, a0, a1, a2, a3, a4, a8, a9, a11, a12, a13, a15), mzd_sum(t2, 11, b0, b1, b2, b3, b4, b8, b9, b11, b12, b13, b15), 0), X, 12, 3, 4, 6, 10, 11, 13, 18, 19, 21, 25, 26, 28); mzd_free(t0); mzd_free(t1); mzd_free(t2); } m4rie-20200125/m4rie/blm.c0000644000175000017500000006077213206144356011666 00000000000000#include #include #include void _mzd_ptr_apply_blm_mzd(mzd_t **X, const mzd_t **A, const mzd_t **B, const blm_t *f) { assert((f->H!=NULL) & (f->F!=NULL) & (f->G!=NULL) & (f->H->ncols == f->F->nrows) & (f->F->nrows == f->G->nrows)); mzd_t *t0 = mzd_init(A[0]->nrows, B[0]->ncols); mzd_t *t1 = mzd_init(A[0]->nrows, A[0]->ncols); mzd_t *t2 = mzd_init(B[0]->nrows, B[0]->ncols); for(rci_t i=0; i < f->F->nrows; i++) { mzd_set_ui(t1, 0); for(rci_t j=0; j < f->F->ncols; j++) { if(mzd_read_bit(f->F, i, j)) { mzd_add(t1, t1, A[j]); } } mzd_set_ui(t2, 0); for(rci_t j=0; j < f->G->ncols; j++) { if(mzd_read_bit(f->G, i, j)) { mzd_add(t2, t2, B[j]); } } mzd_mul(t0, t1, t2, 0); for(rci_t j=0; j < f->H->nrows; j++) if(mzd_read_bit(f->H, j, i)) _mzd_ptr_add_modred(NULL, t0, X, j); } mzd_free(t0); mzd_free(t1); mzd_free(t2); } blm_t *_blm_djb_compile(blm_t *f) { assert((f->f == NULL) && (f->g == NULL) && (f->h == NULL)); assert((f->F != NULL) && (f->G != NULL) && (f->H != NULL)); mzd_t *F = mzd_copy(NULL, f->F); f->f = djb_compile(F); mzd_free(F); if(mzd_equal(f->F, f->G)) f->g = f->f; else { mzd_t *G = mzd_copy(NULL, f->G); f->g = djb_compile(G); mzd_free(G); } mzd_t *H = mzd_copy(NULL, f->H); f->h = djb_compile(H); mzd_free(H); return f; } void _mzd_ptr_apply_blm_djb(mzd_t **X, const mzd_t **A, const mzd_t **B, const blm_t *f) { assert((f->H!=NULL) & (f->F!=NULL) & (f->G!=NULL) & \ (f->H->ncols == f->F->nrows) & \ (f->F->nrows == f->G->nrows)); mzd_t **t0 = (mzd_t**)m4ri_mm_malloc(sizeof(mzd_t*)*f->F->nrows); mzd_t **t1 = (mzd_t**)m4ri_mm_malloc(sizeof(mzd_t*)*f->F->nrows); mzd_t **t2 = (mzd_t**)m4ri_mm_malloc(sizeof(mzd_t*)*f->F->nrows); for(rci_t i=0; iF->nrows; i++) { t1[i] = mzd_init(A[0]->nrows, A[0]->ncols); t2[i] = mzd_init(B[0]->nrows, B[0]->ncols); } djb_apply_mzd_ptr(f->f, t1, A); djb_apply_mzd_ptr(f->g, t2, B); for(rci_t i=0; iF->nrows; i++) { t0[i] = mzd_init(A[0]->nrows, B[0]->ncols); mzd_mul(t0[i], t1[i], t2[i], 0); mzd_free(t1[i]); mzd_free(t2[i]); } djb_apply_mzd_ptr(f->h, X, (const mzd_t**)t0); for(rci_t i=0; iF->nrows; i++) { mzd_free(t0[i]); } m4ri_mm_free(t0); m4ri_mm_free(t1); m4ri_mm_free(t2); } int *crt_init(const deg_t f_len, const deg_t g_len) { int *p_best = (int*)m4ri_mm_calloc(M4RIE_CRT_LEN, sizeof(int)); int c_best = f_len * g_len; int *p = (int*)m4ri_mm_calloc(M4RIE_CRT_LEN, sizeof(int)); for(deg_t omega=0; omega<8; omega++) { deg_t deg_need = f_len+g_len-1-omega; deg_t deg_have = 0; deg_t deg_poly = 1; p[0] = omega; for(deg_t d=1; d 0) { p[deg_diff]--; deg_have -= deg_diff; } int c = costs[p[0]]; for(deg_t d=1; drows[0][0] = 0x1; return A; case 2: A = mzd_init(3, 2); A->rows[0][0] = 0x1; A->rows[1][0] = 0x3; A->rows[2][0] = 0x2; return A; case 3: A = mzd_init(6, 3); A->rows[0][0] = 0x1; A->rows[1][0] = 0x2; A->rows[2][0] = 0x4; A->rows[3][0] = 0x3; A->rows[4][0] = 0x5; A->rows[5][0] = 0x6; return A; case 4: A = mzd_init(9, 4); A->rows[0][0] = 0x1; A->rows[1][0] = 0x2; A->rows[2][0] = 0x4; A->rows[3][0] = 0x8; A->rows[4][0] = 0xf; A->rows[5][0] = 0x3; A->rows[6][0] = 0x5; A->rows[7][0] = 0xa; A->rows[8][0] = 0xc; return A; case 5: A = mzd_init(13, 5); A->rows[ 0][0] = 0x01; A->rows[ 1][0] = 0x02; A->rows[ 2][0] = 0x08; A->rows[ 3][0] = 0x10; A->rows[ 4][0] = 0x11; A->rows[ 5][0] = 0x03; A->rows[ 6][0] = 0x18; A->rows[ 7][0] = 0x16; A->rows[ 8][0] = 0x0d; A->rows[ 9][0] = 0x1b; A->rows[10][0] = 0x17; A->rows[11][0] = 0x1d; A->rows[12][0] = 0x1f; return A; case 6: A = mzd_init(17, 6); A->rows[ 0][0] = 0x01; A->rows[ 1][0] = 0x02; A->rows[ 2][0] = 0x10; A->rows[ 3][0] = 0x20; A->rows[ 4][0] = 0x30; A->rows[ 5][0] = 0x03; A->rows[ 6][0] = 0x18; A->rows[ 7][0] = 0x06; A->rows[ 8][0] = 0x12; A->rows[ 9][0] = 0x0c; A->rows[10][0] = 0x38; A->rows[11][0] = 0x07; A->rows[12][0] = 0x29; A->rows[13][0] = 0x25; A->rows[14][0] = 0x2d; A->rows[15][0] = 0x1b; A->rows[16][0] = 0x3f; return A; case 7: A = mzd_init(22, 7); A->rows[ 0][0] = 0x7f; A->rows[ 1][0] = 0x6e; A->rows[ 2][0] = 0x3b; A->rows[ 3][0] = 0x5d; A->rows[ 4][0] = 0x6d; A->rows[ 5][0] = 0x5b; A->rows[ 6][0] = 0x36; A->rows[ 7][0] = 0x03; A->rows[ 8][0] = 0x05; A->rows[ 9][0] = 0x11; A->rows[10][0] = 0x0a; A->rows[11][0] = 0x44; A->rows[12][0] = 0x28; A->rows[13][0] = 0x50; A->rows[14][0] = 0x60; A->rows[15][0] = 0x01; A->rows[16][0] = 0x02; A->rows[17][0] = 0x04; A->rows[18][0] = 0x08; A->rows[19][0] = 0x10; A->rows[20][0] = 0x20; A->rows[21][0] = 0x40; return A; case 8: A = mzd_init(27, 8); A->rows[ 0][0] = 0x01; A->rows[ 1][0] = 0x02; A->rows[ 2][0] = 0x04; A->rows[ 3][0] = 0x08; A->rows[ 4][0] = 0x10; A->rows[ 5][0] = 0x20; A->rows[ 6][0] = 0x40; A->rows[ 7][0] = 0x80; A->rows[ 8][0] = 0x05; A->rows[ 9][0] = 0x0c; A->rows[10][0] = 0x44; A->rows[11][0] = 0x30; A->rows[12][0] = 0xc0; A->rows[13][0] = 0x0f; A->rows[14][0] = 0xa0; A->rows[15][0] = 0x11; A->rows[16][0] = 0x0a; A->rows[17][0] = 0xaa; A->rows[18][0] = 0x03; A->rows[19][0] = 0x50; A->rows[20][0] = 0x22; A->rows[21][0] = 0xff; A->rows[22][0] = 0x55; A->rows[23][0] = 0x33; A->rows[24][0] = 0xcc; A->rows[25][0] = 0x88; A->rows[26][0] = 0xf0; return A; case 9: A = mzd_init(31, 9); A->rows[ 0][0] = 0x100; A->rows[ 1][0] = 0x001; A->rows[ 2][0] = 0x002; A->rows[ 3][0] = 0x003; A->rows[ 4][0] = 0x155; A->rows[ 5][0] = 0x0aa; A->rows[ 6][0] = 0x1ff; A->rows[ 7][0] = 0x16d; A->rows[ 8][0] = 0x1b6; A->rows[ 9][0] = 0x0db; A->rows[10][0] = 0x0e9; A->rows[11][0] = 0x13a; A->rows[12][0] = 0x074; A->rows[13][0] = 0x1d3; A->rows[14][0] = 0x09d; A->rows[15][0] = 0x14e; A->rows[16][0] = 0x0b9; A->rows[17][0] = 0x172; A->rows[18][0] = 0x05c; A->rows[19][0] = 0x1cb; A->rows[20][0] = 0x0e5; A->rows[21][0] = 0x12e; A->rows[22][0] = 0x191; A->rows[23][0] = 0x0b2; A->rows[24][0] = 0x164; A->rows[25][0] = 0x0c8; A->rows[26][0] = 0x08f; A->rows[27][0] = 0x123; A->rows[28][0] = 0x0f5; A->rows[29][0] = 0x07a; A->rows[30][0] = 0x1ac; return A; case 10: A = mzd_init(36, 10); A->rows[ 0][0] = 0x200; A->rows[ 1][0] = 0x001; A->rows[ 2][0] = 0x3ff; A->rows[ 3][0] = 0x36d; A->rows[ 4][0] = 0x1b6; A->rows[ 5][0] = 0x2db; A->rows[ 6][0] = 0x0e9; A->rows[ 7][0] = 0x13a; A->rows[ 8][0] = 0x274; A->rows[ 9][0] = 0x1d3; A->rows[10][0] = 0x29d; A->rows[11][0] = 0x34e; A->rows[12][0] = 0x0b9; A->rows[13][0] = 0x172; A->rows[14][0] = 0x25c; A->rows[15][0] = 0x1cb; A->rows[16][0] = 0x2e5; A->rows[17][0] = 0x32e; A->rows[18][0] = 0x191; A->rows[19][0] = 0x2b2; A->rows[20][0] = 0x164; A->rows[21][0] = 0x2c8; A->rows[22][0] = 0x08f; A->rows[23][0] = 0x323; A->rows[24][0] = 0x0f5; A->rows[25][0] = 0x07a; A->rows[26][0] = 0x3ac; A->rows[27][0] = 0x2f1; A->rows[28][0] = 0x1e2; A->rows[29][0] = 0x3c4; A->rows[30][0] = 0x178; A->rows[31][0] = 0x1af; A->rows[32][0] = 0x313; A->rows[33][0] = 0x135; A->rows[34][0] = 0x09a; A->rows[35][0] = 0x2bc; return A; case 11: A = mzd_init(40, 11); A->rows[ 0][0] = 0x001; A->rows[ 1][0] = 0x36d; A->rows[ 2][0] = 0x5b6; A->rows[ 3][0] = 0x6db; A->rows[ 4][0] = 0x555; A->rows[ 5][0] = 0x2aa; A->rows[ 6][0] = 0x7ff; A->rows[ 7][0] = 0x400; A->rows[ 8][0] = 0x200; A->rows[ 9][0] = 0x600; A->rows[10][0] = 0x4e9; A->rows[11][0] = 0x53a; A->rows[12][0] = 0x274; A->rows[13][0] = 0x1d3; A->rows[14][0] = 0x69d; A->rows[15][0] = 0x74e; A->rows[16][0] = 0x4b9; A->rows[17][0] = 0x172; A->rows[18][0] = 0x65c; A->rows[19][0] = 0x5cb; A->rows[20][0] = 0x2e5; A->rows[21][0] = 0x72e; A->rows[22][0] = 0x591; A->rows[23][0] = 0x6b2; A->rows[24][0] = 0x564; A->rows[25][0] = 0x2c8; A->rows[26][0] = 0x48f; A->rows[27][0] = 0x323; A->rows[28][0] = 0x0f5; A->rows[29][0] = 0x47a; A->rows[30][0] = 0x7ac; A->rows[31][0] = 0x2f1; A->rows[32][0] = 0x5e2; A->rows[33][0] = 0x3c4; A->rows[34][0] = 0x578; A->rows[35][0] = 0x1af; A->rows[36][0] = 0x713; A->rows[37][0] = 0x135; A->rows[38][0] = 0x09a; A->rows[39][0] = 0x6bc; return A; case 12: A = mzd_init(45, 12); A->rows[ 0][0] = 0xb6d; A->rows[ 1][0] = 0xdb6; A->rows[ 2][0] = 0x6db; A->rows[ 3][0] = 0x001; A->rows[ 4][0] = 0x002; A->rows[ 5][0] = 0x003; A->rows[ 6][0] = 0x555; A->rows[ 7][0] = 0xaaa; A->rows[ 8][0] = 0xfff; A->rows[ 9][0] = 0x800; A->rows[10][0] = 0x400; A->rows[11][0] = 0xc00; A->rows[12][0] = 0x4e9; A->rows[13][0] = 0xd3a; A->rows[14][0] = 0xa74; A->rows[15][0] = 0x9d3; A->rows[16][0] = 0xe9d; A->rows[17][0] = 0x74e; A->rows[18][0] = 0x591; A->rows[19][0] = 0xeb2; A->rows[20][0] = 0xd64; A->rows[21][0] = 0xac8; A->rows[22][0] = 0xc8f; A->rows[23][0] = 0xb23; A->rows[24][0] = 0x8f5; A->rows[25][0] = 0x47a; A->rows[26][0] = 0x7ac; A->rows[27][0] = 0xaf1; A->rows[28][0] = 0x5e2; A->rows[29][0] = 0xbc4; A->rows[30][0] = 0xd78; A->rows[31][0] = 0x9af; A->rows[32][0] = 0xf13; A->rows[33][0] = 0x135; A->rows[34][0] = 0x89a; A->rows[35][0] = 0x6bc; A->rows[36][0] = 0x631; A->rows[37][0] = 0xa52; A->rows[38][0] = 0x294; A->rows[39][0] = 0x318; A->rows[40][0] = 0xdef; A->rows[41][0] = 0xc63; A->rows[42][0] = 0x4a5; A->rows[43][0] = 0x94a; A->rows[44][0] = 0x18c; return A; case 13: A = mzd_init(49, 13); A->rows[ 0][0] = 0x0001; A->rows[ 1][0] = 0x1b6d; A->rows[ 2][0] = 0x0db6; A->rows[ 3][0] = 0x16db; A->rows[ 4][0] = 0x1555; A->rows[ 5][0] = 0x0aaa; A->rows[ 6][0] = 0x1fff; A->rows[ 7][0] = 0x1000; A->rows[ 8][0] = 0x0800; A->rows[ 9][0] = 0x1800; A->rows[10][0] = 0x14e9; A->rows[11][0] = 0x1d3a; A->rows[12][0] = 0x1a74; A->rows[13][0] = 0x09d3; A->rows[14][0] = 0x0e9d; A->rows[15][0] = 0x074e; A->rows[16][0] = 0x1cb9; A->rows[17][0] = 0x1972; A->rows[18][0] = 0x0e5c; A->rows[19][0] = 0x05cb; A->rows[20][0] = 0x12e5; A->rows[21][0] = 0x172e; A->rows[22][0] = 0x1591; A->rows[23][0] = 0x1eb2; A->rows[24][0] = 0x1d64; A->rows[25][0] = 0x1ac8; A->rows[26][0] = 0x0c8f; A->rows[27][0] = 0x0b23; A->rows[28][0] = 0x08f5; A->rows[29][0] = 0x047a; A->rows[30][0] = 0x07ac; A->rows[31][0] = 0x1af1; A->rows[32][0] = 0x15e2; A->rows[33][0] = 0x0bc4; A->rows[34][0] = 0x0d78; A->rows[35][0] = 0x09af; A->rows[36][0] = 0x0f13; A->rows[37][0] = 0x1135; A->rows[38][0] = 0x189a; A->rows[39][0] = 0x06bc; A->rows[40][0] = 0x0631; A->rows[41][0] = 0x0a52; A->rows[42][0] = 0x1294; A->rows[43][0] = 0x0318; A->rows[44][0] = 0x1def; A->rows[45][0] = 0x0c63; A->rows[46][0] = 0x14a5; A->rows[47][0] = 0x094a; A->rows[48][0] = 0x118c; return A; case 14: A = mzd_init(55, 14); A->rows[ 0][0] = 0x0001; A->rows[ 1][0] = 0x1b6d; A->rows[ 2][0] = 0x2db6; A->rows[ 3][0] = 0x36db; A->rows[ 4][0] = 0x1555; A->rows[ 5][0] = 0x2aaa; A->rows[ 6][0] = 0x3fff; A->rows[ 7][0] = 0x34e9; A->rows[ 8][0] = 0x1d3a; A->rows[ 9][0] = 0x3a74; A->rows[10][0] = 0x29d3; A->rows[11][0] = 0x0e9d; A->rows[12][0] = 0x274e; A->rows[13][0] = 0x1cb9; A->rows[14][0] = 0x3972; A->rows[15][0] = 0x2e5c; A->rows[16][0] = 0x25cb; A->rows[17][0] = 0x32e5; A->rows[18][0] = 0x172e; A->rows[19][0] = 0x3591; A->rows[20][0] = 0x1eb2; A->rows[21][0] = 0x3d64; A->rows[22][0] = 0x3ac8; A->rows[23][0] = 0x2c8f; A->rows[24][0] = 0x2b23; A->rows[25][0] = 0x08f5; A->rows[26][0] = 0x247a; A->rows[27][0] = 0x07ac; A->rows[28][0] = 0x1af1; A->rows[29][0] = 0x35e2; A->rows[30][0] = 0x2bc4; A->rows[31][0] = 0x0d78; A->rows[32][0] = 0x09af; A->rows[33][0] = 0x2f13; A->rows[34][0] = 0x3135; A->rows[35][0] = 0x389a; A->rows[36][0] = 0x26bc; A->rows[37][0] = 0x0631; A->rows[38][0] = 0x0a52; A->rows[39][0] = 0x1294; A->rows[40][0] = 0x2318; A->rows[41][0] = 0x3def; A->rows[42][0] = 0x0c63; A->rows[43][0] = 0x14a5; A->rows[44][0] = 0x294a; A->rows[45][0] = 0x318c; A->rows[46][0] = 0x2000; A->rows[47][0] = 0x1000; A->rows[48][0] = 0x0800; A->rows[49][0] = 0x0400; A->rows[50][0] = 0x3c00; A->rows[51][0] = 0x3000; A->rows[52][0] = 0x2800; A->rows[53][0] = 0x1400; A->rows[54][0] = 0x0c00; return A; case 15: A = mzd_init(60, 15); A->rows[ 0][0] = 0x0001; A->rows[ 1][0] = 0x7fff; A->rows[ 2][0] = 0x5b6d; A->rows[ 3][0] = 0x6db6; A->rows[ 4][0] = 0x36db; A->rows[ 5][0] = 0x4000; A->rows[ 6][0] = 0x2000; A->rows[ 7][0] = 0x6000; A->rows[ 8][0] = 0x74e9; A->rows[ 9][0] = 0x1d3a; A->rows[10][0] = 0x3a74; A->rows[11][0] = 0x69d3; A->rows[12][0] = 0x4e9d; A->rows[13][0] = 0x274e; A->rows[14][0] = 0x5cb9; A->rows[15][0] = 0x3972; A->rows[16][0] = 0x2e5c; A->rows[17][0] = 0x65cb; A->rows[18][0] = 0x72e5; A->rows[19][0] = 0x172e; A->rows[20][0] = 0x7591; A->rows[21][0] = 0x1eb2; A->rows[22][0] = 0x3d64; A->rows[23][0] = 0x7ac8; A->rows[24][0] = 0x2c8f; A->rows[25][0] = 0x6b23; A->rows[26][0] = 0x48f5; A->rows[27][0] = 0x647a; A->rows[28][0] = 0x47ac; A->rows[29][0] = 0x1af1; A->rows[30][0] = 0x35e2; A->rows[31][0] = 0x6bc4; A->rows[32][0] = 0x4d78; A->rows[33][0] = 0x09af; A->rows[34][0] = 0x2f13; A->rows[35][0] = 0x7135; A->rows[36][0] = 0x789a; A->rows[37][0] = 0x26bc; A->rows[38][0] = 0x4631; A->rows[39][0] = 0x4a52; A->rows[40][0] = 0x5294; A->rows[41][0] = 0x6318; A->rows[42][0] = 0x3def; A->rows[43][0] = 0x0c63; A->rows[44][0] = 0x14a5; A->rows[45][0] = 0x294a; A->rows[46][0] = 0x318c; A->rows[47][0] = 0x4d21; A->rows[48][0] = 0x1a42; A->rows[49][0] = 0x7348; A->rows[50][0] = 0x6690; A->rows[51][0] = 0x2bb1; A->rows[52][0] = 0x5763; A->rows[53][0] = 0x15d8; A->rows[54][0] = 0x0576; A->rows[55][0] = 0x47cd; A->rows[56][0] = 0x42bb; A->rows[57][0] = 0x4857; A->rows[58][0] = 0x215d; A->rows[59][0] = 0x3b1f; return A; case 16: A = mzd_init(64, 16); A->rows[ 0][0] = 0xdb6d; A->rows[ 1][0] = 0x6db6; A->rows[ 2][0] = 0xb6db; A->rows[ 3][0] = 0x0001; A->rows[ 4][0] = 0x0002; A->rows[ 5][0] = 0x0003; A->rows[ 6][0] = 0x5555; A->rows[ 7][0] = 0xaaaa; A->rows[ 8][0] = 0xffff; A->rows[ 9][0] = 0x8000; A->rows[10][0] = 0x4000; A->rows[11][0] = 0xc000; A->rows[12][0] = 0x74e9; A->rows[13][0] = 0x9d3a; A->rows[14][0] = 0x3a74; A->rows[15][0] = 0xe9d3; A->rows[16][0] = 0x4e9d; A->rows[17][0] = 0xa74e; A->rows[18][0] = 0x5cb9; A->rows[19][0] = 0xb972; A->rows[20][0] = 0x2e5c; A->rows[21][0] = 0xe5cb; A->rows[22][0] = 0x72e5; A->rows[23][0] = 0x972e; A->rows[24][0] = 0xf591; A->rows[25][0] = 0x1eb2; A->rows[26][0] = 0x3d64; A->rows[27][0] = 0x7ac8; A->rows[28][0] = 0xac8f; A->rows[29][0] = 0xeb23; A->rows[30][0] = 0xc8f5; A->rows[31][0] = 0x647a; A->rows[32][0] = 0x47ac; A->rows[33][0] = 0x9af1; A->rows[34][0] = 0x35e2; A->rows[35][0] = 0x6bc4; A->rows[36][0] = 0x4d78; A->rows[37][0] = 0x89af; A->rows[38][0] = 0xaf13; A->rows[39][0] = 0xf135; A->rows[40][0] = 0x789a; A->rows[41][0] = 0x26bc; A->rows[42][0] = 0xc631; A->rows[43][0] = 0x4a52; A->rows[44][0] = 0x5294; A->rows[45][0] = 0x6318; A->rows[46][0] = 0xbdef; A->rows[47][0] = 0x8c63; A->rows[48][0] = 0x94a5; A->rows[49][0] = 0x294a; A->rows[50][0] = 0x318c; A->rows[51][0] = 0xcd21; A->rows[52][0] = 0x9a42; A->rows[53][0] = 0xf348; A->rows[54][0] = 0xe690; A->rows[55][0] = 0x2bb1; A->rows[56][0] = 0x5763; A->rows[57][0] = 0x15d8; A->rows[58][0] = 0x8576; A->rows[59][0] = 0xc7cd; A->rows[60][0] = 0x42bb; A->rows[61][0] = 0x4857; A->rows[62][0] = 0x215d; A->rows[63][0] = 0xbb1f; return A; default: m4ri_die("only degrees up to 16 are implemented but got degree %d\n", degree); } return NULL; } /** * \param length The length of the polynomial we want to reduce * \param poly A polynomial * \param d The degree of poly */ mzd_t *_crt_modred_mat(const deg_t length, const word poly, const deg_t d) { mzd_t *A = mzd_init(d, length); /* (x-infinity)^d */ if (poly == 0) { for(deg_t i=0; irows[0][i/m4ri_radix] = __M4RI_TWOPOW(i%m4ri_radix); word ii = i; while(ii >= d) { /* f ^= gf2x_mul((1ULL<<(ii-d)), poly, length); */ mzd_set_ui(t, 0); mzd_xor_bits(t, 0, ii-d, d+1, poly); mzd_add(f, f, t); /* ii = gf2x_deg(f); */ ii = 0; for(wi_t j=f->width-1; j>=0; j--) { if (f->rows[0][j]) { ii = gf2x_deg(f->rows[0][j]) + m4ri_radix*j; break; } } } for(deg_t j=0; j<= ii; j++) mzd_write_bit(A, j, i, (f->rows[0][j/m4ri_radix]>>(j%m4ri_radix)) & 0x1); } return A; } blm_t *_blm_finish_polymult(const gf2e *ff, blm_t *f) { assert( (f != NULL) & (f->F != NULL) & (f->G != NULL) ); const rci_t m = f->F->nrows; const rci_t c_nrows = f->F->ncols + f->G->ncols - 1; mzd_t *H = mzd_init(c_nrows, m); mzd_t *F_T = mzd_transpose(NULL, f->F); mzd_t *G_T = mzd_transpose(NULL, f->G); mzd_t *C = mzd_init(m, m); /* we find a full rank matrix */ word v = 0; word w = 0; rci_t r = 0; rci_t rank = 0; mzd_t *pivots = mzd_init(m, m4ri_radix*2); mzp_t *P = mzp_init(m); mzp_t *Q = mzp_init(m); while(rank < m) { /* x^v = (0, 0, ... , 1, ..., 0, 0) * F_T -> select row v */ for(wi_t j=0; j< C->width; j++) C->rows[r][j] = F_T->rows[v][j] & G_T->rows[w][j]; pivots->rows[r][0] = v; pivots->rows[r][1] = w; w++; if (w == (word)f->G->ncols) { v++; if (v == (word)f->F->ncols) v = 0; w = v; } r++; if (r == C->nrows) { mzd_t *D = mzd_copy(NULL, C); rank = mzd_ple(D, P, Q, 0); mzd_apply_p_left(pivots, P); mzd_apply_p_left(C, P); mzd_free(D); if (rank < m) r = rank; } } mzp_free(P); mzp_free(Q); for(r=0; r select row v */ v = pivots->rows[r][0]; w = pivots->rows[r][1]; for(wi_t j=0; j< C->width; j++) C->rows[r][j] = F_T->rows[v][j] & G_T->rows[w][j]; } mzd_free(F_T); mzd_free(G_T); // This should be replaced by TRSM calls mzd_t *D = mzd_inv_m4ri(NULL, C, 0); mzd_free(C); mzd_t *DT = mzd_transpose(NULL, D); mzd_free(D); mzd_t *a = mzd_init(1, m); mzd_t *b = mzd_init(1, H->ncols); for(rci_t i=0; inrows; i++) { mzd_set_ui(a, 0); for(rci_t j=0; jrows[j][0]; w = pivots->rows[j][1]; if ((v+w) == (word)i) mzd_write_bit(a, 0, j, 1); } mzd_mul(b, a, DT, 0); /* copy result to H */ for(rci_t j=0; jncols; j++) mzd_write_bit(H, i, j, mzd_read_bit(b, 0, j )); } mzd_free(a); mzd_free(b); mzd_free(pivots); if (ff == NULL) { f->H = H; } else { mzd_t *N = _crt_modred_mat(H->nrows, ff->minpoly, ff->degree); f->H = mzd_mul(NULL, N, H, 0); mzd_free(N); mzd_free(H); } return f; } const int costs[17] = {0, 1, 3, 6, 9, 13, 17, 22, 27, 31, 36, 40, 45, 49, 55, 60, 64}; //const int costs[17] = {0, 1, 3, 6, 9, 13, 15, 22, 24, 30, 33, 39, 42, 48, 51, 54, 60}; /* best possible */ blm_t *blm_init_crt(const gf2e *ff, const deg_t f_ncols, const deg_t g_ncols, const int *p, int djb) { blm_t *f = m4ri_mm_malloc(sizeof(blm_t)); // iterator over irreducible polynomials int *p_it = (int*)m4ri_mm_calloc(sizeof(int), M4RIE_CRT_LEN); mzd_t *M, *T; word poly = 0; rci_t m = costs[p[0]]; for(int d=1; dF = mzd_init(m, f_ncols); f->f = NULL; f->G = mzd_init(m, g_ncols); f->g = NULL; rci_t r = 0; /** * 1) We construct maps F,G which combine modular reduction to degree d and the linear map * required for multiplying modulo a polynomial of degree d. */ /** * 1.1) We deal with (x+infinity)^omega first */ if(p[0] != 0) { deg_t d = p[0]; mzd_t *N = _small_multiplication_map(d); M = _crt_modred_mat(f_ncols, poly, d); T = mzd_init_window(f->F, r, 0, r + costs[d], f_ncols); mzd_mul(T, N, M, 0); mzd_free(T); mzd_free(M); M = _crt_modred_mat(g_ncols, poly, d); T = mzd_init_window(f->G, r, 0, r + costs[d], g_ncols); mzd_mul(T, N, M, 0); mzd_free(T); mzd_free(M); mzd_free(N); r += costs[d]; } /** * 1.2) We deal with regular polynomial which are co-prime */ for(deg_t d=1; dF, r, 0, r + costs[d], f_ncols); mzd_mul(T, N, M, 0); mzd_free(T); mzd_free(M); M = _crt_modred_mat(g_ncols, poly, d); T = mzd_init_window(f->G, r, 0, r + costs[d], g_ncols); mzd_mul(T, N, M, 0); mzd_free(T); mzd_free(M); r += costs[d]; } mzd_free(N); } m4ri_mm_free(p_it); /** * 2) We solve for H as we know poly(c) and (F*vec(a) x G*vec(b)). We pick points poly(a) = x^v, * poly(b) = x^w (hence: poly(c) = x^(v+w)). */ _blm_finish_polymult(ff, f); f->h = NULL; /** * 3) We compile DJB maps if asked for. */ if (djb) _blm_djb_compile(f); return f; } void blm_free(blm_t *f) { mzd_free(f->F); mzd_free(f->G); mzd_free(f->H); if (f->f != f->g) djb_free(f->g); djb_free(f->f); djb_free(f->h); m4ri_mm_free(f); } m4rie-20200125/m4rie/trsm.c0000644000175000017500000000346713206144356012077 00000000000000#include "trsm.h" #include "newton_john.h" #include "conversion.h" void mzed_trsm_upper_left_naive(const mzed_t *U, mzed_t *B) { assert(U->finite_field == B->finite_field); assert(U->nrows == U->ncols); assert(B->nrows == U->ncols); const gf2e *ff = U->finite_field; for(int i=B->nrows-1; i>=0; i--) { for(rci_t k=i+1; knrows; k++) { mzed_add_multiple_of_row(B, i, B, k, mzed_read_elem(U, i, k), 0); } mzed_rescale_row(B, i, 0, gf2e_inv(ff, mzed_read_elem(U, i, i))); } } void mzed_trsm_lower_left_naive(const mzed_t *L, mzed_t *B) { assert(L->finite_field == B->finite_field); assert(L->nrows == L->ncols); assert(B->nrows == L->ncols); const gf2e *ff = L->finite_field; for(rci_t i=0; inrows; i++) { for(rci_t k=0; kfinite_field == B->finite_field); assert(U->nrows == U->ncols); assert(B->nrows == U->ncols); const mzed_t *Ue = mzed_cling(NULL, U); mzed_t *Be = mzed_cling(NULL, B); mzed_trsm_upper_left_naive(Ue, Be); mzed_slice(B, Be); mzed_free((mzed_t*)Ue); mzed_free(Be); } void mzd_slice_trsm_lower_left_naive(const mzd_slice_t *L, mzd_slice_t *B) { assert(L->finite_field == B->finite_field); assert(L->nrows == L->ncols); assert(B->nrows == L->ncols); const mzed_t *Le = mzed_cling(NULL, L); mzed_t *Be = mzed_cling(NULL, B); mzed_trsm_lower_left_naive(Le, Be); mzed_slice(B, Be); mzed_free((mzed_t*)Le); mzed_free(Be); } #include "mzed_intro.inl" #include "trsm.inl" #include "mzed_outro.inl" #include "mzd_slice_intro.inl" #include "trsm.inl" #include "mzd_slice_outro.inl" m4rie-20200125/m4rie/ple.c0000644000175000017500000001257013206144356011665 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2011 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "permutation.h" #include "trsm.h" #include "ple.h" #include "newton_john.h" rci_t mzed_ple_naive(mzed_t *A, mzp_t *P, mzp_t *Q) { rci_t col_pos = 0; rci_t row_pos = 0; word tmp = 0; const gf2e *ff = A->finite_field; rci_t i,j; int found = 0; while (row_pos < A->nrows && col_pos < A->ncols) { found = 0; for(j=col_pos; jncols; j++) { for(i=row_pos; inrows; i++) { if( (tmp = mzed_read_elem(A, i,j)) != 0) { found = 1; break; } } if (found) break; } if (found) { P->values[row_pos] = i; Q->values[row_pos] = j; mzed_row_swap(A, row_pos, i); if(j+1 < A->ncols) { mzed_rescale_row(A, row_pos, j+1, gf2e_inv(ff, tmp)); for(rci_t l=row_pos+1; lnrows; l++) { if ((tmp = mzed_read_elem(A,l,j))) mzed_add_multiple_of_row(A, l, A, row_pos, tmp, j+1); } } row_pos++; col_pos = j + 1; } else { break; } } for (rci_t i = row_pos; i < A->nrows; ++i) P->values[i] = i; for (rci_t i = row_pos; i < A->ncols; ++i) Q->values[i] = i; for (rci_t i=0; i < row_pos; i++) { mzed_col_swap_in_rows(A, i, Q->values[i], i, A->nrows); } return row_pos; } rci_t _mzed_ple(mzed_t *A, mzp_t *P, mzp_t *Q, rci_t cutoff) { if (cutoff == 0) cutoff = __M4RIE_PLE_CUTOFF; if ((A->ncols > m4ri_radix && (gf2e_degree_to_w(A->finite_field) * A->ncols * A->nrows) > cutoff)) { mzd_slice_t *a = mzed_slice(NULL, A); rci_t r = _mzd_slice_ple(a, P, Q, cutoff); mzed_cling(A, a); mzd_slice_free(a); return r; } else { return mzed_ple_newton_john(A, P, Q); } } rci_t _mzd_slice_ple(mzd_slice_t *A, mzp_t *P, mzp_t *Q, rci_t cutoff) { const rci_t ncols = A->ncols; const rci_t nrows = A->nrows; if (cutoff == 0) cutoff = __M4RIE_PLE_CUTOFF; if (ncols <= m4ri_radix || (gf2e_degree_to_w(A->finite_field) * A->ncols * A->nrows) <= cutoff) { mzed_t *Abar = mzed_cling(NULL, A); rci_t r = mzed_ple_newton_john(Abar, P, Q); mzed_slice(A, Abar); mzed_free(Abar); return r; } /* n1 * ------------------------------------------ * | A0 | A1 | * ------------------------------------------ */ rci_t n1 = (((ncols - 1) / m4ri_radix + 1) >> 1) * m4ri_radix; mzd_slice_t *A0 = mzd_slice_init_window(A, 0, 0, nrows, n1); mzd_slice_t *A1 = mzd_slice_init_window(A, 0, n1, nrows, ncols); mzp_t *P1 = mzp_init_window(P, 0, nrows); mzp_t *Q1 = mzp_init_window(Q, 0, A0->ncols); rci_t r1 = _mzd_slice_ple(A0, P1, Q1, cutoff); /* r1 n1 * ------------------------------------------ * | A00 | | A01 | * r1------------------------------------------ * | A10 | | A11 | * ------------------------------------------ */ mzd_slice_t *A00 = mzd_slice_init_window(A, 0, 0, r1, r1); mzd_slice_t *A10 = mzd_slice_init_window(A, r1, 0, nrows, r1); mzd_slice_t *A01 = mzd_slice_init_window(A, 0, n1, r1, ncols); mzd_slice_t *A11 = mzd_slice_init_window(A, r1, n1, nrows, ncols); if (r1) { /* Computation of the Schur complement */ mzd_slice_apply_p_left(A1, P1); mzd_slice_trsm_lower_left(A00, A01); mzd_slice_addmul(A11, A10, A01); } mzp_free_window(P1); mzp_free_window(Q1); mzp_t *P2 = mzp_init_window(P, r1, nrows); mzp_t *Q2 = mzp_init_window(Q, n1, ncols); rci_t r2 = _mzd_slice_ple(A11, P2, Q2, cutoff); /* n * ------------------- * | A0b | * r1----------------- * | A1b | * ------------------- */ /* Update A10 */ mzd_slice_apply_p_left(A10, P2); /* Update P */ for (rci_t i = 0; i < nrows - r1; ++i) P2->values[i] += r1; /* Update the A0b block (permutation + rotation) */ for(rci_t i=0, j=n1; j < ncols; ++i, ++j) Q2->values[i] += n1; for(rci_t i=n1, j = r1; i < n1 + r2; ++i, ++j) Q->values[j] = Q->values[i]; _mzd_slice_compress_l(A, r1, n1, r2); mzp_free_window(Q2); mzp_free_window(P2); mzd_slice_free_window(A0); mzd_slice_free_window(A1); mzd_slice_free_window(A00); mzd_slice_free_window(A01); mzd_slice_free_window(A10); mzd_slice_free_window(A11); return r1 + r2; } rci_t _mzd_slice_pluq(mzd_slice_t *A, mzp_t *P, mzp_t *Q, rci_t cutoff) { rci_t r = _mzd_slice_ple(A, P, Q, cutoff); if(r && r < A->nrows) { mzd_slice_t *A0 = mzd_slice_init_window(A, 0, 0, r, A->ncols); mzd_slice_apply_p_right_trans_tri(A0, Q); mzd_slice_free_window(A0); } else { mzd_slice_apply_p_right_trans_tri(A, Q); } return r; } m4rie-20200125/m4rie/conversion.c0000644000175000017500000004046613206144356013277 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010-2013 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "conversion.h" static inline word word_slice_64_02(word a) { a = (a & xcccccccc) | (a & xcccccccc>> 2)<< 1; a = (a & xf0f0f0f0) | (a & xf0f0f0f0>> 4)<< 2; a = (a & xff00ff00) | (a & xff00ff00>> 8)<< 4; a = (a & xffff0000) | (a & xffff0000>>16)<< 8; a = (a & xffffffff) | (a & xffffffff>>32)<<16; return a; } static inline word word_slice_64_04(word a) { a = (a & xf0f0f0f0) | (a & xf0f0f0f0>> 4)<< 3; a = (a & xff00ff00) | (a & xff00ff00>> 8)<< 6; a = (a & xffff0000) | (a & xffff0000>>16)<<12; a = (a & xffffffff) | (a & xffffffff>>32)<<24; return a; } static inline word word_cling_64_02(word a) { a = (a & xffff0000 & x__left32) | (a & (xffff0000>>16) & x__left32)>>16; a = (a & xff00ff00) | (a & xff00ff00>> 8)>> 8; a = (a & xf0f0f0f0) | (a & xf0f0f0f0>> 4)>> 4; a = (a & xcccccccc) | (a & xcccccccc>> 2)>> 2; a = (a & xaaaaaaaa) | (a & xaaaaaaaa>> 1)>> 1; return a; } static inline word word_cling_64_04(word a) { a = (a & xff00ff00 & x__left16) | (a & (xff00ff00>> 8) & x__left16)>>24; a = (a & xf0f0f0f0) | (a & xf0f0f0f0>> 4)>>12; a = (a & xcccccccc) | (a & xcccccccc>> 2)>> 6; a = (a & xaaaaaaaa) | (a & xaaaaaaaa>> 1)>> 3; return a; } mzd_slice_t *mzed_slice(mzd_slice_t *A, const mzed_t *Z) { if (A == NULL) { A = mzd_slice_init(Z->finite_field, Z->nrows, Z->ncols); } else { mzd_slice_set_ui(A, 0); } switch(Z->finite_field->degree) { case 2: return _mzed_slice2(A,Z); case 3: return _mzed_slice4(A,Z); case 4: return _mzed_slice4(A,Z); case 5: return _mzed_slice8(A,Z); case 6: return _mzed_slice8(A,Z); case 7: return _mzed_slice8(A,Z); case 8: return _mzed_slice8(A,Z); case 9: return _mzed_slice16(A,Z); case 10: return _mzed_slice16(A,Z); case 11: return _mzed_slice16(A,Z); case 12: return _mzed_slice16(A,Z); case 13: return _mzed_slice16(A,Z); case 14: return _mzed_slice16(A,Z); case 15: return _mzed_slice16(A,Z); case 16: return _mzed_slice16(A,Z); default: m4ri_die("slicing not implemented for this degree"); } return A; } mzed_t *mzed_cling(mzed_t *A, const mzd_slice_t *Z) { if (A == NULL) { A = mzed_init(Z->finite_field, Z->nrows, Z->ncols); } else { mzed_set_ui(A, 0); } switch(Z->finite_field->degree) { case 2: return _mzed_cling2(A,Z); case 3: return _mzed_cling4(A,Z); case 4: return _mzed_cling4(A,Z); case 5: return _mzed_cling8(A,Z); case 6: return _mzed_cling8(A,Z); case 7: return _mzed_cling8(A,Z); case 8: return _mzed_cling8(A,Z); case 9: return _mzed_cling16(A,Z); case 10: return _mzed_cling16(A,Z); case 11: return _mzed_cling16(A,Z); case 12: return _mzed_cling16(A,Z); case 13: return _mzed_cling16(A,Z); case 14: return _mzed_cling16(A,Z); case 15: return _mzed_cling16(A,Z); case 16: return _mzed_cling16(A,Z); default: m4ri_die("clinging not implemented for this degree"); } return A; } mzd_slice_t *_mzed_slice2(mzd_slice_t *T, const mzed_t *F) { assert(T && (T->depth >= 2)); size_t j, j2 = 0; const word bitmask_end = T->x[0]->high_bitmask; register word r0,r1,r2,r3; if (mzed_is_zero(F)) return T; for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; const word *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+2 < F->x->width; j+=2,j2++) { r0 = f[j+0], r1 = f[j+1]; r2 = word_slice_64_02(r0<<1 & xaaaaaaaa); r3 = word_slice_64_02(r1<<1 & xaaaaaaaa); t0[j2] = r3 | (r2>>32); r2 = word_slice_64_02(r0<<0 & xaaaaaaaa); r3 = word_slice_64_02(r1<<0 & xaaaaaaaa); t1[j2] = r3 | (r2>>32); } switch(F->x->width - j) { case 2: r0 = f[j+0]; r1 = f[j+1]; r2 = word_slice_64_02(r0<<1 & xaaaaaaaa); r3 = word_slice_64_02(r1<<1 & xaaaaaaaa); t0[j2] &= ~bitmask_end; t0[j2] |= (r3 | (r2>>32)) & bitmask_end; r2 = word_slice_64_02(r0<<0 & xaaaaaaaa); r3 = word_slice_64_02(r1<<0 & xaaaaaaaa); t1[j2] &= ~bitmask_end; t1[j2] |= (r3 | (r2>>32)) & bitmask_end; break; case 1: r0 = f[j+0]; r2 = word_slice_64_02(r0<<1 & xaaaaaaaa); t0[j2] &= ~bitmask_end; t0[j2] |= (r2>>32) & bitmask_end; r2 = word_slice_64_02(r0<<0 & xaaaaaaaa); t1[j2] &= ~bitmask_end; t1[j2] |= (r2>>32) & bitmask_end; break; default: m4ri_die("impossible"); } } return T; } mzed_t *_mzed_cling2(mzed_t *T, const mzd_slice_t *F) { size_t j,j2 = 0; register word tmp; const word bitmask_end = T->x->high_bitmask; if (mzd_slice_is_zero(F)) return T; for(size_t i=0; inrows; i++) { const word *f0 = F->x[0]->rows[i]; const word *f1 = F->x[1]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+2 < T->x->width; j+=2, j2++) { t[j+0] = (word_cling_64_02(f0[j2]<<32)>>1) | (word_cling_64_02(f1[j2]<<32)>>0); t[j+1] = (word_cling_64_02(f0[j2]<< 0)>>1) | (word_cling_64_02(f1[j2]<< 0)>>0); } switch(T->x->width - j) { case 2: tmp = (word_cling_64_02(f0[j2]<< 0)>>1) | (word_cling_64_02(f1[j2]<< 0)>>0); t[j+0] = (word_cling_64_02(f0[j2]<<32)>>1) | (word_cling_64_02(f1[j2]<<32)>>0); t[j+1] = (t[j+1] & ~bitmask_end) | (tmp & bitmask_end); break; case 1: tmp = (word_cling_64_02(f0[j2]<<32)>>1) | (word_cling_64_02(f1[j2]<<32)>>0); t[j+0] = (t[j+0] & ~bitmask_end) | (tmp & bitmask_end); break; } } return T; } mzd_slice_t *_mzed_slice4(mzd_slice_t *T, const mzed_t *F) { assert(T && (T->depth == 3 || T->depth == 4)); size_t j, j2 = 0; register word r0,r1,r2,r3 = 0; const word bitmask_end = T->x[0]->high_bitmask; if (mzed_is_zero(F)) return T; if (T->depth == 3) { for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; word *t2 = T->x[2]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+4 < F->x->width; j+=4,j2++) { t0[j2] = word_slice_64_04(f[j+0]<<3 & x88888888)>>48 | word_slice_64_04(f[j+1]<<3 & x88888888)>>32 \ | word_slice_64_04(f[j+2]<<3 & x88888888)>>16 | word_slice_64_04(f[j+3]<<3 & x88888888)>> 0; t1[j2] = word_slice_64_04(f[j+0]<<2 & x88888888)>>48 | word_slice_64_04(f[j+1]<<2 & x88888888)>>32 \ | word_slice_64_04(f[j+2]<<2 & x88888888)>>16 | word_slice_64_04(f[j+3]<<2 & x88888888)>> 0; t2[j2] = word_slice_64_04(f[j+0]<<1 & x88888888)>>48 | word_slice_64_04(f[j+1]<<1 & x88888888)>>32 \ | word_slice_64_04(f[j+2]<<1 & x88888888)>>16 | word_slice_64_04(f[j+3]<<1 & x88888888)>> 0; } r0 = r1 = r2 = 0; switch(F->x->width - j) { case 4: r0 |= word_slice_64_04(f[j+3]<<3 & x88888888)>> 0; r1 |= word_slice_64_04(f[j+3]<<2 & x88888888)>> 0; r2 |= word_slice_64_04(f[j+3]<<1 & x88888888)>> 0; case 3: r0 |= word_slice_64_04(f[j+2]<<3 & x88888888)>>16; r1 |= word_slice_64_04(f[j+2]<<2 & x88888888)>>16; r2 |= word_slice_64_04(f[j+2]<<1 & x88888888)>>16; case 2: r0 |= word_slice_64_04(f[j+1]<<3 & x88888888)>>32; r1 |= word_slice_64_04(f[j+1]<<2 & x88888888)>>32; r2 |= word_slice_64_04(f[j+1]<<1 & x88888888)>>32; case 1: r0 |= word_slice_64_04(f[j+0]<<3 & x88888888)>>48; r1 |= word_slice_64_04(f[j+0]<<2 & x88888888)>>48; r2 |= word_slice_64_04(f[j+0]<<1 & x88888888)>>48; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; } } else { for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; word *t2 = T->x[2]->rows[i]; word *t3 = T->x[3]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+4 < F->x->width; j+=4,j2++) { t0[j2] = word_slice_64_04(f[j+0]<<3 & x88888888)>>48 | word_slice_64_04(f[j+1]<<3 & x88888888)>>32 \ | word_slice_64_04(f[j+2]<<3 & x88888888)>>16 | word_slice_64_04(f[j+3]<<3 & x88888888)>> 0; t1[j2] = word_slice_64_04(f[j+0]<<2 & x88888888)>>48 | word_slice_64_04(f[j+1]<<2 & x88888888)>>32 \ | word_slice_64_04(f[j+2]<<2 & x88888888)>>16 | word_slice_64_04(f[j+3]<<2 & x88888888)>> 0; t2[j2] = word_slice_64_04(f[j+0]<<1 & x88888888)>>48 | word_slice_64_04(f[j+1]<<1 & x88888888)>>32 \ | word_slice_64_04(f[j+2]<<1 & x88888888)>>16 | word_slice_64_04(f[j+3]<<1 & x88888888)>> 0; t3[j2] = word_slice_64_04(f[j+0]<<0 & x88888888)>>48 | word_slice_64_04(f[j+1]<<0 & x88888888)>>32 \ | word_slice_64_04(f[j+2]<<0 & x88888888)>>16 | word_slice_64_04(f[j+3]<<0 & x88888888)>> 0; } r0 = r1 = r2 = r3 = 0; switch(F->x->width - j) { case 4: r0 |= word_slice_64_04(f[j+3]<<3 & x88888888)>> 0; r1 |= word_slice_64_04(f[j+3]<<2 & x88888888)>> 0; r2 |= word_slice_64_04(f[j+3]<<1 & x88888888)>> 0; r3 |= word_slice_64_04(f[j+3]<<0 & x88888888)>> 0; case 3: r0 |= word_slice_64_04(f[j+2]<<3 & x88888888)>>16; r1 |= word_slice_64_04(f[j+2]<<2 & x88888888)>>16; r2 |= word_slice_64_04(f[j+2]<<1 & x88888888)>>16; r3 |= word_slice_64_04(f[j+2]<<0 & x88888888)>>16; case 2: r0 |= word_slice_64_04(f[j+1]<<3 & x88888888)>>32; r1 |= word_slice_64_04(f[j+1]<<2 & x88888888)>>32; r2 |= word_slice_64_04(f[j+1]<<1 & x88888888)>>32; r3 |= word_slice_64_04(f[j+1]<<0 & x88888888)>>32; case 1: r0 |= word_slice_64_04(f[j+0]<<3 & x88888888)>>48; r1 |= word_slice_64_04(f[j+0]<<2 & x88888888)>>48; r2 |= word_slice_64_04(f[j+0]<<1 & x88888888)>>48; r3 |= word_slice_64_04(f[j+0]<<0 & x88888888)>>48; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; } } return T; } mzed_t *_mzed_cling4(mzed_t *T, const mzd_slice_t *F) { size_t j,j2 = 0; const word bitmask_end = T->x->high_bitmask; if (mzd_slice_is_zero(F)) return T; if (F->finite_field->degree == 4) { for(rci_t i=0; inrows; i++) { const word *f0 = F->x[0]->rows[i]; const word *f1 = F->x[1]->rows[i]; const word *f2 = F->x[2]->rows[i]; const word *f3 = F->x[3]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+4 < T->x->width; j+=4, j2++) { t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1) | (word_cling_64_04(f3[j2]<<48)>>0); t[j+1] = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1) | (word_cling_64_04(f3[j2]<<32)>>0); t[j+2] = (word_cling_64_04(f0[j2]<<16)>>3) | (word_cling_64_04(f1[j2]<<16)>>2) | (word_cling_64_04(f2[j2]<<16)>>1) | (word_cling_64_04(f3[j2]<<16)>>0); t[j+3] = (word_cling_64_04(f0[j2]<< 0)>>3) | (word_cling_64_04(f1[j2]<< 0)>>2) | (word_cling_64_04(f2[j2]<< 0)>>1) | (word_cling_64_04(f3[j2]<< 0)>>0); } register word tmp=0; switch(T->x->width - j) { case 4: t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1) | (word_cling_64_04(f3[j2]<<48)>>0); t[j+1] = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1) | (word_cling_64_04(f3[j2]<<32)>>0); t[j+2] = (word_cling_64_04(f0[j2]<<16)>>3) | (word_cling_64_04(f1[j2]<<16)>>2) | (word_cling_64_04(f2[j2]<<16)>>1) | (word_cling_64_04(f3[j2]<<16)>>0); tmp = (word_cling_64_04(f0[j2]<< 0)>>3) | (word_cling_64_04(f1[j2]<< 0)>>2) | (word_cling_64_04(f2[j2]<< 0)>>1) | (word_cling_64_04(f3[j2]<< 0)>>0); t[j+3] = (t[j+3] & ~bitmask_end) | (tmp & bitmask_end); break; case 3: t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1) | (word_cling_64_04(f3[j2]<<48)>>0); t[j+1] = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1) | (word_cling_64_04(f3[j2]<<32)>>0); tmp = (word_cling_64_04(f0[j2]<<16)>>3) | (word_cling_64_04(f1[j2]<<16)>>2) | (word_cling_64_04(f2[j2]<<16)>>1) | (word_cling_64_04(f3[j2]<<16)>>0); t[j+2] = (t[j+2] & ~bitmask_end) | (tmp & bitmask_end); break; case 2: t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1) | (word_cling_64_04(f3[j2]<<48)>>0); tmp = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1) | (word_cling_64_04(f3[j2]<<32)>>0); t[j+1] = (t[j+1] & ~bitmask_end) | (tmp & bitmask_end); break; case 1: tmp = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1) | (word_cling_64_04(f3[j2]<<48)>>0); t[j+0] = (t[j+0] & ~bitmask_end) | (tmp & bitmask_end); break; default: m4ri_die("impossible"); } } } else { //degree == 3 for(rci_t i=0; inrows; i++) { const word *f0 = F->x[0]->rows[i]; const word *f1 = F->x[1]->rows[i]; const word *f2 = F->x[2]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+4 < T->x->width; j+=4, j2++) { t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1); t[j+1] = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1); t[j+2] = (word_cling_64_04(f0[j2]<<16)>>3) | (word_cling_64_04(f1[j2]<<16)>>2) | (word_cling_64_04(f2[j2]<<16)>>1); t[j+3] = (word_cling_64_04(f0[j2]<< 0)>>3) | (word_cling_64_04(f1[j2]<< 0)>>2) | (word_cling_64_04(f2[j2]<< 0)>>1); } register word tmp=0; switch(T->x->width - j) { case 4: t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1); t[j+1] = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1); t[j+2] = (word_cling_64_04(f0[j2]<<16)>>3) | (word_cling_64_04(f1[j2]<<16)>>2) | (word_cling_64_04(f2[j2]<<16)>>1); tmp = (word_cling_64_04(f0[j2]<< 0)>>3) | (word_cling_64_04(f1[j2]<< 0)>>2) | (word_cling_64_04(f2[j2]<< 0)>>1); t[j+3] = (t[j+3] & ~bitmask_end) | (tmp & bitmask_end); break; case 3: t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1); t[j+1] = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1); tmp = (word_cling_64_04(f0[j2]<<16)>>3) | (word_cling_64_04(f1[j2]<<16)>>2) | (word_cling_64_04(f2[j2]<<16)>>1); t[j+2] = (t[j+2] & ~bitmask_end) | (tmp & bitmask_end); break; case 2: t[j+0] = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1); tmp = (word_cling_64_04(f0[j2]<<32)>>3) | (word_cling_64_04(f1[j2]<<32)>>2) | (word_cling_64_04(f2[j2]<<32)>>1); t[j+1] = (t[j+1] & ~bitmask_end) | (tmp & bitmask_end); break; case 1: tmp = (word_cling_64_04(f0[j2]<<48)>>3) | (word_cling_64_04(f1[j2]<<48)>>2) | (word_cling_64_04(f2[j2]<<48)>>1); t[j+0] = (t[j+0] & ~bitmask_end) | (tmp & bitmask_end); break; default: m4ri_die("impossible"); } } } return T; } m4rie-20200125/m4rie/conversion_slice8.c0000644000175000017500000007155713206144356014553 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010-2013 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "conversion.h" static inline word word_slice_64_08(word a) { a = (a & xff00ff00) | (a & xff00ff00>> 8)<< 7; a = (a & xffff0000) | (a & xffff0000>>16)<<14; a = (a & xffffffff) | (a & xffffffff>>32)<<28; return a; } mzd_slice_t *_mzed_slice8(mzd_slice_t *T, const mzed_t *F) { assert(T && (4 < T->depth && T->depth <= 8)); size_t j, j2 = 0; register word r0,r1,r2,r3,r4,r5,r6,r7 = 0; const word bitmask_end = T->x[0]->high_bitmask; if (mzed_is_zero(F)) return T; switch(T->depth) { case 8: { for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; word *t2 = T->x[2]->rows[i]; word *t3 = T->x[3]->rows[i]; word *t4 = T->x[4]->rows[i]; word *t5 = T->x[5]->rows[i]; word *t6 = T->x[6]->rows[i]; word *t7 = T->x[7]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+8 < F->x->width; j+=8,j2++) { t0[j2] |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56 | word_slice_64_08(f[j+1]<<7 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<7 & x80808080)>>40 | word_slice_64_08(f[j+3]<<7 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<7 & x80808080)>>24 | word_slice_64_08(f[j+5]<<7 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<7 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; t1[j2] |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56 | word_slice_64_08(f[j+1]<<6 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<6 & x80808080)>>40 | word_slice_64_08(f[j+3]<<6 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<6 & x80808080)>>24 | word_slice_64_08(f[j+5]<<6 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<6 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; t2[j2] |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56 | word_slice_64_08(f[j+1]<<5 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<5 & x80808080)>>40 | word_slice_64_08(f[j+3]<<5 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<5 & x80808080)>>24 | word_slice_64_08(f[j+5]<<5 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<5 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; t3[j2] |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56 | word_slice_64_08(f[j+1]<<4 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<4 & x80808080)>>40 | word_slice_64_08(f[j+3]<<4 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<4 & x80808080)>>24 | word_slice_64_08(f[j+5]<<4 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<4 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; t4[j2] |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56 | word_slice_64_08(f[j+1]<<3 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<3 & x80808080)>>40 | word_slice_64_08(f[j+3]<<3 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<3 & x80808080)>>24 | word_slice_64_08(f[j+5]<<3 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<3 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; t5[j2] |= word_slice_64_08(f[j+0]<<2 & x80808080)>>56 | word_slice_64_08(f[j+1]<<2 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<2 & x80808080)>>40 | word_slice_64_08(f[j+3]<<2 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<2 & x80808080)>>24 | word_slice_64_08(f[j+5]<<2 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<2 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<2 & x80808080)>> 0; t6[j2] |= word_slice_64_08(f[j+0]<<1 & x80808080)>>56 | word_slice_64_08(f[j+1]<<1 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<1 & x80808080)>>40 | word_slice_64_08(f[j+3]<<1 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<1 & x80808080)>>24 | word_slice_64_08(f[j+5]<<1 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<1 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<1 & x80808080)>> 0; t7[j2] |= word_slice_64_08(f[j+0]<<0 & x80808080)>>56 | word_slice_64_08(f[j+1]<<0 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<0 & x80808080)>>40 | word_slice_64_08(f[j+3]<<0 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<0 & x80808080)>>24 | word_slice_64_08(f[j+5]<<0 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<0 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<0 & x80808080)>> 0; } r0 = r1 = r2 = r3 = r4 = r5 = r6 = r7 = 0; switch(F->x->width - j) { case 8: r0 |= word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; r1 |= word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; r2 |= word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; r3 |= word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; r4 |= word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; r5 |= word_slice_64_08(f[j+7]<<2 & x80808080)>> 0; r6 |= word_slice_64_08(f[j+7]<<1 & x80808080)>> 0; r7 |= word_slice_64_08(f[j+7]<<0 & x80808080)>> 0; case 7: r0 |= word_slice_64_08(f[j+6]<<7 & x80808080)>> 8; r1 |= word_slice_64_08(f[j+6]<<6 & x80808080)>> 8; r2 |= word_slice_64_08(f[j+6]<<5 & x80808080)>> 8; r3 |= word_slice_64_08(f[j+6]<<4 & x80808080)>> 8; r4 |= word_slice_64_08(f[j+6]<<3 & x80808080)>> 8; r5 |= word_slice_64_08(f[j+6]<<2 & x80808080)>> 8; r6 |= word_slice_64_08(f[j+6]<<1 & x80808080)>> 8; r7 |= word_slice_64_08(f[j+6]<<0 & x80808080)>> 8; case 6: r0 |= word_slice_64_08(f[j+5]<<7 & x80808080)>>16; r1 |= word_slice_64_08(f[j+5]<<6 & x80808080)>>16; r2 |= word_slice_64_08(f[j+5]<<5 & x80808080)>>16; r3 |= word_slice_64_08(f[j+5]<<4 & x80808080)>>16; r4 |= word_slice_64_08(f[j+5]<<3 & x80808080)>>16; r5 |= word_slice_64_08(f[j+5]<<2 & x80808080)>>16; r6 |= word_slice_64_08(f[j+5]<<1 & x80808080)>>16; r7 |= word_slice_64_08(f[j+5]<<0 & x80808080)>>16; case 5: r0 |= word_slice_64_08(f[j+4]<<7 & x80808080)>>24; r1 |= word_slice_64_08(f[j+4]<<6 & x80808080)>>24; r2 |= word_slice_64_08(f[j+4]<<5 & x80808080)>>24; r3 |= word_slice_64_08(f[j+4]<<4 & x80808080)>>24; r4 |= word_slice_64_08(f[j+4]<<3 & x80808080)>>24; r5 |= word_slice_64_08(f[j+4]<<2 & x80808080)>>24; r6 |= word_slice_64_08(f[j+4]<<1 & x80808080)>>24; r7 |= word_slice_64_08(f[j+4]<<0 & x80808080)>>24; case 4: r0 |= word_slice_64_08(f[j+3]<<7 & x80808080)>>32; r1 |= word_slice_64_08(f[j+3]<<6 & x80808080)>>32; r2 |= word_slice_64_08(f[j+3]<<5 & x80808080)>>32; r3 |= word_slice_64_08(f[j+3]<<4 & x80808080)>>32; r4 |= word_slice_64_08(f[j+3]<<3 & x80808080)>>32; r5 |= word_slice_64_08(f[j+3]<<2 & x80808080)>>32; r6 |= word_slice_64_08(f[j+3]<<1 & x80808080)>>32; r7 |= word_slice_64_08(f[j+3]<<0 & x80808080)>>32; case 3: r0 |= word_slice_64_08(f[j+2]<<7 & x80808080)>>40; r1 |= word_slice_64_08(f[j+2]<<6 & x80808080)>>40; r2 |= word_slice_64_08(f[j+2]<<5 & x80808080)>>40; r3 |= word_slice_64_08(f[j+2]<<4 & x80808080)>>40; r4 |= word_slice_64_08(f[j+2]<<3 & x80808080)>>40; r5 |= word_slice_64_08(f[j+2]<<2 & x80808080)>>40; r6 |= word_slice_64_08(f[j+2]<<1 & x80808080)>>40; r7 |= word_slice_64_08(f[j+2]<<0 & x80808080)>>40; case 2: r0 |= word_slice_64_08(f[j+1]<<7 & x80808080)>>48; r1 |= word_slice_64_08(f[j+1]<<6 & x80808080)>>48; r2 |= word_slice_64_08(f[j+1]<<5 & x80808080)>>48; r3 |= word_slice_64_08(f[j+1]<<4 & x80808080)>>48; r4 |= word_slice_64_08(f[j+1]<<3 & x80808080)>>48; r5 |= word_slice_64_08(f[j+1]<<2 & x80808080)>>48; r6 |= word_slice_64_08(f[j+1]<<1 & x80808080)>>48; r7 |= word_slice_64_08(f[j+1]<<0 & x80808080)>>48; case 1: r0 |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56; r1 |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56; r2 |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56; r3 |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56; r4 |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56; r5 |= word_slice_64_08(f[j+0]<<2 & x80808080)>>56; r6 |= word_slice_64_08(f[j+0]<<1 & x80808080)>>56; r7 |= word_slice_64_08(f[j+0]<<0 & x80808080)>>56; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; t4[j2] |= r4 & bitmask_end; t5[j2] |= r5 & bitmask_end; t6[j2] |= r6 & bitmask_end; t7[j2] |= r7 & bitmask_end; } } break; case 7: { for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; word *t2 = T->x[2]->rows[i]; word *t3 = T->x[3]->rows[i]; word *t4 = T->x[4]->rows[i]; word *t5 = T->x[5]->rows[i]; word *t6 = T->x[6]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+8 < F->x->width; j+=8,j2++) { t0[j2] |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56 | word_slice_64_08(f[j+1]<<7 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<7 & x80808080)>>40 | word_slice_64_08(f[j+3]<<7 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<7 & x80808080)>>24 | word_slice_64_08(f[j+5]<<7 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<7 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; t1[j2] |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56 | word_slice_64_08(f[j+1]<<6 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<6 & x80808080)>>40 | word_slice_64_08(f[j+3]<<6 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<6 & x80808080)>>24 | word_slice_64_08(f[j+5]<<6 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<6 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; t2[j2] |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56 | word_slice_64_08(f[j+1]<<5 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<5 & x80808080)>>40 | word_slice_64_08(f[j+3]<<5 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<5 & x80808080)>>24 | word_slice_64_08(f[j+5]<<5 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<5 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; t3[j2] |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56 | word_slice_64_08(f[j+1]<<4 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<4 & x80808080)>>40 | word_slice_64_08(f[j+3]<<4 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<4 & x80808080)>>24 | word_slice_64_08(f[j+5]<<4 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<4 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; t4[j2] |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56 | word_slice_64_08(f[j+1]<<3 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<3 & x80808080)>>40 | word_slice_64_08(f[j+3]<<3 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<3 & x80808080)>>24 | word_slice_64_08(f[j+5]<<3 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<3 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; t5[j2] |= word_slice_64_08(f[j+0]<<2 & x80808080)>>56 | word_slice_64_08(f[j+1]<<2 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<2 & x80808080)>>40 | word_slice_64_08(f[j+3]<<2 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<2 & x80808080)>>24 | word_slice_64_08(f[j+5]<<2 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<2 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<2 & x80808080)>> 0; t6[j2] |= word_slice_64_08(f[j+0]<<1 & x80808080)>>56 | word_slice_64_08(f[j+1]<<1 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<1 & x80808080)>>40 | word_slice_64_08(f[j+3]<<1 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<1 & x80808080)>>24 | word_slice_64_08(f[j+5]<<1 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<1 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<1 & x80808080)>> 0; } r0 = r1 = r2 = r3 = r4 = r5 = r6 = 0; switch(F->x->width - j) { case 8: r0 |= word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; r1 |= word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; r2 |= word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; r3 |= word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; r4 |= word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; r5 |= word_slice_64_08(f[j+7]<<2 & x80808080)>> 0; r6 |= word_slice_64_08(f[j+7]<<1 & x80808080)>> 0; case 7: r0 |= word_slice_64_08(f[j+6]<<7 & x80808080)>> 8; r1 |= word_slice_64_08(f[j+6]<<6 & x80808080)>> 8; r2 |= word_slice_64_08(f[j+6]<<5 & x80808080)>> 8; r3 |= word_slice_64_08(f[j+6]<<4 & x80808080)>> 8; r4 |= word_slice_64_08(f[j+6]<<3 & x80808080)>> 8; r5 |= word_slice_64_08(f[j+6]<<2 & x80808080)>> 8; r6 |= word_slice_64_08(f[j+6]<<1 & x80808080)>> 8; case 6: r0 |= word_slice_64_08(f[j+5]<<7 & x80808080)>>16; r1 |= word_slice_64_08(f[j+5]<<6 & x80808080)>>16; r2 |= word_slice_64_08(f[j+5]<<5 & x80808080)>>16; r3 |= word_slice_64_08(f[j+5]<<4 & x80808080)>>16; r4 |= word_slice_64_08(f[j+5]<<3 & x80808080)>>16; r5 |= word_slice_64_08(f[j+5]<<2 & x80808080)>>16; r6 |= word_slice_64_08(f[j+5]<<1 & x80808080)>>16; case 5: r0 |= word_slice_64_08(f[j+4]<<7 & x80808080)>>24; r1 |= word_slice_64_08(f[j+4]<<6 & x80808080)>>24; r2 |= word_slice_64_08(f[j+4]<<5 & x80808080)>>24; r3 |= word_slice_64_08(f[j+4]<<4 & x80808080)>>24; r4 |= word_slice_64_08(f[j+4]<<3 & x80808080)>>24; r5 |= word_slice_64_08(f[j+4]<<2 & x80808080)>>24; r6 |= word_slice_64_08(f[j+4]<<1 & x80808080)>>24; case 4: r0 |= word_slice_64_08(f[j+3]<<7 & x80808080)>>32; r1 |= word_slice_64_08(f[j+3]<<6 & x80808080)>>32; r2 |= word_slice_64_08(f[j+3]<<5 & x80808080)>>32; r3 |= word_slice_64_08(f[j+3]<<4 & x80808080)>>32; r4 |= word_slice_64_08(f[j+3]<<3 & x80808080)>>32; r5 |= word_slice_64_08(f[j+3]<<2 & x80808080)>>32; r6 |= word_slice_64_08(f[j+3]<<1 & x80808080)>>32; case 3: r0 |= word_slice_64_08(f[j+2]<<7 & x80808080)>>40; r1 |= word_slice_64_08(f[j+2]<<6 & x80808080)>>40; r2 |= word_slice_64_08(f[j+2]<<5 & x80808080)>>40; r3 |= word_slice_64_08(f[j+2]<<4 & x80808080)>>40; r4 |= word_slice_64_08(f[j+2]<<3 & x80808080)>>40; r5 |= word_slice_64_08(f[j+2]<<2 & x80808080)>>40; r6 |= word_slice_64_08(f[j+2]<<1 & x80808080)>>40; case 2: r0 |= word_slice_64_08(f[j+1]<<7 & x80808080)>>48; r1 |= word_slice_64_08(f[j+1]<<6 & x80808080)>>48; r2 |= word_slice_64_08(f[j+1]<<5 & x80808080)>>48; r3 |= word_slice_64_08(f[j+1]<<4 & x80808080)>>48; r4 |= word_slice_64_08(f[j+1]<<3 & x80808080)>>48; r5 |= word_slice_64_08(f[j+1]<<2 & x80808080)>>48; r6 |= word_slice_64_08(f[j+1]<<1 & x80808080)>>48; case 1: r0 |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56; r1 |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56; r2 |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56; r3 |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56; r4 |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56; r5 |= word_slice_64_08(f[j+0]<<2 & x80808080)>>56; r6 |= word_slice_64_08(f[j+0]<<1 & x80808080)>>56; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; t4[j2] |= r4 & bitmask_end; t5[j2] |= r5 & bitmask_end; t6[j2] |= r6 & bitmask_end; } } break; case 6: { for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; word *t2 = T->x[2]->rows[i]; word *t3 = T->x[3]->rows[i]; word *t4 = T->x[4]->rows[i]; word *t5 = T->x[5]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+8 < F->x->width; j+=8,j2++) { t0[j2] |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56 | word_slice_64_08(f[j+1]<<7 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<7 & x80808080)>>40 | word_slice_64_08(f[j+3]<<7 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<7 & x80808080)>>24 | word_slice_64_08(f[j+5]<<7 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<7 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; t1[j2] |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56 | word_slice_64_08(f[j+1]<<6 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<6 & x80808080)>>40 | word_slice_64_08(f[j+3]<<6 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<6 & x80808080)>>24 | word_slice_64_08(f[j+5]<<6 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<6 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; t2[j2] |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56 | word_slice_64_08(f[j+1]<<5 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<5 & x80808080)>>40 | word_slice_64_08(f[j+3]<<5 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<5 & x80808080)>>24 | word_slice_64_08(f[j+5]<<5 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<5 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; t3[j2] |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56 | word_slice_64_08(f[j+1]<<4 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<4 & x80808080)>>40 | word_slice_64_08(f[j+3]<<4 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<4 & x80808080)>>24 | word_slice_64_08(f[j+5]<<4 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<4 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; t4[j2] |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56 | word_slice_64_08(f[j+1]<<3 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<3 & x80808080)>>40 | word_slice_64_08(f[j+3]<<3 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<3 & x80808080)>>24 | word_slice_64_08(f[j+5]<<3 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<3 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; t5[j2] |= word_slice_64_08(f[j+0]<<2 & x80808080)>>56 | word_slice_64_08(f[j+1]<<2 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<2 & x80808080)>>40 | word_slice_64_08(f[j+3]<<2 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<2 & x80808080)>>24 | word_slice_64_08(f[j+5]<<2 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<2 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<2 & x80808080)>> 0; } r0 = r1 = r2 = r3 = r4 = r5 = 0; switch(F->x->width - j) { case 8: r0 |= word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; r1 |= word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; r2 |= word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; r3 |= word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; r4 |= word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; r5 |= word_slice_64_08(f[j+7]<<2 & x80808080)>> 0; case 7: r0 |= word_slice_64_08(f[j+6]<<7 & x80808080)>> 8; r1 |= word_slice_64_08(f[j+6]<<6 & x80808080)>> 8; r2 |= word_slice_64_08(f[j+6]<<5 & x80808080)>> 8; r3 |= word_slice_64_08(f[j+6]<<4 & x80808080)>> 8; r4 |= word_slice_64_08(f[j+6]<<3 & x80808080)>> 8; r5 |= word_slice_64_08(f[j+6]<<2 & x80808080)>> 8; case 6: r0 |= word_slice_64_08(f[j+5]<<7 & x80808080)>>16; r1 |= word_slice_64_08(f[j+5]<<6 & x80808080)>>16; r2 |= word_slice_64_08(f[j+5]<<5 & x80808080)>>16; r3 |= word_slice_64_08(f[j+5]<<4 & x80808080)>>16; r4 |= word_slice_64_08(f[j+5]<<3 & x80808080)>>16; r5 |= word_slice_64_08(f[j+5]<<2 & x80808080)>>16; case 5: r0 |= word_slice_64_08(f[j+4]<<7 & x80808080)>>24; r1 |= word_slice_64_08(f[j+4]<<6 & x80808080)>>24; r2 |= word_slice_64_08(f[j+4]<<5 & x80808080)>>24; r3 |= word_slice_64_08(f[j+4]<<4 & x80808080)>>24; r4 |= word_slice_64_08(f[j+4]<<3 & x80808080)>>24; r5 |= word_slice_64_08(f[j+4]<<2 & x80808080)>>24; case 4: r0 |= word_slice_64_08(f[j+3]<<7 & x80808080)>>32; r1 |= word_slice_64_08(f[j+3]<<6 & x80808080)>>32; r2 |= word_slice_64_08(f[j+3]<<5 & x80808080)>>32; r3 |= word_slice_64_08(f[j+3]<<4 & x80808080)>>32; r4 |= word_slice_64_08(f[j+3]<<3 & x80808080)>>32; r5 |= word_slice_64_08(f[j+3]<<2 & x80808080)>>32; case 3: r0 |= word_slice_64_08(f[j+2]<<7 & x80808080)>>40; r1 |= word_slice_64_08(f[j+2]<<6 & x80808080)>>40; r2 |= word_slice_64_08(f[j+2]<<5 & x80808080)>>40; r3 |= word_slice_64_08(f[j+2]<<4 & x80808080)>>40; r4 |= word_slice_64_08(f[j+2]<<3 & x80808080)>>40; r5 |= word_slice_64_08(f[j+2]<<2 & x80808080)>>40; case 2: r0 |= word_slice_64_08(f[j+1]<<7 & x80808080)>>48; r1 |= word_slice_64_08(f[j+1]<<6 & x80808080)>>48; r2 |= word_slice_64_08(f[j+1]<<5 & x80808080)>>48; r3 |= word_slice_64_08(f[j+1]<<4 & x80808080)>>48; r4 |= word_slice_64_08(f[j+1]<<3 & x80808080)>>48; r5 |= word_slice_64_08(f[j+1]<<2 & x80808080)>>48; case 1: r0 |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56; r1 |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56; r2 |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56; r3 |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56; r4 |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56; r5 |= word_slice_64_08(f[j+0]<<2 & x80808080)>>56; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; t4[j2] |= r4 & bitmask_end; t5[j2] |= r5 & bitmask_end; } } break; case 5: { for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; word *t2 = T->x[2]->rows[i]; word *t3 = T->x[3]->rows[i]; word *t4 = T->x[4]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+8 < F->x->width; j+=8,j2++) { t0[j2] |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56 | word_slice_64_08(f[j+1]<<7 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<7 & x80808080)>>40 | word_slice_64_08(f[j+3]<<7 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<7 & x80808080)>>24 | word_slice_64_08(f[j+5]<<7 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<7 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; t1[j2] |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56 | word_slice_64_08(f[j+1]<<6 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<6 & x80808080)>>40 | word_slice_64_08(f[j+3]<<6 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<6 & x80808080)>>24 | word_slice_64_08(f[j+5]<<6 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<6 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; t2[j2] |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56 | word_slice_64_08(f[j+1]<<5 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<5 & x80808080)>>40 | word_slice_64_08(f[j+3]<<5 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<5 & x80808080)>>24 | word_slice_64_08(f[j+5]<<5 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<5 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; t3[j2] |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56 | word_slice_64_08(f[j+1]<<4 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<4 & x80808080)>>40 | word_slice_64_08(f[j+3]<<4 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<4 & x80808080)>>24 | word_slice_64_08(f[j+5]<<4 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<4 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; t4[j2] |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56 | word_slice_64_08(f[j+1]<<3 & x80808080)>>48 \ | word_slice_64_08(f[j+2]<<3 & x80808080)>>40 | word_slice_64_08(f[j+3]<<3 & x80808080)>>32 \ | word_slice_64_08(f[j+4]<<3 & x80808080)>>24 | word_slice_64_08(f[j+5]<<3 & x80808080)>>16 \ | word_slice_64_08(f[j+6]<<3 & x80808080)>> 8 | word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; } r0 = r1 = r2 = r3 = r4 = 0; switch(F->x->width - j) { case 8: r0 |= word_slice_64_08(f[j+7]<<7 & x80808080)>> 0; r1 |= word_slice_64_08(f[j+7]<<6 & x80808080)>> 0; r2 |= word_slice_64_08(f[j+7]<<5 & x80808080)>> 0; r3 |= word_slice_64_08(f[j+7]<<4 & x80808080)>> 0; r4 |= word_slice_64_08(f[j+7]<<3 & x80808080)>> 0; case 7: r0 |= word_slice_64_08(f[j+6]<<7 & x80808080)>> 8; r1 |= word_slice_64_08(f[j+6]<<6 & x80808080)>> 8; r2 |= word_slice_64_08(f[j+6]<<5 & x80808080)>> 8; r3 |= word_slice_64_08(f[j+6]<<4 & x80808080)>> 8; r4 |= word_slice_64_08(f[j+6]<<3 & x80808080)>> 8; case 6: r0 |= word_slice_64_08(f[j+5]<<7 & x80808080)>>16; r1 |= word_slice_64_08(f[j+5]<<6 & x80808080)>>16; r2 |= word_slice_64_08(f[j+5]<<5 & x80808080)>>16; r3 |= word_slice_64_08(f[j+5]<<4 & x80808080)>>16; r4 |= word_slice_64_08(f[j+5]<<3 & x80808080)>>16; case 5: r0 |= word_slice_64_08(f[j+4]<<7 & x80808080)>>24; r1 |= word_slice_64_08(f[j+4]<<6 & x80808080)>>24; r2 |= word_slice_64_08(f[j+4]<<5 & x80808080)>>24; r3 |= word_slice_64_08(f[j+4]<<4 & x80808080)>>24; r4 |= word_slice_64_08(f[j+4]<<3 & x80808080)>>24; case 4: r0 |= word_slice_64_08(f[j+3]<<7 & x80808080)>>32; r1 |= word_slice_64_08(f[j+3]<<6 & x80808080)>>32; r2 |= word_slice_64_08(f[j+3]<<5 & x80808080)>>32; r3 |= word_slice_64_08(f[j+3]<<4 & x80808080)>>32; r4 |= word_slice_64_08(f[j+3]<<3 & x80808080)>>32; case 3: r0 |= word_slice_64_08(f[j+2]<<7 & x80808080)>>40; r1 |= word_slice_64_08(f[j+2]<<6 & x80808080)>>40; r2 |= word_slice_64_08(f[j+2]<<5 & x80808080)>>40; r3 |= word_slice_64_08(f[j+2]<<4 & x80808080)>>40; r4 |= word_slice_64_08(f[j+2]<<3 & x80808080)>>40; case 2: r0 |= word_slice_64_08(f[j+1]<<7 & x80808080)>>48; r1 |= word_slice_64_08(f[j+1]<<6 & x80808080)>>48; r2 |= word_slice_64_08(f[j+1]<<5 & x80808080)>>48; r3 |= word_slice_64_08(f[j+1]<<4 & x80808080)>>48; r4 |= word_slice_64_08(f[j+1]<<3 & x80808080)>>48; case 1: r0 |= word_slice_64_08(f[j+0]<<7 & x80808080)>>56; r1 |= word_slice_64_08(f[j+0]<<6 & x80808080)>>56; r2 |= word_slice_64_08(f[j+0]<<5 & x80808080)>>56; r3 |= word_slice_64_08(f[j+0]<<4 & x80808080)>>56; r4 |= word_slice_64_08(f[j+0]<<3 & x80808080)>>56; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; t4[j2] |= r4 & bitmask_end; } } break; default: m4ri_die("impossible\n"); } return T; } m4rie-20200125/m4rie/conversion_slice16.c0000644000175000017500000007255513206144356014631 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010-2013 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "conversion.h" static inline word word_slice_64_16(word a) { a = (a & xffff0000) | (a & xffff0000>>16)<<15; a = (a & xffffffff) | (a & xffffffff>>32)<<30; return a; } /* we define these things to keep code compact below. */ #define word_slice_64_16_combine_bulk(T, Ti, F, Fi, shift) \ T[Ti] |= word_slice_64_16(F[Fi+ 0]<>60 | word_slice_64_16(F[Fi+ 1]<>56 \ | word_slice_64_16(F[Fi+ 2]<>52 | word_slice_64_16(F[Fi+ 3]<>48 \ | word_slice_64_16(F[Fi+ 4]<>44 | word_slice_64_16(F[Fi+ 5]<>40 \ | word_slice_64_16(F[Fi+ 6]<>36 | word_slice_64_16(F[Fi+ 7]<>32 \ | word_slice_64_16(F[Fi+ 8]<>28 | word_slice_64_16(F[Fi+ 9]<>24 \ | word_slice_64_16(F[Fi+10]<>20 | word_slice_64_16(F[Fi+11]<>16 \ | word_slice_64_16(F[Fi+12]<>12 | word_slice_64_16(F[Fi+13]<> 8 \ | word_slice_64_16(F[Fi+14]<> 4 | word_slice_64_16(F[Fi+15]<> 0; #define word_slice_64_16_slice_rest(F, Fi, shift) \ r0 |= word_slice_64_16(F[Fi]<<15 & x80008000)>> shift; \ r1 |= word_slice_64_16(F[Fi]<<14 & x80008000)>> shift; \ r2 |= word_slice_64_16(F[Fi]<<13 & x80008000)>> shift; \ r3 |= word_slice_64_16(F[Fi]<<12 & x80008000)>> shift; \ r4 |= word_slice_64_16(F[Fi]<<11 & x80008000)>> shift; \ r5 |= word_slice_64_16(F[Fi]<<10 & x80008000)>> shift; \ r6 |= word_slice_64_16(F[Fi]<< 9 & x80008000)>> shift; \ r7 |= word_slice_64_16(F[Fi]<< 8 & x80008000)>> shift; mzd_slice_t *_mzed_slice16(mzd_slice_t *T, const mzed_t *F) { assert(T && (8 < T->depth && T->depth <= 16)); size_t j, j2 = 0; register word r0,r1,r2,r3,r4,r5,r6,r7 = 0; const word bitmask_end = T->x[0]->high_bitmask; if (mzed_is_zero(F)) return T; /* we do multiple runs over T to make the code more compact, we start by doing the first eight bits */ for(size_t i=0; inrows; i++) { word *t0 = T->x[0]->rows[i]; word *t1 = T->x[1]->rows[i]; word *t2 = T->x[2]->rows[i]; word *t3 = T->x[3]->rows[i]; word *t4 = T->x[4]->rows[i]; word *t5 = T->x[5]->rows[i]; word *t6 = T->x[6]->rows[i]; word *t7 = T->x[7]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 15); word_slice_64_16_combine_bulk(t1, j2, f, j, 14); word_slice_64_16_combine_bulk(t2, j2, f, j, 13); word_slice_64_16_combine_bulk(t3, j2, f, j, 12); word_slice_64_16_combine_bulk(t4, j2, f, j, 11); word_slice_64_16_combine_bulk(t5, j2, f, j, 10); word_slice_64_16_combine_bulk(t6, j2, f, j, 9); word_slice_64_16_combine_bulk(t7, j2, f, j, 8); } r0 = r1 = r2 = r3 = r4 = r5 = r6 = r7 = 0; switch(F->x->width - j) { case 16: word_slice_64_16_slice_rest(f, j+15, 0); case 15: word_slice_64_16_slice_rest(f, j+14, 4); case 14: word_slice_64_16_slice_rest(f, j+13, 8); case 13: word_slice_64_16_slice_rest(f, j+12, 12); case 12: word_slice_64_16_slice_rest(f, j+11, 16); case 11: word_slice_64_16_slice_rest(f, j+10, 20); case 10: word_slice_64_16_slice_rest(f, j+ 9, 24); case 9: word_slice_64_16_slice_rest(f, j+ 8, 28); case 8: word_slice_64_16_slice_rest(f, j+ 7, 32); case 7: word_slice_64_16_slice_rest(f, j+ 6, 36); case 6: word_slice_64_16_slice_rest(f, j+ 5, 40); case 5: word_slice_64_16_slice_rest(f, j+ 4, 44); case 4: word_slice_64_16_slice_rest(f, j+ 3, 48); case 3: word_slice_64_16_slice_rest(f, j+ 2, 52); case 2: word_slice_64_16_slice_rest(f, j+ 1, 56); case 1: word_slice_64_16_slice_rest(f, j+ 0, 60); break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; t4[j2] |= r4 & bitmask_end; t5[j2] |= r5 & bitmask_end; t6[j2] |= r6 & bitmask_end; t7[j2] |= r7 & bitmask_end; } if(T->depth >= 12) { for(size_t i=0; inrows; i++) { word *t0 = T->x[ 8]->rows[i]; word *t1 = T->x[ 9]->rows[i]; word *t2 = T->x[10]->rows[i]; word *t3 = T->x[11]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 7); word_slice_64_16_combine_bulk(t1, j2, f, j, 6); word_slice_64_16_combine_bulk(t2, j2, f, j, 5); word_slice_64_16_combine_bulk(t3, j2, f, j, 4); } r0 = r1 = r2 = r3 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 7 & x80008000)>> 0; r1 |= word_slice_64_16(f[j+15]<< 6 & x80008000)>> 0; r2 |= word_slice_64_16(f[j+15]<< 5 & x80008000)>> 0; r3 |= word_slice_64_16(f[j+15]<< 4 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 7 & x80008000)>> 4; r1 |= word_slice_64_16(f[j+14]<< 6 & x80008000)>> 4; r2 |= word_slice_64_16(f[j+14]<< 5 & x80008000)>> 4; r3 |= word_slice_64_16(f[j+14]<< 4 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 7 & x80008000)>> 8; r1 |= word_slice_64_16(f[j+13]<< 6 & x80008000)>> 8; r2 |= word_slice_64_16(f[j+13]<< 5 & x80008000)>> 8; r3 |= word_slice_64_16(f[j+13]<< 4 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 7 & x80008000)>> 12; r1 |= word_slice_64_16(f[j+12]<< 6 & x80008000)>> 12; r2 |= word_slice_64_16(f[j+12]<< 5 & x80008000)>> 12; r3 |= word_slice_64_16(f[j+12]<< 4 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 7 & x80008000)>> 16; r1 |= word_slice_64_16(f[j+11]<< 6 & x80008000)>> 16; r2 |= word_slice_64_16(f[j+11]<< 5 & x80008000)>> 16; r3 |= word_slice_64_16(f[j+11]<< 4 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 7 & x80008000)>> 20; r1 |= word_slice_64_16(f[j+10]<< 6 & x80008000)>> 20; r2 |= word_slice_64_16(f[j+10]<< 5 & x80008000)>> 20; r3 |= word_slice_64_16(f[j+10]<< 4 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 7 & x80008000)>> 24; r1 |= word_slice_64_16(f[j+ 9]<< 6 & x80008000)>> 24; r2 |= word_slice_64_16(f[j+ 9]<< 5 & x80008000)>> 24; r3 |= word_slice_64_16(f[j+ 9]<< 4 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 7 & x80008000)>> 28; r1 |= word_slice_64_16(f[j+ 8]<< 6 & x80008000)>> 28; r2 |= word_slice_64_16(f[j+ 8]<< 5 & x80008000)>> 28; r3 |= word_slice_64_16(f[j+ 8]<< 4 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 7 & x80008000)>> 32; r1 |= word_slice_64_16(f[j+ 7]<< 6 & x80008000)>> 32; r2 |= word_slice_64_16(f[j+ 7]<< 5 & x80008000)>> 32; r3 |= word_slice_64_16(f[j+ 7]<< 4 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 7 & x80008000)>> 36; r1 |= word_slice_64_16(f[j+ 6]<< 6 & x80008000)>> 36; r2 |= word_slice_64_16(f[j+ 6]<< 5 & x80008000)>> 36; r3 |= word_slice_64_16(f[j+ 6]<< 4 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 7 & x80008000)>> 40; r1 |= word_slice_64_16(f[j+ 5]<< 6 & x80008000)>> 40; r2 |= word_slice_64_16(f[j+ 5]<< 5 & x80008000)>> 40; r3 |= word_slice_64_16(f[j+ 5]<< 4 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 7 & x80008000)>> 44; r1 |= word_slice_64_16(f[j+ 4]<< 6 & x80008000)>> 44; r2 |= word_slice_64_16(f[j+ 4]<< 5 & x80008000)>> 44; r3 |= word_slice_64_16(f[j+ 4]<< 4 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 7 & x80008000)>> 48; r1 |= word_slice_64_16(f[j+ 3]<< 6 & x80008000)>> 48; r2 |= word_slice_64_16(f[j+ 3]<< 5 & x80008000)>> 48; r3 |= word_slice_64_16(f[j+ 3]<< 4 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 7 & x80008000)>> 52; r1 |= word_slice_64_16(f[j+ 2]<< 6 & x80008000)>> 52; r2 |= word_slice_64_16(f[j+ 2]<< 5 & x80008000)>> 52; r3 |= word_slice_64_16(f[j+ 2]<< 4 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 7 & x80008000)>> 56; r1 |= word_slice_64_16(f[j+ 1]<< 6 & x80008000)>> 56; r2 |= word_slice_64_16(f[j+ 1]<< 5 & x80008000)>> 56; r3 |= word_slice_64_16(f[j+ 1]<< 4 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 7 & x80008000)>> 60; r1 |= word_slice_64_16(f[j+ 0]<< 6 & x80008000)>> 60; r2 |= word_slice_64_16(f[j+ 0]<< 5 & x80008000)>> 60; r3 |= word_slice_64_16(f[j+ 0]<< 4 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; } switch(T->depth) { case 16: { for(size_t i=0; inrows; i++) { word *t0 = T->x[12]->rows[i]; word *t1 = T->x[13]->rows[i]; word *t2 = T->x[14]->rows[i]; word *t3 = T->x[15]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 3); word_slice_64_16_combine_bulk(t1, j2, f, j, 2); word_slice_64_16_combine_bulk(t2, j2, f, j, 1); word_slice_64_16_combine_bulk(t3, j2, f, j, 0); } r0 = r1 = r2 = r3 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 3 & x80008000)>> 0; r1 |= word_slice_64_16(f[j+15]<< 2 & x80008000)>> 0; r2 |= word_slice_64_16(f[j+15]<< 1 & x80008000)>> 0; r3 |= word_slice_64_16(f[j+15]<< 0 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 3 & x80008000)>> 4; r1 |= word_slice_64_16(f[j+14]<< 2 & x80008000)>> 4; r2 |= word_slice_64_16(f[j+14]<< 1 & x80008000)>> 4; r3 |= word_slice_64_16(f[j+14]<< 0 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 3 & x80008000)>> 8; r1 |= word_slice_64_16(f[j+13]<< 2 & x80008000)>> 8; r2 |= word_slice_64_16(f[j+13]<< 1 & x80008000)>> 8; r3 |= word_slice_64_16(f[j+13]<< 0 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 3 & x80008000)>> 12; r1 |= word_slice_64_16(f[j+12]<< 2 & x80008000)>> 12; r2 |= word_slice_64_16(f[j+12]<< 1 & x80008000)>> 12; r3 |= word_slice_64_16(f[j+12]<< 0 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 3 & x80008000)>> 16; r1 |= word_slice_64_16(f[j+11]<< 2 & x80008000)>> 16; r2 |= word_slice_64_16(f[j+11]<< 1 & x80008000)>> 16; r3 |= word_slice_64_16(f[j+11]<< 0 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 3 & x80008000)>> 20; r1 |= word_slice_64_16(f[j+10]<< 2 & x80008000)>> 20; r2 |= word_slice_64_16(f[j+10]<< 1 & x80008000)>> 20; r3 |= word_slice_64_16(f[j+10]<< 0 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 3 & x80008000)>> 24; r1 |= word_slice_64_16(f[j+ 9]<< 2 & x80008000)>> 24; r2 |= word_slice_64_16(f[j+ 9]<< 1 & x80008000)>> 24; r3 |= word_slice_64_16(f[j+ 9]<< 0 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 3 & x80008000)>> 28; r1 |= word_slice_64_16(f[j+ 8]<< 2 & x80008000)>> 28; r2 |= word_slice_64_16(f[j+ 8]<< 1 & x80008000)>> 28; r3 |= word_slice_64_16(f[j+ 8]<< 0 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 3 & x80008000)>> 32; r1 |= word_slice_64_16(f[j+ 7]<< 2 & x80008000)>> 32; r2 |= word_slice_64_16(f[j+ 7]<< 1 & x80008000)>> 32; r3 |= word_slice_64_16(f[j+ 7]<< 0 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 3 & x80008000)>> 36; r1 |= word_slice_64_16(f[j+ 6]<< 2 & x80008000)>> 36; r2 |= word_slice_64_16(f[j+ 6]<< 1 & x80008000)>> 36; r3 |= word_slice_64_16(f[j+ 6]<< 0 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 3 & x80008000)>> 40; r1 |= word_slice_64_16(f[j+ 5]<< 2 & x80008000)>> 40; r2 |= word_slice_64_16(f[j+ 5]<< 1 & x80008000)>> 40; r3 |= word_slice_64_16(f[j+ 5]<< 0 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 3 & x80008000)>> 44; r1 |= word_slice_64_16(f[j+ 4]<< 2 & x80008000)>> 44; r2 |= word_slice_64_16(f[j+ 4]<< 1 & x80008000)>> 44; r3 |= word_slice_64_16(f[j+ 4]<< 0 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 3 & x80008000)>> 48; r1 |= word_slice_64_16(f[j+ 3]<< 2 & x80008000)>> 48; r2 |= word_slice_64_16(f[j+ 3]<< 1 & x80008000)>> 48; r3 |= word_slice_64_16(f[j+ 3]<< 0 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 3 & x80008000)>> 52; r1 |= word_slice_64_16(f[j+ 2]<< 2 & x80008000)>> 52; r2 |= word_slice_64_16(f[j+ 2]<< 1 & x80008000)>> 52; r3 |= word_slice_64_16(f[j+ 2]<< 0 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 3 & x80008000)>> 56; r1 |= word_slice_64_16(f[j+ 1]<< 2 & x80008000)>> 56; r2 |= word_slice_64_16(f[j+ 1]<< 1 & x80008000)>> 56; r3 |= word_slice_64_16(f[j+ 1]<< 0 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 3 & x80008000)>> 60; r1 |= word_slice_64_16(f[j+ 0]<< 2 & x80008000)>> 60; r2 |= word_slice_64_16(f[j+ 0]<< 1 & x80008000)>> 60; r3 |= word_slice_64_16(f[j+ 0]<< 0 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; t3[j2] |= r3 & bitmask_end; } } break; case 15: { for(size_t i=0; inrows; i++) { word *t0 = T->x[12]->rows[i]; word *t1 = T->x[13]->rows[i]; word *t2 = T->x[14]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 3); word_slice_64_16_combine_bulk(t1, j2, f, j, 2); word_slice_64_16_combine_bulk(t2, j2, f, j, 1); } r0 = r1 = r2 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 3 & x80008000)>> 0; r1 |= word_slice_64_16(f[j+15]<< 2 & x80008000)>> 0; r2 |= word_slice_64_16(f[j+15]<< 1 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 3 & x80008000)>> 4; r1 |= word_slice_64_16(f[j+14]<< 2 & x80008000)>> 4; r2 |= word_slice_64_16(f[j+14]<< 1 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 3 & x80008000)>> 8; r1 |= word_slice_64_16(f[j+13]<< 2 & x80008000)>> 8; r2 |= word_slice_64_16(f[j+13]<< 1 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 3 & x80008000)>> 12; r1 |= word_slice_64_16(f[j+12]<< 2 & x80008000)>> 12; r2 |= word_slice_64_16(f[j+12]<< 1 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 3 & x80008000)>> 16; r1 |= word_slice_64_16(f[j+11]<< 2 & x80008000)>> 16; r2 |= word_slice_64_16(f[j+11]<< 1 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 3 & x80008000)>> 20; r1 |= word_slice_64_16(f[j+10]<< 2 & x80008000)>> 20; r2 |= word_slice_64_16(f[j+10]<< 1 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 3 & x80008000)>> 24; r1 |= word_slice_64_16(f[j+ 9]<< 2 & x80008000)>> 24; r2 |= word_slice_64_16(f[j+ 9]<< 1 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 3 & x80008000)>> 28; r1 |= word_slice_64_16(f[j+ 8]<< 2 & x80008000)>> 28; r2 |= word_slice_64_16(f[j+ 8]<< 1 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 3 & x80008000)>> 32; r1 |= word_slice_64_16(f[j+ 7]<< 2 & x80008000)>> 32; r2 |= word_slice_64_16(f[j+ 7]<< 1 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 3 & x80008000)>> 36; r1 |= word_slice_64_16(f[j+ 6]<< 2 & x80008000)>> 36; r2 |= word_slice_64_16(f[j+ 6]<< 1 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 3 & x80008000)>> 40; r1 |= word_slice_64_16(f[j+ 5]<< 2 & x80008000)>> 40; r2 |= word_slice_64_16(f[j+ 5]<< 1 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 3 & x80008000)>> 44; r1 |= word_slice_64_16(f[j+ 4]<< 2 & x80008000)>> 44; r2 |= word_slice_64_16(f[j+ 4]<< 1 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 3 & x80008000)>> 48; r1 |= word_slice_64_16(f[j+ 3]<< 2 & x80008000)>> 48; r2 |= word_slice_64_16(f[j+ 3]<< 1 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 3 & x80008000)>> 52; r1 |= word_slice_64_16(f[j+ 2]<< 2 & x80008000)>> 52; r2 |= word_slice_64_16(f[j+ 2]<< 1 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 3 & x80008000)>> 56; r1 |= word_slice_64_16(f[j+ 1]<< 2 & x80008000)>> 56; r2 |= word_slice_64_16(f[j+ 1]<< 1 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 3 & x80008000)>> 60; r1 |= word_slice_64_16(f[j+ 0]<< 2 & x80008000)>> 60; r2 |= word_slice_64_16(f[j+ 0]<< 1 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; } } break; case 14: { for(size_t i=0; inrows; i++) { word *t0 = T->x[12]->rows[i]; word *t1 = T->x[13]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 3); word_slice_64_16_combine_bulk(t1, j2, f, j, 2); } r0 = r1 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 3 & x80008000)>> 0; r1 |= word_slice_64_16(f[j+15]<< 2 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 3 & x80008000)>> 4; r1 |= word_slice_64_16(f[j+14]<< 2 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 3 & x80008000)>> 8; r1 |= word_slice_64_16(f[j+13]<< 2 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 3 & x80008000)>> 12; r1 |= word_slice_64_16(f[j+12]<< 2 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 3 & x80008000)>> 16; r1 |= word_slice_64_16(f[j+11]<< 2 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 3 & x80008000)>> 20; r1 |= word_slice_64_16(f[j+10]<< 2 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 3 & x80008000)>> 24; r1 |= word_slice_64_16(f[j+ 9]<< 2 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 3 & x80008000)>> 28; r1 |= word_slice_64_16(f[j+ 8]<< 2 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 3 & x80008000)>> 32; r1 |= word_slice_64_16(f[j+ 7]<< 2 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 3 & x80008000)>> 36; r1 |= word_slice_64_16(f[j+ 6]<< 2 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 3 & x80008000)>> 40; r1 |= word_slice_64_16(f[j+ 5]<< 2 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 3 & x80008000)>> 44; r1 |= word_slice_64_16(f[j+ 4]<< 2 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 3 & x80008000)>> 48; r1 |= word_slice_64_16(f[j+ 3]<< 2 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 3 & x80008000)>> 52; r1 |= word_slice_64_16(f[j+ 2]<< 2 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 3 & x80008000)>> 56; r1 |= word_slice_64_16(f[j+ 1]<< 2 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 3 & x80008000)>> 60; r1 |= word_slice_64_16(f[j+ 0]<< 2 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; } } break; case 13: { for(size_t i=0; inrows; i++) { word *t0 = T->x[12]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 3); } r0 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 3 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 3 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 3 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 3 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 3 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 3 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 3 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 3 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 3 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 3 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 3 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 3 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 3 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 3 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 3 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 3 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; } } break; } } else { switch(T->depth) { case 11: { for(size_t i=0; inrows; i++) { word *t0 = T->x[ 8]->rows[i]; word *t1 = T->x[ 9]->rows[i]; word *t2 = T->x[10]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 7); word_slice_64_16_combine_bulk(t1, j2, f, j, 6); word_slice_64_16_combine_bulk(t2, j2, f, j, 5); } r0 = r1 = r2 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 7 & x80008000)>> 0; r1 |= word_slice_64_16(f[j+15]<< 6 & x80008000)>> 0; r2 |= word_slice_64_16(f[j+15]<< 5 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 7 & x80008000)>> 4; r1 |= word_slice_64_16(f[j+14]<< 6 & x80008000)>> 4; r2 |= word_slice_64_16(f[j+14]<< 5 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 7 & x80008000)>> 8; r1 |= word_slice_64_16(f[j+13]<< 6 & x80008000)>> 8; r2 |= word_slice_64_16(f[j+13]<< 5 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 7 & x80008000)>> 12; r1 |= word_slice_64_16(f[j+12]<< 6 & x80008000)>> 12; r2 |= word_slice_64_16(f[j+12]<< 5 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 7 & x80008000)>> 16; r1 |= word_slice_64_16(f[j+11]<< 6 & x80008000)>> 16; r2 |= word_slice_64_16(f[j+11]<< 5 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 7 & x80008000)>> 20; r1 |= word_slice_64_16(f[j+10]<< 6 & x80008000)>> 20; r2 |= word_slice_64_16(f[j+10]<< 5 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 7 & x80008000)>> 24; r1 |= word_slice_64_16(f[j+ 9]<< 6 & x80008000)>> 24; r2 |= word_slice_64_16(f[j+ 9]<< 5 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 7 & x80008000)>> 28; r1 |= word_slice_64_16(f[j+ 8]<< 6 & x80008000)>> 28; r2 |= word_slice_64_16(f[j+ 8]<< 5 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 7 & x80008000)>> 32; r1 |= word_slice_64_16(f[j+ 7]<< 6 & x80008000)>> 32; r2 |= word_slice_64_16(f[j+ 7]<< 5 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 7 & x80008000)>> 36; r1 |= word_slice_64_16(f[j+ 6]<< 6 & x80008000)>> 36; r2 |= word_slice_64_16(f[j+ 6]<< 5 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 7 & x80008000)>> 40; r1 |= word_slice_64_16(f[j+ 5]<< 6 & x80008000)>> 40; r2 |= word_slice_64_16(f[j+ 5]<< 5 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 7 & x80008000)>> 44; r1 |= word_slice_64_16(f[j+ 4]<< 6 & x80008000)>> 44; r2 |= word_slice_64_16(f[j+ 4]<< 5 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 7 & x80008000)>> 48; r1 |= word_slice_64_16(f[j+ 3]<< 6 & x80008000)>> 48; r2 |= word_slice_64_16(f[j+ 3]<< 5 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 7 & x80008000)>> 52; r1 |= word_slice_64_16(f[j+ 2]<< 6 & x80008000)>> 52; r2 |= word_slice_64_16(f[j+ 2]<< 5 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 7 & x80008000)>> 56; r1 |= word_slice_64_16(f[j+ 1]<< 6 & x80008000)>> 56; r2 |= word_slice_64_16(f[j+ 1]<< 5 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 7 & x80008000)>> 60; r1 |= word_slice_64_16(f[j+ 0]<< 6 & x80008000)>> 60; r2 |= word_slice_64_16(f[j+ 0]<< 5 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; t2[j2] |= r2 & bitmask_end; } } break; case 10: { for(size_t i=0; inrows; i++) { word *t0 = T->x[ 8]->rows[i]; word *t1 = T->x[ 9]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 7); word_slice_64_16_combine_bulk(t1, j2, f, j, 6); } r0 = r1 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 7 & x80008000)>> 0; r1 |= word_slice_64_16(f[j+15]<< 6 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 7 & x80008000)>> 4; r1 |= word_slice_64_16(f[j+14]<< 6 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 7 & x80008000)>> 8; r1 |= word_slice_64_16(f[j+13]<< 6 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 7 & x80008000)>> 12; r1 |= word_slice_64_16(f[j+12]<< 6 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 7 & x80008000)>> 16; r1 |= word_slice_64_16(f[j+11]<< 6 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 7 & x80008000)>> 20; r1 |= word_slice_64_16(f[j+10]<< 6 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 7 & x80008000)>> 24; r1 |= word_slice_64_16(f[j+ 9]<< 6 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 7 & x80008000)>> 28; r1 |= word_slice_64_16(f[j+ 8]<< 6 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 7 & x80008000)>> 32; r1 |= word_slice_64_16(f[j+ 7]<< 6 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 7 & x80008000)>> 36; r1 |= word_slice_64_16(f[j+ 6]<< 6 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 7 & x80008000)>> 40; r1 |= word_slice_64_16(f[j+ 5]<< 6 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 7 & x80008000)>> 44; r1 |= word_slice_64_16(f[j+ 4]<< 6 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 7 & x80008000)>> 48; r1 |= word_slice_64_16(f[j+ 3]<< 6 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 7 & x80008000)>> 52; r1 |= word_slice_64_16(f[j+ 2]<< 6 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 7 & x80008000)>> 56; r1 |= word_slice_64_16(f[j+ 1]<< 6 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 7 & x80008000)>> 60; r1 |= word_slice_64_16(f[j+ 0]<< 6 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; t1[j2] |= r1 & bitmask_end; } } break; case 9: { for(size_t i=0; inrows; i++) { word *t0 = T->x[ 8]->rows[i]; const word const *f = F->x->rows[i]; /* bulk of work */ for(j=0, j2=0; j+16 < F->x->width; j+=16,j2++) { word_slice_64_16_combine_bulk(t0, j2, f, j, 7); } r0 = 0; switch(F->x->width - j) { case 16: r0 |= word_slice_64_16(f[j+15]<< 7 & x80008000)>> 0; case 15: r0 |= word_slice_64_16(f[j+14]<< 7 & x80008000)>> 4; case 14: r0 |= word_slice_64_16(f[j+13]<< 7 & x80008000)>> 8; case 13: r0 |= word_slice_64_16(f[j+12]<< 7 & x80008000)>> 12; case 12: r0 |= word_slice_64_16(f[j+11]<< 7 & x80008000)>> 16; case 11: r0 |= word_slice_64_16(f[j+10]<< 7 & x80008000)>> 20; case 10: r0 |= word_slice_64_16(f[j+ 9]<< 7 & x80008000)>> 24; case 9: r0 |= word_slice_64_16(f[j+ 8]<< 7 & x80008000)>> 28; case 8: r0 |= word_slice_64_16(f[j+ 7]<< 7 & x80008000)>> 32; case 7: r0 |= word_slice_64_16(f[j+ 6]<< 7 & x80008000)>> 36; case 6: r0 |= word_slice_64_16(f[j+ 5]<< 7 & x80008000)>> 40; case 5: r0 |= word_slice_64_16(f[j+ 4]<< 7 & x80008000)>> 44; case 4: r0 |= word_slice_64_16(f[j+ 3]<< 7 & x80008000)>> 48; case 3: r0 |= word_slice_64_16(f[j+ 2]<< 7 & x80008000)>> 52; case 2: r0 |= word_slice_64_16(f[j+ 1]<< 7 & x80008000)>> 56; case 1: r0 |= word_slice_64_16(f[j+ 0]<< 7 & x80008000)>> 60; break; default: m4ri_die("impossible"); } t0[j2] |= r0 & bitmask_end; } } break; default: m4ri_die("impossible"); } } return T; } m4rie-20200125/m4rie/conversion_cling8.c0000644000175000017500000005117713206144356014544 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010-2013 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "conversion.h" static inline word word_cling_64_08(word a) { a = (a & xf0f0f0f0 & x__left08) | (a & xf0f0f0f0>> 4 & x__left08)>>28; a = (a & xcccccccc) | (a & xcccccccc>> 2)>>14; a = (a & xaaaaaaaa) | (a & xaaaaaaaa>> 1)>> 7; return a; } mzed_t *_mzed_cling8(mzed_t *T, const mzd_slice_t *F) { size_t j,j2 = 0; const word bitmask_end = T->x->high_bitmask; if (mzd_slice_is_zero(F)) return T; switch (F->finite_field->degree) { case 8: { for(rci_t i=0; inrows; i++) { const word *f0 = F->x[0]->rows[i]; const word *f1 = F->x[1]->rows[i]; const word *f2 = F->x[2]->rows[i]; const word *f3 = F->x[3]->rows[i]; const word *f4 = F->x[4]->rows[i]; const word *f5 = F->x[5]->rows[i]; const word *f6 = F->x[6]->rows[i]; const word *f7 = F->x[7]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+8 < T->x->width; j+=8, j2++) { t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) \ | (word_cling_64_08(f4[j2]<<56)>>3) | (word_cling_64_08(f5[j2]<<56)>>2) | (word_cling_64_08(f6[j2]<<56)>>1) | (word_cling_64_08(f7[j2]<<56)>>0); t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) \ | (word_cling_64_08(f4[j2]<<48)>>3) | (word_cling_64_08(f5[j2]<<48)>>2) | (word_cling_64_08(f6[j2]<<48)>>1) | (word_cling_64_08(f7[j2]<<48)>>0); t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) \ | (word_cling_64_08(f4[j2]<<40)>>3) | (word_cling_64_08(f5[j2]<<40)>>2) | (word_cling_64_08(f6[j2]<<40)>>1) | (word_cling_64_08(f7[j2]<<40)>>0); t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) \ | (word_cling_64_08(f4[j2]<<32)>>3) | (word_cling_64_08(f5[j2]<<32)>>2) | (word_cling_64_08(f6[j2]<<32)>>1) | (word_cling_64_08(f7[j2]<<32)>>0); t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) \ | (word_cling_64_08(f4[j2]<<24)>>3) | (word_cling_64_08(f5[j2]<<24)>>2) | (word_cling_64_08(f6[j2]<<24)>>1) | (word_cling_64_08(f7[j2]<<24)>>0); t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) \ | (word_cling_64_08(f4[j2]<<16)>>3) | (word_cling_64_08(f5[j2]<<16)>>2) | (word_cling_64_08(f6[j2]<<16)>>1) | (word_cling_64_08(f7[j2]<<16)>>0); t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) \ | (word_cling_64_08(f4[j2]<< 8)>>3) | (word_cling_64_08(f5[j2]<< 8)>>2) | (word_cling_64_08(f6[j2]<< 8)>>1) | (word_cling_64_08(f7[j2]<< 8)>>0); t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) \ | (word_cling_64_08(f4[j2]<< 0)>>3) | (word_cling_64_08(f5[j2]<< 0)>>2) | (word_cling_64_08(f6[j2]<< 0)>>1) | (word_cling_64_08(f7[j2]<< 0)>>0); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 8: t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) \ | (word_cling_64_08(f4[j2]<< 0)>>3) | (word_cling_64_08(f5[j2]<< 0)>>2) | (word_cling_64_08(f6[j2]<< 0)>>1) | (word_cling_64_08(f7[j2]<< 0)>>0); case 7: t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) \ | (word_cling_64_08(f4[j2]<< 8)>>3) | (word_cling_64_08(f5[j2]<< 8)>>2) | (word_cling_64_08(f6[j2]<< 8)>>1) | (word_cling_64_08(f7[j2]<< 8)>>0); case 6: t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) \ | (word_cling_64_08(f4[j2]<<16)>>3) | (word_cling_64_08(f5[j2]<<16)>>2) | (word_cling_64_08(f6[j2]<<16)>>1) | (word_cling_64_08(f7[j2]<<16)>>0); case 5: t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) \ | (word_cling_64_08(f4[j2]<<24)>>3) | (word_cling_64_08(f5[j2]<<24)>>2) | (word_cling_64_08(f6[j2]<<24)>>1) | (word_cling_64_08(f7[j2]<<24)>>0); case 4: t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) \ | (word_cling_64_08(f4[j2]<<32)>>3) | (word_cling_64_08(f5[j2]<<32)>>2) | (word_cling_64_08(f6[j2]<<32)>>1) | (word_cling_64_08(f7[j2]<<32)>>0); case 3: t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) \ | (word_cling_64_08(f4[j2]<<40)>>3) | (word_cling_64_08(f5[j2]<<40)>>2) | (word_cling_64_08(f6[j2]<<40)>>1) | (word_cling_64_08(f7[j2]<<40)>>0); case 2: t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) \ | (word_cling_64_08(f4[j2]<<48)>>3) | (word_cling_64_08(f5[j2]<<48)>>2) | (word_cling_64_08(f6[j2]<<48)>>1) | (word_cling_64_08(f7[j2]<<48)>>0); case 1: t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) \ | (word_cling_64_08(f4[j2]<<56)>>3) | (word_cling_64_08(f5[j2]<<56)>>2) | (word_cling_64_08(f6[j2]<<56)>>1) | (word_cling_64_08(f7[j2]<<56)>>0); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } // for loop } break; case 7: { for(rci_t i=0; inrows; i++) { const word *f0 = F->x[0]->rows[i]; const word *f1 = F->x[1]->rows[i]; const word *f2 = F->x[2]->rows[i]; const word *f3 = F->x[3]->rows[i]; const word *f4 = F->x[4]->rows[i]; const word *f5 = F->x[5]->rows[i]; const word *f6 = F->x[6]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+8 < T->x->width; j+=8, j2++) { t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) \ | (word_cling_64_08(f4[j2]<<56)>>3) | (word_cling_64_08(f5[j2]<<56)>>2) | (word_cling_64_08(f6[j2]<<56)>>1); t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) \ | (word_cling_64_08(f4[j2]<<48)>>3) | (word_cling_64_08(f5[j2]<<48)>>2) | (word_cling_64_08(f6[j2]<<48)>>1); t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) \ | (word_cling_64_08(f4[j2]<<40)>>3) | (word_cling_64_08(f5[j2]<<40)>>2) | (word_cling_64_08(f6[j2]<<40)>>1); t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) \ | (word_cling_64_08(f4[j2]<<32)>>3) | (word_cling_64_08(f5[j2]<<32)>>2) | (word_cling_64_08(f6[j2]<<32)>>1); t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) \ | (word_cling_64_08(f4[j2]<<24)>>3) | (word_cling_64_08(f5[j2]<<24)>>2) | (word_cling_64_08(f6[j2]<<24)>>1); t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) \ | (word_cling_64_08(f4[j2]<<16)>>3) | (word_cling_64_08(f5[j2]<<16)>>2) | (word_cling_64_08(f6[j2]<<16)>>1); t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) \ | (word_cling_64_08(f4[j2]<< 8)>>3) | (word_cling_64_08(f5[j2]<< 8)>>2) | (word_cling_64_08(f6[j2]<< 8)>>1); t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) \ | (word_cling_64_08(f4[j2]<< 0)>>3) | (word_cling_64_08(f5[j2]<< 0)>>2) | (word_cling_64_08(f6[j2]<< 0)>>1); } register word tmp= t[T->x->width-1]; switch(T->x->width - j) { case 8: t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) \ | (word_cling_64_08(f4[j2]<< 0)>>3) | (word_cling_64_08(f5[j2]<< 0)>>2) | (word_cling_64_08(f6[j2]<< 0)>>1); case 7: t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) \ | (word_cling_64_08(f4[j2]<< 8)>>3) | (word_cling_64_08(f5[j2]<< 8)>>2) | (word_cling_64_08(f6[j2]<< 8)>>1); case 6: t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) \ | (word_cling_64_08(f4[j2]<<16)>>3) | (word_cling_64_08(f5[j2]<<16)>>2) | (word_cling_64_08(f6[j2]<<16)>>1); case 5: t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) \ | (word_cling_64_08(f4[j2]<<24)>>3) | (word_cling_64_08(f5[j2]<<24)>>2) | (word_cling_64_08(f6[j2]<<24)>>1); case 4: t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) \ | (word_cling_64_08(f4[j2]<<32)>>3) | (word_cling_64_08(f5[j2]<<32)>>2) | (word_cling_64_08(f6[j2]<<32)>>1); case 3: t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) \ | (word_cling_64_08(f4[j2]<<40)>>3) | (word_cling_64_08(f5[j2]<<40)>>2) | (word_cling_64_08(f6[j2]<<40)>>1); case 2: t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) \ | (word_cling_64_08(f4[j2]<<48)>>3) | (word_cling_64_08(f5[j2]<<48)>>2) | (word_cling_64_08(f6[j2]<<48)>>1); case 1: t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) \ | (word_cling_64_08(f4[j2]<<56)>>3) | (word_cling_64_08(f5[j2]<<56)>>2) | (word_cling_64_08(f6[j2]<<56)>>1); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; case 6: { for(rci_t i=0; inrows; i++) { const word *f0 = F->x[0]->rows[i]; const word *f1 = F->x[1]->rows[i]; const word *f2 = F->x[2]->rows[i]; const word *f3 = F->x[3]->rows[i]; const word *f4 = F->x[4]->rows[i]; const word *f5 = F->x[5]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+8 < T->x->width; j+=8, j2++) { t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) \ | (word_cling_64_08(f4[j2]<<56)>>3) | (word_cling_64_08(f5[j2]<<56)>>2); t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) \ | (word_cling_64_08(f4[j2]<<48)>>3) | (word_cling_64_08(f5[j2]<<48)>>2); t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) \ | (word_cling_64_08(f4[j2]<<40)>>3) | (word_cling_64_08(f5[j2]<<40)>>2); t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) \ | (word_cling_64_08(f4[j2]<<32)>>3) | (word_cling_64_08(f5[j2]<<32)>>2); t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) \ | (word_cling_64_08(f4[j2]<<24)>>3) | (word_cling_64_08(f5[j2]<<24)>>2); t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) \ | (word_cling_64_08(f4[j2]<<16)>>3) | (word_cling_64_08(f5[j2]<<16)>>2); t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) \ | (word_cling_64_08(f4[j2]<< 8)>>3) | (word_cling_64_08(f5[j2]<< 8)>>2); t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) \ | (word_cling_64_08(f4[j2]<< 0)>>3) | (word_cling_64_08(f5[j2]<< 0)>>2); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 8: t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) \ | (word_cling_64_08(f4[j2]<< 0)>>3) | (word_cling_64_08(f5[j2]<< 0)>>2); case 7: t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) \ | (word_cling_64_08(f4[j2]<< 8)>>3) | (word_cling_64_08(f5[j2]<< 8)>>2); case 6: t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) \ | (word_cling_64_08(f4[j2]<<16)>>3) | (word_cling_64_08(f5[j2]<<16)>>2); case 5: t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) \ | (word_cling_64_08(f4[j2]<<24)>>3) | (word_cling_64_08(f5[j2]<<24)>>2); case 4: t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) \ | (word_cling_64_08(f4[j2]<<32)>>3) | (word_cling_64_08(f5[j2]<<32)>>2); case 3: t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) \ | (word_cling_64_08(f4[j2]<<40)>>3) | (word_cling_64_08(f5[j2]<<40)>>2); case 2: t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) \ | (word_cling_64_08(f4[j2]<<48)>>3) | (word_cling_64_08(f5[j2]<<48)>>2); case 1: t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) \ | (word_cling_64_08(f4[j2]<<56)>>3) | (word_cling_64_08(f5[j2]<<56)>>2); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; case 5: { for(rci_t i=0; inrows; i++) { const word *f0 = F->x[0]->rows[i]; const word *f1 = F->x[1]->rows[i]; const word *f2 = F->x[2]->rows[i]; const word *f3 = F->x[3]->rows[i]; const word *f4 = F->x[4]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+8 < T->x->width; j+=8, j2++) { t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) | (word_cling_64_08(f4[j2]<<56)>>3); t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) | (word_cling_64_08(f4[j2]<<48)>>3); t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) | (word_cling_64_08(f4[j2]<<40)>>3); t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) | (word_cling_64_08(f4[j2]<<32)>>3); t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) | (word_cling_64_08(f4[j2]<<24)>>3); t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) | (word_cling_64_08(f4[j2]<<16)>>3); t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) | (word_cling_64_08(f4[j2]<< 8)>>3); t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) | (word_cling_64_08(f4[j2]<< 0)>>3); } register word tmp = t[T->x->width - 1]; switch(T->x->width - j) { case 8: t[j+7] = (word_cling_64_08(f0[j2]<< 0)>>7) | (word_cling_64_08(f1[j2]<< 0)>>6) | (word_cling_64_08(f2[j2]<< 0)>>5) | (word_cling_64_08(f3[j2]<< 0)>>4) | (word_cling_64_08(f4[j2]<< 0)>>3); case 7: t[j+6] = (word_cling_64_08(f0[j2]<< 8)>>7) | (word_cling_64_08(f1[j2]<< 8)>>6) | (word_cling_64_08(f2[j2]<< 8)>>5) | (word_cling_64_08(f3[j2]<< 8)>>4) | (word_cling_64_08(f4[j2]<< 8)>>3); case 6: t[j+5] = (word_cling_64_08(f0[j2]<<16)>>7) | (word_cling_64_08(f1[j2]<<16)>>6) | (word_cling_64_08(f2[j2]<<16)>>5) | (word_cling_64_08(f3[j2]<<16)>>4) | (word_cling_64_08(f4[j2]<<16)>>3); case 5: t[j+4] = (word_cling_64_08(f0[j2]<<24)>>7) | (word_cling_64_08(f1[j2]<<24)>>6) | (word_cling_64_08(f2[j2]<<24)>>5) | (word_cling_64_08(f3[j2]<<24)>>4) | (word_cling_64_08(f4[j2]<<24)>>3); case 4: t[j+3] = (word_cling_64_08(f0[j2]<<32)>>7) | (word_cling_64_08(f1[j2]<<32)>>6) | (word_cling_64_08(f2[j2]<<32)>>5) | (word_cling_64_08(f3[j2]<<32)>>4) | (word_cling_64_08(f4[j2]<<32)>>3); case 3: t[j+2] = (word_cling_64_08(f0[j2]<<40)>>7) | (word_cling_64_08(f1[j2]<<40)>>6) | (word_cling_64_08(f2[j2]<<40)>>5) | (word_cling_64_08(f3[j2]<<40)>>4) | (word_cling_64_08(f4[j2]<<40)>>3); case 2: t[j+1] = (word_cling_64_08(f0[j2]<<48)>>7) | (word_cling_64_08(f1[j2]<<48)>>6) | (word_cling_64_08(f2[j2]<<48)>>5) | (word_cling_64_08(f3[j2]<<48)>>4) | (word_cling_64_08(f4[j2]<<48)>>3); case 1: t[j+0] = (word_cling_64_08(f0[j2]<<56)>>7) | (word_cling_64_08(f1[j2]<<56)>>6) | (word_cling_64_08(f2[j2]<<56)>>5) | (word_cling_64_08(f3[j2]<<56)>>4) | (word_cling_64_08(f4[j2]<<56)>>3); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; default: m4ri_die("impossible"); } return T; } m4rie-20200125/m4rie/conversion_cling16.c0000644000175000017500000013415113206144356014615 00000000000000/****************************************************************************** * * M4RIE: Linear Algebra over GF(2^e) * * Copyright (C) 2010-2013 Martin Albrecht * * Distributed under the terms of the GNU General Public License (GEL) * version 2 or higher. * * This code 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. * * The full text of the GPL is available at: * * http://www.gnu.org/licenses/ ******************************************************************************/ #include "conversion.h" static inline word word_cling_64_16(word a) { a = (a & xcccccccc & x__left04) | (a & xcccccccc>> 2 & x__left04)>>30; a = (a & xaaaaaaaa) | (a & xaaaaaaaa>> 1)>> 15; return a; } mzed_t *_mzed_cling16(mzed_t *T, const mzd_slice_t *F) { wi_t j,j2 = 0; const word bitmask_end = T->x->high_bitmask; if (mzd_slice_is_zero(F)) return T; for(rci_t i=0; inrows; i++) { const word *f00 = F->x[ 0]->rows[i]; const word *f01 = F->x[ 1]->rows[i]; const word *f02 = F->x[ 2]->rows[i]; const word *f03 = F->x[ 3]->rows[i]; const word *f04 = F->x[ 4]->rows[i]; const word *f05 = F->x[ 5]->rows[i]; const word *f06 = F->x[ 6]->rows[i]; const word *f07 = F->x[ 7]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] = (word_cling_64_16(f00[j2]<<60)>>15) | (word_cling_64_16(f01[j2]<<60)>>14) | (word_cling_64_16(f02[j2]<<60)>>13) | (word_cling_64_16(f03[j2]<<60)>>12) \ | (word_cling_64_16(f04[j2]<<60)>>11) | (word_cling_64_16(f05[j2]<<60)>>10) | (word_cling_64_16(f06[j2]<<60)>> 9) | (word_cling_64_16(f07[j2]<<60)>> 8); t[j+ 1] = (word_cling_64_16(f00[j2]<<56)>>15) | (word_cling_64_16(f01[j2]<<56)>>14) | (word_cling_64_16(f02[j2]<<56)>>13) | (word_cling_64_16(f03[j2]<<56)>>12) \ | (word_cling_64_16(f04[j2]<<56)>>11) | (word_cling_64_16(f05[j2]<<56)>>10) | (word_cling_64_16(f06[j2]<<56)>> 9) | (word_cling_64_16(f07[j2]<<56)>> 8); t[j+ 2] = (word_cling_64_16(f00[j2]<<52)>>15) | (word_cling_64_16(f01[j2]<<52)>>14) | (word_cling_64_16(f02[j2]<<52)>>13) | (word_cling_64_16(f03[j2]<<52)>>12) \ | (word_cling_64_16(f04[j2]<<52)>>11) | (word_cling_64_16(f05[j2]<<52)>>10) | (word_cling_64_16(f06[j2]<<52)>> 9) | (word_cling_64_16(f07[j2]<<52)>> 8); t[j+ 3] = (word_cling_64_16(f00[j2]<<48)>>15) | (word_cling_64_16(f01[j2]<<48)>>14) | (word_cling_64_16(f02[j2]<<48)>>13) | (word_cling_64_16(f03[j2]<<48)>>12) \ | (word_cling_64_16(f04[j2]<<48)>>11) | (word_cling_64_16(f05[j2]<<48)>>10) | (word_cling_64_16(f06[j2]<<48)>> 9) | (word_cling_64_16(f07[j2]<<48)>> 8); t[j+ 4] = (word_cling_64_16(f00[j2]<<44)>>15) | (word_cling_64_16(f01[j2]<<44)>>14) | (word_cling_64_16(f02[j2]<<44)>>13) | (word_cling_64_16(f03[j2]<<44)>>12) \ | (word_cling_64_16(f04[j2]<<44)>>11) | (word_cling_64_16(f05[j2]<<44)>>10) | (word_cling_64_16(f06[j2]<<44)>> 9) | (word_cling_64_16(f07[j2]<<44)>> 8); t[j+ 5] = (word_cling_64_16(f00[j2]<<40)>>15) | (word_cling_64_16(f01[j2]<<40)>>14) | (word_cling_64_16(f02[j2]<<40)>>13) | (word_cling_64_16(f03[j2]<<40)>>12) \ | (word_cling_64_16(f04[j2]<<40)>>11) | (word_cling_64_16(f05[j2]<<40)>>10) | (word_cling_64_16(f06[j2]<<40)>> 9) | (word_cling_64_16(f07[j2]<<40)>> 8); t[j+ 6] = (word_cling_64_16(f00[j2]<<36)>>15) | (word_cling_64_16(f01[j2]<<36)>>14) | (word_cling_64_16(f02[j2]<<36)>>13) | (word_cling_64_16(f03[j2]<<36)>>12) \ | (word_cling_64_16(f04[j2]<<36)>>11) | (word_cling_64_16(f05[j2]<<36)>>10) | (word_cling_64_16(f06[j2]<<36)>> 9) | (word_cling_64_16(f07[j2]<<36)>> 8); t[j+ 7] = (word_cling_64_16(f00[j2]<<32)>>15) | (word_cling_64_16(f01[j2]<<32)>>14) | (word_cling_64_16(f02[j2]<<32)>>13) | (word_cling_64_16(f03[j2]<<32)>>12) \ | (word_cling_64_16(f04[j2]<<32)>>11) | (word_cling_64_16(f05[j2]<<32)>>10) | (word_cling_64_16(f06[j2]<<32)>> 9) | (word_cling_64_16(f07[j2]<<32)>> 8); t[j+ 8] = (word_cling_64_16(f00[j2]<<28)>>15) | (word_cling_64_16(f01[j2]<<28)>>14) | (word_cling_64_16(f02[j2]<<28)>>13) | (word_cling_64_16(f03[j2]<<28)>>12) \ | (word_cling_64_16(f04[j2]<<28)>>11) | (word_cling_64_16(f05[j2]<<28)>>10) | (word_cling_64_16(f06[j2]<<28)>> 9) | (word_cling_64_16(f07[j2]<<28)>> 8); t[j+ 9] = (word_cling_64_16(f00[j2]<<24)>>15) | (word_cling_64_16(f01[j2]<<24)>>14) | (word_cling_64_16(f02[j2]<<24)>>13) | (word_cling_64_16(f03[j2]<<24)>>12) \ | (word_cling_64_16(f04[j2]<<24)>>11) | (word_cling_64_16(f05[j2]<<24)>>10) | (word_cling_64_16(f06[j2]<<24)>> 9) | (word_cling_64_16(f07[j2]<<24)>> 8); t[j+10] = (word_cling_64_16(f00[j2]<<20)>>15) | (word_cling_64_16(f01[j2]<<20)>>14) | (word_cling_64_16(f02[j2]<<20)>>13) | (word_cling_64_16(f03[j2]<<20)>>12) \ | (word_cling_64_16(f04[j2]<<20)>>11) | (word_cling_64_16(f05[j2]<<20)>>10) | (word_cling_64_16(f06[j2]<<20)>> 9) | (word_cling_64_16(f07[j2]<<20)>> 8); t[j+11] = (word_cling_64_16(f00[j2]<<16)>>15) | (word_cling_64_16(f01[j2]<<16)>>14) | (word_cling_64_16(f02[j2]<<16)>>13) | (word_cling_64_16(f03[j2]<<16)>>12) \ | (word_cling_64_16(f04[j2]<<16)>>11) | (word_cling_64_16(f05[j2]<<16)>>10) | (word_cling_64_16(f06[j2]<<16)>> 9) | (word_cling_64_16(f07[j2]<<16)>> 8); t[j+12] = (word_cling_64_16(f00[j2]<<12)>>15) | (word_cling_64_16(f01[j2]<<12)>>14) | (word_cling_64_16(f02[j2]<<12)>>13) | (word_cling_64_16(f03[j2]<<12)>>12) \ | (word_cling_64_16(f04[j2]<<12)>>11) | (word_cling_64_16(f05[j2]<<12)>>10) | (word_cling_64_16(f06[j2]<<12)>> 9) | (word_cling_64_16(f07[j2]<<12)>> 8); t[j+13] = (word_cling_64_16(f00[j2]<< 8)>>15) | (word_cling_64_16(f01[j2]<< 8)>>14) | (word_cling_64_16(f02[j2]<< 8)>>13) | (word_cling_64_16(f03[j2]<< 8)>>12) \ | (word_cling_64_16(f04[j2]<< 8)>>11) | (word_cling_64_16(f05[j2]<< 8)>>10) | (word_cling_64_16(f06[j2]<< 8)>> 9) | (word_cling_64_16(f07[j2]<< 8)>> 8); t[j+14] = (word_cling_64_16(f00[j2]<< 4)>>15) | (word_cling_64_16(f01[j2]<< 4)>>14) | (word_cling_64_16(f02[j2]<< 4)>>13) | (word_cling_64_16(f03[j2]<< 4)>>12) \ | (word_cling_64_16(f04[j2]<< 4)>>11) | (word_cling_64_16(f05[j2]<< 4)>>10) | (word_cling_64_16(f06[j2]<< 4)>> 9) | (word_cling_64_16(f07[j2]<< 4)>> 8); t[j+15] = (word_cling_64_16(f00[j2]<< 0)>>15) | (word_cling_64_16(f01[j2]<< 0)>>14) | (word_cling_64_16(f02[j2]<< 0)>>13) | (word_cling_64_16(f03[j2]<< 0)>>12) \ | (word_cling_64_16(f04[j2]<< 0)>>11) | (word_cling_64_16(f05[j2]<< 0)>>10) | (word_cling_64_16(f06[j2]<< 0)>> 9) | (word_cling_64_16(f07[j2]<< 0)>> 8); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] = (word_cling_64_16(f00[j2]<< 0)>>15) | (word_cling_64_16(f01[j2]<< 0)>>14) | (word_cling_64_16(f02[j2]<< 0)>>13) | (word_cling_64_16(f03[j2]<< 0)>>12) | \ (word_cling_64_16(f04[j2]<< 0)>>11) | (word_cling_64_16(f05[j2]<< 0)>>10) | (word_cling_64_16(f06[j2]<< 0)>> 9) | (word_cling_64_16(f07[j2]<< 0)>> 8); case 15: t[j+14] = (word_cling_64_16(f00[j2]<< 4)>>15) | (word_cling_64_16(f01[j2]<< 4)>>14) | (word_cling_64_16(f02[j2]<< 4)>>13) | (word_cling_64_16(f03[j2]<< 4)>>12) | \ (word_cling_64_16(f04[j2]<< 4)>>11) | (word_cling_64_16(f05[j2]<< 4)>>10) | (word_cling_64_16(f06[j2]<< 4)>> 9) | (word_cling_64_16(f07[j2]<< 4)>> 8); case 14: t[j+13] = (word_cling_64_16(f00[j2]<< 8)>>15) | (word_cling_64_16(f01[j2]<< 8)>>14) | (word_cling_64_16(f02[j2]<< 8)>>13) | (word_cling_64_16(f03[j2]<< 8)>>12) | \ (word_cling_64_16(f04[j2]<< 8)>>11) | (word_cling_64_16(f05[j2]<< 8)>>10) | (word_cling_64_16(f06[j2]<< 8)>> 9) | (word_cling_64_16(f07[j2]<< 8)>> 8); case 13: t[j+12] = (word_cling_64_16(f00[j2]<<12)>>15) | (word_cling_64_16(f01[j2]<<12)>>14) | (word_cling_64_16(f02[j2]<<12)>>13) | (word_cling_64_16(f03[j2]<<12)>>12) | \ (word_cling_64_16(f04[j2]<<12)>>11) | (word_cling_64_16(f05[j2]<<12)>>10) | (word_cling_64_16(f06[j2]<<12)>> 9) | (word_cling_64_16(f07[j2]<<12)>> 8); case 12: t[j+11] = (word_cling_64_16(f00[j2]<<16)>>15) | (word_cling_64_16(f01[j2]<<16)>>14) | (word_cling_64_16(f02[j2]<<16)>>13) | (word_cling_64_16(f03[j2]<<16)>>12) | \ (word_cling_64_16(f04[j2]<<16)>>11) | (word_cling_64_16(f05[j2]<<16)>>10) | (word_cling_64_16(f06[j2]<<16)>> 9) | (word_cling_64_16(f07[j2]<<16)>> 8); case 11: t[j+10] = (word_cling_64_16(f00[j2]<<20)>>15) | (word_cling_64_16(f01[j2]<<20)>>14) | (word_cling_64_16(f02[j2]<<20)>>13) | (word_cling_64_16(f03[j2]<<20)>>12) | \ (word_cling_64_16(f04[j2]<<20)>>11) | (word_cling_64_16(f05[j2]<<20)>>10) | (word_cling_64_16(f06[j2]<<20)>> 9) | (word_cling_64_16(f07[j2]<<20)>> 8); case 10: t[j+ 9] = (word_cling_64_16(f00[j2]<<24)>>15) | (word_cling_64_16(f01[j2]<<24)>>14) | (word_cling_64_16(f02[j2]<<24)>>13) | (word_cling_64_16(f03[j2]<<24)>>12) | \ (word_cling_64_16(f04[j2]<<24)>>11) | (word_cling_64_16(f05[j2]<<24)>>10) | (word_cling_64_16(f06[j2]<<24)>> 9) | (word_cling_64_16(f07[j2]<<24)>> 8); case 9: t[j+ 8] = (word_cling_64_16(f00[j2]<<28)>>15) | (word_cling_64_16(f01[j2]<<28)>>14) | (word_cling_64_16(f02[j2]<<28)>>13) | (word_cling_64_16(f03[j2]<<28)>>12) | \ (word_cling_64_16(f04[j2]<<28)>>11) | (word_cling_64_16(f05[j2]<<28)>>10) | (word_cling_64_16(f06[j2]<<28)>> 9) | (word_cling_64_16(f07[j2]<<28)>> 8); case 8: t[j+ 7] = (word_cling_64_16(f00[j2]<<32)>>15) | (word_cling_64_16(f01[j2]<<32)>>14) | (word_cling_64_16(f02[j2]<<32)>>13) | (word_cling_64_16(f03[j2]<<32)>>12) | \ (word_cling_64_16(f04[j2]<<32)>>11) | (word_cling_64_16(f05[j2]<<32)>>10) | (word_cling_64_16(f06[j2]<<32)>> 9) | (word_cling_64_16(f07[j2]<<32)>> 8); case 7: t[j+ 6] = (word_cling_64_16(f00[j2]<<36)>>15) | (word_cling_64_16(f01[j2]<<36)>>14) | (word_cling_64_16(f02[j2]<<36)>>13) | (word_cling_64_16(f03[j2]<<36)>>12) | \ (word_cling_64_16(f04[j2]<<36)>>11) | (word_cling_64_16(f05[j2]<<36)>>10) | (word_cling_64_16(f06[j2]<<36)>> 9) | (word_cling_64_16(f07[j2]<<36)>> 8); case 6: t[j+ 5] = (word_cling_64_16(f00[j2]<<40)>>15) | (word_cling_64_16(f01[j2]<<40)>>14) | (word_cling_64_16(f02[j2]<<40)>>13) | (word_cling_64_16(f03[j2]<<40)>>12) | \ (word_cling_64_16(f04[j2]<<40)>>11) | (word_cling_64_16(f05[j2]<<40)>>10) | (word_cling_64_16(f06[j2]<<40)>> 9) | (word_cling_64_16(f07[j2]<<40)>> 8); case 5: t[j+ 4] = (word_cling_64_16(f00[j2]<<44)>>15) | (word_cling_64_16(f01[j2]<<44)>>14) | (word_cling_64_16(f02[j2]<<44)>>13) | (word_cling_64_16(f03[j2]<<44)>>12) | \ (word_cling_64_16(f04[j2]<<44)>>11) | (word_cling_64_16(f05[j2]<<44)>>10) | (word_cling_64_16(f06[j2]<<44)>> 9) | (word_cling_64_16(f07[j2]<<44)>> 8); case 4: t[j+ 3] = (word_cling_64_16(f00[j2]<<48)>>15) | (word_cling_64_16(f01[j2]<<48)>>14) | (word_cling_64_16(f02[j2]<<48)>>13) | (word_cling_64_16(f03[j2]<<48)>>12) | \ (word_cling_64_16(f04[j2]<<48)>>11) | (word_cling_64_16(f05[j2]<<48)>>10) | (word_cling_64_16(f06[j2]<<48)>> 9) | (word_cling_64_16(f07[j2]<<48)>> 8); case 3: t[j+ 2] = (word_cling_64_16(f00[j2]<<52)>>15) | (word_cling_64_16(f01[j2]<<52)>>14) | (word_cling_64_16(f02[j2]<<52)>>13) | (word_cling_64_16(f03[j2]<<52)>>12) | \ (word_cling_64_16(f04[j2]<<52)>>11) | (word_cling_64_16(f05[j2]<<52)>>10) | (word_cling_64_16(f06[j2]<<52)>> 9) | (word_cling_64_16(f07[j2]<<52)>> 8); case 2: t[j+ 1] = (word_cling_64_16(f00[j2]<<56)>>15) | (word_cling_64_16(f01[j2]<<56)>>14) | (word_cling_64_16(f02[j2]<<56)>>13) | (word_cling_64_16(f03[j2]<<56)>>12) | \ (word_cling_64_16(f04[j2]<<56)>>11) | (word_cling_64_16(f05[j2]<<56)>>10) | (word_cling_64_16(f06[j2]<<56)>> 9) | (word_cling_64_16(f07[j2]<<56)>> 8); case 1: t[j+ 0] = (word_cling_64_16(f00[j2]<<60)>>15) | (word_cling_64_16(f01[j2]<<60)>>14) | (word_cling_64_16(f02[j2]<<60)>>13) | (word_cling_64_16(f03[j2]<<60)>>12) | \ (word_cling_64_16(f04[j2]<<60)>>11) | (word_cling_64_16(f05[j2]<<60)>>10) | (word_cling_64_16(f06[j2]<<60)>> 9) | (word_cling_64_16(f07[j2]<<60)>> 8); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } if(T->finite_field->degree < 12) { switch(T->finite_field->degree) { case 9: { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[ 8]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; case 10: { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[ 8]->rows[i]; const word *f01 = F->x[ 9]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7) | (word_cling_64_16(f01[j2]<<60)>>6); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7) | (word_cling_64_16(f01[j2]<<56)>>6); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7) | (word_cling_64_16(f01[j2]<<52)>>6); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7) | (word_cling_64_16(f01[j2]<<48)>>6); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7) | (word_cling_64_16(f01[j2]<<44)>>6); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7) | (word_cling_64_16(f01[j2]<<40)>>6); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7) | (word_cling_64_16(f01[j2]<<36)>>6); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7) | (word_cling_64_16(f01[j2]<<32)>>6); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7) | (word_cling_64_16(f01[j2]<<28)>>6); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7) | (word_cling_64_16(f01[j2]<<24)>>6); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7) | (word_cling_64_16(f01[j2]<<20)>>6); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7) | (word_cling_64_16(f01[j2]<<16)>>6); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7) | (word_cling_64_16(f01[j2]<<12)>>6); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7) | (word_cling_64_16(f01[j2]<< 8)>>6); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7) | (word_cling_64_16(f01[j2]<< 4)>>6); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7) | (word_cling_64_16(f01[j2]<< 0)>>6); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7) | (word_cling_64_16(f01[j2]<< 0)>>6); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7) | (word_cling_64_16(f01[j2]<< 4)>>6); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7) | (word_cling_64_16(f01[j2]<< 8)>>6); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7) | (word_cling_64_16(f01[j2]<<12)>>6); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7) | (word_cling_64_16(f01[j2]<<16)>>6); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7) | (word_cling_64_16(f01[j2]<<20)>>6); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7) | (word_cling_64_16(f01[j2]<<24)>>6); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7) | (word_cling_64_16(f01[j2]<<28)>>6); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7) | (word_cling_64_16(f01[j2]<<32)>>6); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7) | (word_cling_64_16(f01[j2]<<36)>>6); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7) | (word_cling_64_16(f01[j2]<<40)>>6); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7) | (word_cling_64_16(f01[j2]<<44)>>6); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7) | (word_cling_64_16(f01[j2]<<48)>>6); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7) | (word_cling_64_16(f01[j2]<<52)>>6); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7) | (word_cling_64_16(f01[j2]<<56)>>6); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7) | (word_cling_64_16(f01[j2]<<60)>>6); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; case 11: { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[ 8]->rows[i]; const word *f01 = F->x[ 9]->rows[i]; const word *f02 = F->x[10]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7) | (word_cling_64_16(f01[j2]<<60)>>6) | (word_cling_64_16(f02[j2]<<60)>>5); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7) | (word_cling_64_16(f01[j2]<<56)>>6) | (word_cling_64_16(f02[j2]<<56)>>5); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7) | (word_cling_64_16(f01[j2]<<52)>>6) | (word_cling_64_16(f02[j2]<<52)>>5); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7) | (word_cling_64_16(f01[j2]<<48)>>6) | (word_cling_64_16(f02[j2]<<48)>>5); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7) | (word_cling_64_16(f01[j2]<<44)>>6) | (word_cling_64_16(f02[j2]<<44)>>5); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7) | (word_cling_64_16(f01[j2]<<40)>>6) | (word_cling_64_16(f02[j2]<<40)>>5); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7) | (word_cling_64_16(f01[j2]<<36)>>6) | (word_cling_64_16(f02[j2]<<36)>>5); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7) | (word_cling_64_16(f01[j2]<<32)>>6) | (word_cling_64_16(f02[j2]<<32)>>5); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7) | (word_cling_64_16(f01[j2]<<28)>>6) | (word_cling_64_16(f02[j2]<<28)>>5); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7) | (word_cling_64_16(f01[j2]<<24)>>6) | (word_cling_64_16(f02[j2]<<24)>>5); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7) | (word_cling_64_16(f01[j2]<<20)>>6) | (word_cling_64_16(f02[j2]<<20)>>5); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7) | (word_cling_64_16(f01[j2]<<16)>>6) | (word_cling_64_16(f02[j2]<<16)>>5); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7) | (word_cling_64_16(f01[j2]<<12)>>6) | (word_cling_64_16(f02[j2]<<12)>>5); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7) | (word_cling_64_16(f01[j2]<< 8)>>6) | (word_cling_64_16(f02[j2]<< 8)>>5); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7) | (word_cling_64_16(f01[j2]<< 4)>>6) | (word_cling_64_16(f02[j2]<< 4)>>5); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7) | (word_cling_64_16(f01[j2]<< 0)>>6) | (word_cling_64_16(f02[j2]<< 0)>>5); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7) | (word_cling_64_16(f01[j2]<< 0)>>6) | (word_cling_64_16(f02[j2]<< 0)>>5); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7) | (word_cling_64_16(f01[j2]<< 4)>>6) | (word_cling_64_16(f02[j2]<< 4)>>5); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7) | (word_cling_64_16(f01[j2]<< 8)>>6) | (word_cling_64_16(f02[j2]<< 8)>>5); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7) | (word_cling_64_16(f01[j2]<<12)>>6) | (word_cling_64_16(f02[j2]<<12)>>5); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7) | (word_cling_64_16(f01[j2]<<16)>>6) | (word_cling_64_16(f02[j2]<<16)>>5); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7) | (word_cling_64_16(f01[j2]<<20)>>6) | (word_cling_64_16(f02[j2]<<20)>>5); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7) | (word_cling_64_16(f01[j2]<<24)>>6) | (word_cling_64_16(f02[j2]<<24)>>5); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7) | (word_cling_64_16(f01[j2]<<28)>>6) | (word_cling_64_16(f02[j2]<<28)>>5); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7) | (word_cling_64_16(f01[j2]<<32)>>6) | (word_cling_64_16(f02[j2]<<32)>>5); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7) | (word_cling_64_16(f01[j2]<<36)>>6) | (word_cling_64_16(f02[j2]<<36)>>5); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7) | (word_cling_64_16(f01[j2]<<40)>>6) | (word_cling_64_16(f02[j2]<<40)>>5); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7) | (word_cling_64_16(f01[j2]<<44)>>6) | (word_cling_64_16(f02[j2]<<44)>>5); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7) | (word_cling_64_16(f01[j2]<<48)>>6) | (word_cling_64_16(f02[j2]<<48)>>5); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7) | (word_cling_64_16(f01[j2]<<52)>>6) | (word_cling_64_16(f02[j2]<<52)>>5); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7) | (word_cling_64_16(f01[j2]<<56)>>6) | (word_cling_64_16(f02[j2]<<56)>>5); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7) | (word_cling_64_16(f01[j2]<<60)>>6) | (word_cling_64_16(f02[j2]<<60)>>5); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; } } else { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[ 8]->rows[i]; const word *f01 = F->x[ 9]->rows[i]; const word *f02 = F->x[10]->rows[i]; const word *f03 = F->x[11]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7) | (word_cling_64_16(f01[j2]<<60)>>6) | (word_cling_64_16(f02[j2]<<60)>>5) | (word_cling_64_16(f03[j2]<<60)>>4); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7) | (word_cling_64_16(f01[j2]<<56)>>6) | (word_cling_64_16(f02[j2]<<56)>>5) | (word_cling_64_16(f03[j2]<<56)>>4); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7) | (word_cling_64_16(f01[j2]<<52)>>6) | (word_cling_64_16(f02[j2]<<52)>>5) | (word_cling_64_16(f03[j2]<<52)>>4); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7) | (word_cling_64_16(f01[j2]<<48)>>6) | (word_cling_64_16(f02[j2]<<48)>>5) | (word_cling_64_16(f03[j2]<<48)>>4); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7) | (word_cling_64_16(f01[j2]<<44)>>6) | (word_cling_64_16(f02[j2]<<44)>>5) | (word_cling_64_16(f03[j2]<<44)>>4); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7) | (word_cling_64_16(f01[j2]<<40)>>6) | (word_cling_64_16(f02[j2]<<40)>>5) | (word_cling_64_16(f03[j2]<<40)>>4); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7) | (word_cling_64_16(f01[j2]<<36)>>6) | (word_cling_64_16(f02[j2]<<36)>>5) | (word_cling_64_16(f03[j2]<<36)>>4); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7) | (word_cling_64_16(f01[j2]<<32)>>6) | (word_cling_64_16(f02[j2]<<32)>>5) | (word_cling_64_16(f03[j2]<<32)>>4); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7) | (word_cling_64_16(f01[j2]<<28)>>6) | (word_cling_64_16(f02[j2]<<28)>>5) | (word_cling_64_16(f03[j2]<<28)>>4); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7) | (word_cling_64_16(f01[j2]<<24)>>6) | (word_cling_64_16(f02[j2]<<24)>>5) | (word_cling_64_16(f03[j2]<<24)>>4); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7) | (word_cling_64_16(f01[j2]<<20)>>6) | (word_cling_64_16(f02[j2]<<20)>>5) | (word_cling_64_16(f03[j2]<<20)>>4); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7) | (word_cling_64_16(f01[j2]<<16)>>6) | (word_cling_64_16(f02[j2]<<16)>>5) | (word_cling_64_16(f03[j2]<<16)>>4); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7) | (word_cling_64_16(f01[j2]<<12)>>6) | (word_cling_64_16(f02[j2]<<12)>>5) | (word_cling_64_16(f03[j2]<<12)>>4); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7) | (word_cling_64_16(f01[j2]<< 8)>>6) | (word_cling_64_16(f02[j2]<< 8)>>5) | (word_cling_64_16(f03[j2]<< 8)>>4); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7) | (word_cling_64_16(f01[j2]<< 4)>>6) | (word_cling_64_16(f02[j2]<< 4)>>5) | (word_cling_64_16(f03[j2]<< 4)>>4); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7) | (word_cling_64_16(f01[j2]<< 0)>>6) | (word_cling_64_16(f02[j2]<< 0)>>5) | (word_cling_64_16(f03[j2]<< 0)>>4); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>7) | (word_cling_64_16(f01[j2]<< 0)>>6) | (word_cling_64_16(f02[j2]<< 0)>>5) | (word_cling_64_16(f03[j2]<< 0)>>4); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>7) | (word_cling_64_16(f01[j2]<< 4)>>6) | (word_cling_64_16(f02[j2]<< 4)>>5) | (word_cling_64_16(f03[j2]<< 4)>>4); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>7) | (word_cling_64_16(f01[j2]<< 8)>>6) | (word_cling_64_16(f02[j2]<< 8)>>5) | (word_cling_64_16(f03[j2]<< 8)>>4); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>7) | (word_cling_64_16(f01[j2]<<12)>>6) | (word_cling_64_16(f02[j2]<<12)>>5) | (word_cling_64_16(f03[j2]<<12)>>4); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>7) | (word_cling_64_16(f01[j2]<<16)>>6) | (word_cling_64_16(f02[j2]<<16)>>5) | (word_cling_64_16(f03[j2]<<16)>>4); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>7) | (word_cling_64_16(f01[j2]<<20)>>6) | (word_cling_64_16(f02[j2]<<20)>>5) | (word_cling_64_16(f03[j2]<<20)>>4); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>7) | (word_cling_64_16(f01[j2]<<24)>>6) | (word_cling_64_16(f02[j2]<<24)>>5) | (word_cling_64_16(f03[j2]<<24)>>4); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>7) | (word_cling_64_16(f01[j2]<<28)>>6) | (word_cling_64_16(f02[j2]<<28)>>5) | (word_cling_64_16(f03[j2]<<28)>>4); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>7) | (word_cling_64_16(f01[j2]<<32)>>6) | (word_cling_64_16(f02[j2]<<32)>>5) | (word_cling_64_16(f03[j2]<<32)>>4); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>7) | (word_cling_64_16(f01[j2]<<36)>>6) | (word_cling_64_16(f02[j2]<<36)>>5) | (word_cling_64_16(f03[j2]<<36)>>4); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>7) | (word_cling_64_16(f01[j2]<<40)>>6) | (word_cling_64_16(f02[j2]<<40)>>5) | (word_cling_64_16(f03[j2]<<40)>>4); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>7) | (word_cling_64_16(f01[j2]<<44)>>6) | (word_cling_64_16(f02[j2]<<44)>>5) | (word_cling_64_16(f03[j2]<<44)>>4); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>7) | (word_cling_64_16(f01[j2]<<48)>>6) | (word_cling_64_16(f02[j2]<<48)>>5) | (word_cling_64_16(f03[j2]<<48)>>4); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>7) | (word_cling_64_16(f01[j2]<<52)>>6) | (word_cling_64_16(f02[j2]<<52)>>5) | (word_cling_64_16(f03[j2]<<52)>>4); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>7) | (word_cling_64_16(f01[j2]<<56)>>6) | (word_cling_64_16(f02[j2]<<56)>>5) | (word_cling_64_16(f03[j2]<<56)>>4); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>7) | (word_cling_64_16(f01[j2]<<60)>>6) | (word_cling_64_16(f02[j2]<<60)>>5) | (word_cling_64_16(f03[j2]<<60)>>4); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); switch(T->finite_field->degree) { case 13: { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[12]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; case 14: { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[12]->rows[i]; const word *f01 = F->x[13]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3) | (word_cling_64_16(f01[j2]<<60)>>2); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3) | (word_cling_64_16(f01[j2]<<56)>>2); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3) | (word_cling_64_16(f01[j2]<<52)>>2); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3) | (word_cling_64_16(f01[j2]<<48)>>2); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3) | (word_cling_64_16(f01[j2]<<44)>>2); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3) | (word_cling_64_16(f01[j2]<<40)>>2); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3) | (word_cling_64_16(f01[j2]<<36)>>2); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3) | (word_cling_64_16(f01[j2]<<32)>>2); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3) | (word_cling_64_16(f01[j2]<<28)>>2); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3) | (word_cling_64_16(f01[j2]<<24)>>2); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3) | (word_cling_64_16(f01[j2]<<20)>>2); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3) | (word_cling_64_16(f01[j2]<<16)>>2); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3) | (word_cling_64_16(f01[j2]<<12)>>2); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3) | (word_cling_64_16(f01[j2]<< 8)>>2); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3) | (word_cling_64_16(f01[j2]<< 4)>>2); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3) | (word_cling_64_16(f01[j2]<< 0)>>2); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3) | (word_cling_64_16(f01[j2]<< 0)>>2); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3) | (word_cling_64_16(f01[j2]<< 4)>>2); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3) | (word_cling_64_16(f01[j2]<< 8)>>2); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3) | (word_cling_64_16(f01[j2]<<12)>>2); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3) | (word_cling_64_16(f01[j2]<<16)>>2); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3) | (word_cling_64_16(f01[j2]<<20)>>2); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3) | (word_cling_64_16(f01[j2]<<24)>>2); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3) | (word_cling_64_16(f01[j2]<<28)>>2); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3) | (word_cling_64_16(f01[j2]<<32)>>2); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3) | (word_cling_64_16(f01[j2]<<36)>>2); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3) | (word_cling_64_16(f01[j2]<<40)>>2); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3) | (word_cling_64_16(f01[j2]<<44)>>2); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3) | (word_cling_64_16(f01[j2]<<48)>>2); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3) | (word_cling_64_16(f01[j2]<<52)>>2); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3) | (word_cling_64_16(f01[j2]<<56)>>2); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3) | (word_cling_64_16(f01[j2]<<60)>>2); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; case 15: { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[12]->rows[i]; const word *f01 = F->x[13]->rows[i]; const word *f02 = F->x[14]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3) | (word_cling_64_16(f01[j2]<<60)>>2) | (word_cling_64_16(f02[j2]<<60)>>1); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3) | (word_cling_64_16(f01[j2]<<56)>>2) | (word_cling_64_16(f02[j2]<<56)>>1); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3) | (word_cling_64_16(f01[j2]<<52)>>2) | (word_cling_64_16(f02[j2]<<52)>>1); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3) | (word_cling_64_16(f01[j2]<<48)>>2) | (word_cling_64_16(f02[j2]<<48)>>1); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3) | (word_cling_64_16(f01[j2]<<44)>>2) | (word_cling_64_16(f02[j2]<<44)>>1); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3) | (word_cling_64_16(f01[j2]<<40)>>2) | (word_cling_64_16(f02[j2]<<40)>>1); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3) | (word_cling_64_16(f01[j2]<<36)>>2) | (word_cling_64_16(f02[j2]<<36)>>1); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3) | (word_cling_64_16(f01[j2]<<32)>>2) | (word_cling_64_16(f02[j2]<<32)>>1); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3) | (word_cling_64_16(f01[j2]<<28)>>2) | (word_cling_64_16(f02[j2]<<28)>>1); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3) | (word_cling_64_16(f01[j2]<<24)>>2) | (word_cling_64_16(f02[j2]<<24)>>1); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3) | (word_cling_64_16(f01[j2]<<20)>>2) | (word_cling_64_16(f02[j2]<<20)>>1); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3) | (word_cling_64_16(f01[j2]<<16)>>2) | (word_cling_64_16(f02[j2]<<16)>>1); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3) | (word_cling_64_16(f01[j2]<<12)>>2) | (word_cling_64_16(f02[j2]<<12)>>1); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3) | (word_cling_64_16(f01[j2]<< 8)>>2) | (word_cling_64_16(f02[j2]<< 8)>>1); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3) | (word_cling_64_16(f01[j2]<< 4)>>2) | (word_cling_64_16(f02[j2]<< 4)>>1); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3) | (word_cling_64_16(f01[j2]<< 0)>>2) | (word_cling_64_16(f02[j2]<< 0)>>1); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3) | (word_cling_64_16(f01[j2]<< 0)>>2) | (word_cling_64_16(f02[j2]<< 0)>>1); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3) | (word_cling_64_16(f01[j2]<< 4)>>2) | (word_cling_64_16(f02[j2]<< 4)>>1); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3) | (word_cling_64_16(f01[j2]<< 8)>>2) | (word_cling_64_16(f02[j2]<< 8)>>1); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3) | (word_cling_64_16(f01[j2]<<12)>>2) | (word_cling_64_16(f02[j2]<<12)>>1); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3) | (word_cling_64_16(f01[j2]<<16)>>2) | (word_cling_64_16(f02[j2]<<16)>>1); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3) | (word_cling_64_16(f01[j2]<<20)>>2) | (word_cling_64_16(f02[j2]<<20)>>1); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3) | (word_cling_64_16(f01[j2]<<24)>>2) | (word_cling_64_16(f02[j2]<<24)>>1); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3) | (word_cling_64_16(f01[j2]<<28)>>2) | (word_cling_64_16(f02[j2]<<28)>>1); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3) | (word_cling_64_16(f01[j2]<<32)>>2) | (word_cling_64_16(f02[j2]<<32)>>1); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3) | (word_cling_64_16(f01[j2]<<36)>>2) | (word_cling_64_16(f02[j2]<<36)>>1); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3) | (word_cling_64_16(f01[j2]<<40)>>2) | (word_cling_64_16(f02[j2]<<40)>>1); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3) | (word_cling_64_16(f01[j2]<<44)>>2) | (word_cling_64_16(f02[j2]<<44)>>1); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3) | (word_cling_64_16(f01[j2]<<48)>>2) | (word_cling_64_16(f02[j2]<<48)>>1); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3) | (word_cling_64_16(f01[j2]<<52)>>2) | (word_cling_64_16(f02[j2]<<52)>>1); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3) | (word_cling_64_16(f01[j2]<<56)>>2) | (word_cling_64_16(f02[j2]<<56)>>1); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3) | (word_cling_64_16(f01[j2]<<60)>>2) | (word_cling_64_16(f02[j2]<<60)>>1); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; case 16: { for(rci_t i=0; inrows; i++) { const word *f00 = F->x[12]->rows[i]; const word *f01 = F->x[13]->rows[i]; const word *f02 = F->x[14]->rows[i]; const word *f03 = F->x[15]->rows[i]; word *t = T->x->rows[i]; for(j=0, j2=0; j+16 < T->x->width; j+=16, j2++) { t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3) | (word_cling_64_16(f01[j2]<<60)>>2) | (word_cling_64_16(f02[j2]<<60)>>1) | (word_cling_64_16(f03[j2]<<60)>>0); t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3) | (word_cling_64_16(f01[j2]<<56)>>2) | (word_cling_64_16(f02[j2]<<56)>>1) | (word_cling_64_16(f03[j2]<<56)>>0); t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3) | (word_cling_64_16(f01[j2]<<52)>>2) | (word_cling_64_16(f02[j2]<<52)>>1) | (word_cling_64_16(f03[j2]<<52)>>0); t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3) | (word_cling_64_16(f01[j2]<<48)>>2) | (word_cling_64_16(f02[j2]<<48)>>1) | (word_cling_64_16(f03[j2]<<48)>>0); t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3) | (word_cling_64_16(f01[j2]<<44)>>2) | (word_cling_64_16(f02[j2]<<44)>>1) | (word_cling_64_16(f03[j2]<<44)>>0); t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3) | (word_cling_64_16(f01[j2]<<40)>>2) | (word_cling_64_16(f02[j2]<<40)>>1) | (word_cling_64_16(f03[j2]<<40)>>0); t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3) | (word_cling_64_16(f01[j2]<<36)>>2) | (word_cling_64_16(f02[j2]<<36)>>1) | (word_cling_64_16(f03[j2]<<36)>>0); t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3) | (word_cling_64_16(f01[j2]<<32)>>2) | (word_cling_64_16(f02[j2]<<32)>>1) | (word_cling_64_16(f03[j2]<<32)>>0); t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3) | (word_cling_64_16(f01[j2]<<28)>>2) | (word_cling_64_16(f02[j2]<<28)>>1) | (word_cling_64_16(f03[j2]<<28)>>0); t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3) | (word_cling_64_16(f01[j2]<<24)>>2) | (word_cling_64_16(f02[j2]<<24)>>1) | (word_cling_64_16(f03[j2]<<24)>>0); t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3) | (word_cling_64_16(f01[j2]<<20)>>2) | (word_cling_64_16(f02[j2]<<20)>>1) | (word_cling_64_16(f03[j2]<<20)>>0); t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3) | (word_cling_64_16(f01[j2]<<16)>>2) | (word_cling_64_16(f02[j2]<<16)>>1) | (word_cling_64_16(f03[j2]<<16)>>0); t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3) | (word_cling_64_16(f01[j2]<<12)>>2) | (word_cling_64_16(f02[j2]<<12)>>1) | (word_cling_64_16(f03[j2]<<12)>>0); t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3) | (word_cling_64_16(f01[j2]<< 8)>>2) | (word_cling_64_16(f02[j2]<< 8)>>1) | (word_cling_64_16(f03[j2]<< 8)>>0); t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3) | (word_cling_64_16(f01[j2]<< 4)>>2) | (word_cling_64_16(f02[j2]<< 4)>>1) | (word_cling_64_16(f03[j2]<< 4)>>0); t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3) | (word_cling_64_16(f01[j2]<< 0)>>2) | (word_cling_64_16(f02[j2]<< 0)>>1) | (word_cling_64_16(f03[j2]<< 0)>>0); } register word tmp = t[T->x->width-1]; switch(T->x->width - j) { case 16: t[j+15] |= (word_cling_64_16(f00[j2]<< 0)>>3) | (word_cling_64_16(f01[j2]<< 0)>>2) | (word_cling_64_16(f02[j2]<< 0)>>1) | (word_cling_64_16(f03[j2]<< 0)>>0); case 15: t[j+14] |= (word_cling_64_16(f00[j2]<< 4)>>3) | (word_cling_64_16(f01[j2]<< 4)>>2) | (word_cling_64_16(f02[j2]<< 4)>>1) | (word_cling_64_16(f03[j2]<< 4)>>0); case 14: t[j+13] |= (word_cling_64_16(f00[j2]<< 8)>>3) | (word_cling_64_16(f01[j2]<< 8)>>2) | (word_cling_64_16(f02[j2]<< 8)>>1) | (word_cling_64_16(f03[j2]<< 8)>>0); case 13: t[j+12] |= (word_cling_64_16(f00[j2]<<12)>>3) | (word_cling_64_16(f01[j2]<<12)>>2) | (word_cling_64_16(f02[j2]<<12)>>1) | (word_cling_64_16(f03[j2]<<12)>>0); case 12: t[j+11] |= (word_cling_64_16(f00[j2]<<16)>>3) | (word_cling_64_16(f01[j2]<<16)>>2) | (word_cling_64_16(f02[j2]<<16)>>1) | (word_cling_64_16(f03[j2]<<16)>>0); case 11: t[j+10] |= (word_cling_64_16(f00[j2]<<20)>>3) | (word_cling_64_16(f01[j2]<<20)>>2) | (word_cling_64_16(f02[j2]<<20)>>1) | (word_cling_64_16(f03[j2]<<20)>>0); case 10: t[j+ 9] |= (word_cling_64_16(f00[j2]<<24)>>3) | (word_cling_64_16(f01[j2]<<24)>>2) | (word_cling_64_16(f02[j2]<<24)>>1) | (word_cling_64_16(f03[j2]<<24)>>0); case 9: t[j+ 8] |= (word_cling_64_16(f00[j2]<<28)>>3) | (word_cling_64_16(f01[j2]<<28)>>2) | (word_cling_64_16(f02[j2]<<28)>>1) | (word_cling_64_16(f03[j2]<<28)>>0); case 8: t[j+ 7] |= (word_cling_64_16(f00[j2]<<32)>>3) | (word_cling_64_16(f01[j2]<<32)>>2) | (word_cling_64_16(f02[j2]<<32)>>1) | (word_cling_64_16(f03[j2]<<32)>>0); case 7: t[j+ 6] |= (word_cling_64_16(f00[j2]<<36)>>3) | (word_cling_64_16(f01[j2]<<36)>>2) | (word_cling_64_16(f02[j2]<<36)>>1) | (word_cling_64_16(f03[j2]<<36)>>0); case 6: t[j+ 5] |= (word_cling_64_16(f00[j2]<<40)>>3) | (word_cling_64_16(f01[j2]<<40)>>2) | (word_cling_64_16(f02[j2]<<40)>>1) | (word_cling_64_16(f03[j2]<<40)>>0); case 5: t[j+ 4] |= (word_cling_64_16(f00[j2]<<44)>>3) | (word_cling_64_16(f01[j2]<<44)>>2) | (word_cling_64_16(f02[j2]<<44)>>1) | (word_cling_64_16(f03[j2]<<44)>>0); case 4: t[j+ 3] |= (word_cling_64_16(f00[j2]<<48)>>3) | (word_cling_64_16(f01[j2]<<48)>>2) | (word_cling_64_16(f02[j2]<<48)>>1) | (word_cling_64_16(f03[j2]<<48)>>0); case 3: t[j+ 2] |= (word_cling_64_16(f00[j2]<<52)>>3) | (word_cling_64_16(f01[j2]<<52)>>2) | (word_cling_64_16(f02[j2]<<52)>>1) | (word_cling_64_16(f03[j2]<<52)>>0); case 2: t[j+ 1] |= (word_cling_64_16(f00[j2]<<56)>>3) | (word_cling_64_16(f01[j2]<<56)>>2) | (word_cling_64_16(f02[j2]<<56)>>1) | (word_cling_64_16(f03[j2]<<56)>>0); case 1: t[j+ 0] |= (word_cling_64_16(f00[j2]<<60)>>3) | (word_cling_64_16(f01[j2]<<60)>>2) | (word_cling_64_16(f02[j2]<<60)>>1) | (word_cling_64_16(f03[j2]<<60)>>0); break; default: m4ri_die("impossible"); } t[T->x->width-1] = (t[T->x->width-1] & bitmask_end) | (tmp & ~bitmask_end); } } break; } } } return T; } m4rie-20200125/m4rie/mzd_slice_intro.inl0000644000175000017500000000161713206144356014631 00000000000000#define matrix_t mzd_slice_t #define matrix_set_ui mzd_slice_set_ui #define matrix_write_elem mzd_slice_write_elem #define matrix_init_window mzd_slice_init_window #define matrix_free_window mzd_slice_free_window #define matrix_addmul mzd_slice_addmul #define matrix_apply_p_right mzd_slice_apply_p_right #define matrix_trsm_lower_left mzd_slice_trsm_lower_left #define _matrix_trsm_lower_left _mzd_slice_trsm_lower_left #define matrix_trsm_lower_left_naive mzd_slice_trsm_lower_left_naive #define matrix_trsm_lower_left_newton_john mzd_slice_trsm_lower_left_newton_john #define matrix_trsm_upper_left mzd_slice_trsm_upper_left #define _matrix_trsm_upper_left _mzd_slice_trsm_upper_left #define matrix_trsm_upper_left_naive mzd_slice_trsm_upper_left_naive #define matrix_trsm_upper_left_newton_john mzd_slice_trsm_upper_left_newton_john #define matrix_ple mzd_slice_ple #define matrix_pluq mzd_slice_pluq m4rie-20200125/m4rie/mzd_slice_outro.inl0000644000175000017500000000074313206144356014645 00000000000000#undef matrix_t #undef matrix_set_ui #undef matrix_write_elem #undef matrix_init_window #undef matrix_free_window #undef matrix_addmul #undef matrix_apply_p_right #undef matrix_trsm_lower_left #undef _matrix_trsm_lower_left #undef matrix_trsm_lower_left_naive #undef matrix_trsm_lower_left_newton_john #undef matrix_trsm_upper_left #undef _matrix_trsm_upper_left #undef matrix_trsm_upper_left_naive #undef matrix_trsm_upper_left_newton_john #undef matrix_ple #undef matrix_pluq m4rie-20200125/m4rie/mzed_intro.inl0000644000175000017500000000147213206144356013616 00000000000000#define matrix_t mzed_t #define matrix_set_ui mzed_set_ui #define matrix_write_elem mzed_write_elem #define matrix_init_window mzed_init_window #define matrix_free_window mzed_free_window #define matrix_addmul mzed_addmul #define matrix_apply_p_right mzed_apply_p_right #define matrix_trsm_lower_left mzed_trsm_lower_left #define _matrix_trsm_lower_left _mzed_trsm_lower_left #define matrix_trsm_lower_left_naive mzed_trsm_lower_left_naive #define matrix_trsm_lower_left_newton_john mzed_trsm_lower_left_newton_john #define matrix_trsm_upper_left mzed_trsm_upper_left #define _matrix_trsm_upper_left _mzed_trsm_upper_left #define matrix_trsm_upper_left_naive mzed_trsm_upper_left_naive #define matrix_trsm_upper_left_newton_john mzed_trsm_upper_left_newton_john #define matrix_ple mzed_ple #define matrix_pluq mzed_pluq m4rie-20200125/m4rie/mzed_outro.inl0000644000175000017500000000074413206144356013634 00000000000000#undef matrix_t #undef matrix_set_ui #undef matrix_write_elem #undef matrix_init_window #undef matrix_free_window #undef matrix_addmul #undef matrix_apply_p_right #undef matrix_trsm_lower_left #undef _matrix_trsm_lower_left #undef matrix_trsm_lower_left_naive #undef matrix_trsm_lower_left_newton_john #undef matrix_trsm_upper_left #undef _matrix_trsm_upper_left #undef matrix_trsm_upper_left_naive #undef matrix_trsm_upper_left_newton_john #undef matrix_ple #undef matrix_pluq m4rie-20200125/m4rie/trsm.inl0000644000175000017500000000552213206144356012431 00000000000000/** * \brief inline template for TRSM routines * \author Martin Albrecht * * \note We want to keep this library in C, hence we cannot use of C++ * templates. */ void _matrix_trsm_lower_left(const matrix_t *L, matrix_t *B, const rci_t cutoff) { assert((L->finite_field == B->finite_field) && (L->nrows == L->ncols) && (B->nrows == L->ncols)); if (L->nrows <= cutoff || B->ncols <= cutoff) { matrix_trsm_lower_left_newton_john(L,B); return; } /** \verbatim |\ ______ | \ | | | \ | B0 | |L00\ | | |____\ |______| | |\ | | | | \ | | | | \ | B1 | |L10 |L11\ | | |____|____\ |______| \endverbatim */ rci_t c = L->nrows/2; c = MAX((c - c%m4ri_radix),m4ri_radix); matrix_t *B0 = matrix_init_window(B, 0, 0, c, B->ncols); matrix_t *B1 = matrix_init_window(B, c, 0, B->nrows, B->ncols); const matrix_t *L00 = (const matrix_t*)matrix_init_window((matrix_t*)L, 0, 0, c, c); const matrix_t *L10 = (const matrix_t*)matrix_init_window((matrix_t*)L, c, 0, B->nrows, c); const matrix_t *L11 = (const matrix_t*)matrix_init_window((matrix_t*)L, c, c, B->nrows, B->nrows); _matrix_trsm_lower_left(L00, B0, cutoff); matrix_addmul(B1, L10, B0); _matrix_trsm_lower_left(L11, B1, cutoff); matrix_free_window(B0); matrix_free_window(B1); matrix_free_window((matrix_t*)L00); matrix_free_window((matrix_t*)L10); matrix_free_window((matrix_t*)L11); } void _matrix_trsm_upper_left(matrix_t const *U, matrix_t *B, const rci_t cutoff) { assert((U->finite_field == B->finite_field) && (U->nrows == U->ncols) && (B->nrows == U->ncols)); if (U->nrows <= cutoff || B->ncols <= cutoff) { matrix_trsm_upper_left_newton_john(U,B); return; } /** \verbatim __________ ______ \ U00| | | | \ |U01 | | | \ | | | B0 | \ | | | | \|____| |______| \ | | | \U11| | | \ | | B1 | \ | | | \| |______| \endverbatim */ rci_t c = U->nrows/2; c = MAX((c - c%m4ri_radix),m4ri_radix); matrix_t *B0 = matrix_init_window(B, 0, 0, c, B->ncols); matrix_t *B1 = matrix_init_window(B, c, 0, B->nrows, B->ncols); const matrix_t *U00 = (const matrix_t *)matrix_init_window(U, 0, 0, c, c); const matrix_t *U01 = (const matrix_t *)matrix_init_window(U, 0, c, c, B->nrows); const matrix_t *U11 = (const matrix_t *)matrix_init_window(U, c, c, B->nrows, B->nrows); _matrix_trsm_upper_left(U11, B1, cutoff); matrix_addmul(B0, U01, B1); _matrix_trsm_upper_left(U00, B0, cutoff); matrix_free_window(B0); matrix_free_window(B1); matrix_free_window((matrix_t*)U00); matrix_free_window((matrix_t*)U01); matrix_free_window((matrix_t*)U11); } m4rie-20200125/m4rie/Doxyfile0000644000175000017500000030727213206144356012455 00000000000000# Doxyfile 1.8.7 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = M4RIE # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = 0.20111004 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = ../doc/ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a # new page for each member. If set to NO, the documentation of a member will be # part of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = "GF2E=\f$\mathbb{F}_{2^e}\f$" \ "GF2=\f$\mathbb{F}_2\f$" \ "GF2X=\f$\mathbb{F}_2[x]\f$" \ " e=\f$e\f$" \ "GF4=\f$\mathbb{F}_{2^2}\f$" \ "GF8=\f$\mathbb{F}_{2^3}\f$" \ "GF16=\f$\mathbb{F}_{2^4}\f$" \ "GF32=\f$\mathbb{F}_{2^5}\f$" \ "GF64=\f$\mathbb{F}_{2^6}\f$" \ "GF128=\f$\mathbb{F}_{2^7}\f$" \ "GF256=\f$\mathbb{F}_{2^8}\f$" \ "GF512=\f$\mathbb{F}_{2^9}\f$" \ "GF1024=\f$\mathbb{F}_{2^10}\f$" \ "GF2048=\f$\mathbb{F}_{2^11}\f$" \ "GF4096=\f$\mathbb{F}_{2^12}\f$" \ "GF8192=\f$\mathbb{F}_{2^13}\f$" \ "GF16384=\f$\mathbb{F}_{2^14}\f$" \ "GF32768=\f$\mathbb{F}_{2^15}\f$" \ "GF65536=\f$\mathbb{F}_{2^16}\f$" # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by by putting a % sign in front of the word # or globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined # locally in source files will be included in the documentation. If set to NO # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO these classes will be included in the various overviews. This option has # no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the # todo list. This list is created by putting \todo commands in the # documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the # test list. This list is created by putting \test commands in the # documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES the list # will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. Do not use file names with spaces, bibtex cannot handle them. See # also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO doxygen will only warn about wrong or incomplete parameter # documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. # Note: If this tag is empty the current directory is searched. INPUT = # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank the # following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, # *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, # *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = config.h \ m4ri_functions.h # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = ../tests \ ../bench # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER ) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES, then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = NO # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefor more robust against future updates. # Doxygen will copy the style sheet file to the output directory. For an example # see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to NO can help when comparing the output of multiple runs. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = YES # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler ( hhc.exe). If non-empty # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated ( # YES) or that it should be included in the master .chm file ( NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated ( # YES) or a normal table of contents ( NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using prerendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /