From c832f01b9aca0b4d5db3d9abb64d8d47d623405f Mon Sep 17 00:00:00 2001 From: jasonmoxham Date: Sun, 24 Oct 2010 10:09:33 +0000 Subject: [PATCH] copy x86_64/fat to x86_64w/fat --- mpn/x86_64w/fat/copyd.c | 28 +++ mpn/x86_64w/fat/copyi.c | 28 +++ mpn/x86_64w/fat/divexact_1.c | 23 +++ mpn/x86_64w/fat/divexact_by3c.c | 23 +++ mpn/x86_64w/fat/divexact_byfobm1.c | 23 +++ mpn/x86_64w/fat/divrem_1.c | 23 +++ mpn/x86_64w/fat/divrem_2.c | 23 +++ mpn/x86_64w/fat/divrem_euclidean_qr_1.c | 23 +++ mpn/x86_64w/fat/divrem_euclidean_qr_2.c | 23 +++ mpn/x86_64w/fat/fat.c | 234 ++++++++++++++++++++++++ mpn/x86_64w/fat/fat_entry.asm | 224 +++++++++++++++++++++++ mpn/x86_64w/fat/gcd_1.c | 23 +++ mpn/x86_64w/fat/gmp-mparam.h | 77 ++++++++ mpn/x86_64w/fat/mod_1.c | 23 +++ mpn/x86_64w/fat/mod_34lsub1.c | 23 +++ mpn/x86_64w/fat/modexact_1c_odd.c | 23 +++ mpn/x86_64w/fat/mul_basecase.c | 23 +++ mpn/x86_64w/fat/preinv_divrem_1.c | 23 +++ mpn/x86_64w/fat/preinv_mod_1.c | 23 +++ mpn/x86_64w/fat/redc_basecase.c | 23 +++ mpn/x86_64w/fat/sqr_basecase.c | 23 +++ mpn/x86_64w/fat/sumdiff_n.c | 23 +++ 22 files changed, 982 insertions(+) create mode 100644 mpn/x86_64w/fat/copyd.c create mode 100644 mpn/x86_64w/fat/copyi.c create mode 100644 mpn/x86_64w/fat/divexact_1.c create mode 100644 mpn/x86_64w/fat/divexact_by3c.c create mode 100644 mpn/x86_64w/fat/divexact_byfobm1.c create mode 100644 mpn/x86_64w/fat/divrem_1.c create mode 100644 mpn/x86_64w/fat/divrem_2.c create mode 100644 mpn/x86_64w/fat/divrem_euclidean_qr_1.c create mode 100644 mpn/x86_64w/fat/divrem_euclidean_qr_2.c create mode 100644 mpn/x86_64w/fat/fat.c create mode 100644 mpn/x86_64w/fat/fat_entry.asm create mode 100644 mpn/x86_64w/fat/gcd_1.c create mode 100644 mpn/x86_64w/fat/gmp-mparam.h create mode 100644 mpn/x86_64w/fat/mod_1.c create mode 100644 mpn/x86_64w/fat/mod_34lsub1.c create mode 100644 mpn/x86_64w/fat/modexact_1c_odd.c create mode 100644 mpn/x86_64w/fat/mul_basecase.c create mode 100644 mpn/x86_64w/fat/preinv_divrem_1.c create mode 100644 mpn/x86_64w/fat/preinv_mod_1.c create mode 100644 mpn/x86_64w/fat/redc_basecase.c create mode 100644 mpn/x86_64w/fat/sqr_basecase.c create mode 100644 mpn/x86_64w/fat/sumdiff_n.c diff --git a/mpn/x86_64w/fat/copyd.c b/mpn/x86_64w/fat/copyd.c new file mode 100644 index 00000000..4c348363 --- /dev/null +++ b/mpn/x86_64w/fat/copyd.c @@ -0,0 +1,28 @@ +/* Fat binary fallback mpn_copyd + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + +#include "mpir.h" +#include "gmp-impl.h" + +//#ifndef mpn_copyd +void mpn_copyd(mp_ptr rp,mp_srcptr sp,mp_size_t n) +{MPN_COPY_DECR(rp,sp,n);return;} +//#endif diff --git a/mpn/x86_64w/fat/copyi.c b/mpn/x86_64w/fat/copyi.c new file mode 100644 index 00000000..08e33c04 --- /dev/null +++ b/mpn/x86_64w/fat/copyi.c @@ -0,0 +1,28 @@ +/* Fat binary fallback mpn_copyi + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + +#include "mpir.h" +#include "gmp-impl.h" + +//#ifndef mpn_copyi +void mpn_copyi(mp_ptr rp,mp_srcptr sp,mp_size_t n) +{MPN_COPY_INCR(rp,sp,n);return;} +//#endif diff --git a/mpn/x86_64w/fat/divexact_1.c b/mpn/x86_64w/fat/divexact_1.c new file mode 100644 index 00000000..6579e171 --- /dev/null +++ b/mpn/x86_64w/fat/divexact_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_divexact_1. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/divexact_1.c" diff --git a/mpn/x86_64w/fat/divexact_by3c.c b/mpn/x86_64w/fat/divexact_by3c.c new file mode 100644 index 00000000..a02fdaae --- /dev/null +++ b/mpn/x86_64w/fat/divexact_by3c.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_diveby3. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/divexact_by3c.c" diff --git a/mpn/x86_64w/fat/divexact_byfobm1.c b/mpn/x86_64w/fat/divexact_byfobm1.c new file mode 100644 index 00000000..be669ef1 --- /dev/null +++ b/mpn/x86_64w/fat/divexact_byfobm1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_divexact_fobm1 + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/divexact_byfobm1.c" diff --git a/mpn/x86_64w/fat/divrem_1.c b/mpn/x86_64w/fat/divrem_1.c new file mode 100644 index 00000000..78cacfa0 --- /dev/null +++ b/mpn/x86_64w/fat/divrem_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_divrem_1. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/divrem_1.c" diff --git a/mpn/x86_64w/fat/divrem_2.c b/mpn/x86_64w/fat/divrem_2.c new file mode 100644 index 00000000..bd87c1c0 --- /dev/null +++ b/mpn/x86_64w/fat/divrem_2.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_divrem_2. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/divrem_2.c" diff --git a/mpn/x86_64w/fat/divrem_euclidean_qr_1.c b/mpn/x86_64w/fat/divrem_euclidean_qr_1.c new file mode 100644 index 00000000..f3d52b43 --- /dev/null +++ b/mpn/x86_64w/fat/divrem_euclidean_qr_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_divrem_euclidean_qr_1 + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/divrem_euclidean_qr_1.c" diff --git a/mpn/x86_64w/fat/divrem_euclidean_qr_2.c b/mpn/x86_64w/fat/divrem_euclidean_qr_2.c new file mode 100644 index 00000000..d165b71f --- /dev/null +++ b/mpn/x86_64w/fat/divrem_euclidean_qr_2.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_divrem_euclidean_qr_2 + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/divrem_euclidean_qr_2.c" diff --git a/mpn/x86_64w/fat/fat.c b/mpn/x86_64w/fat/fat.c new file mode 100644 index 00000000..ab0f3f48 --- /dev/null +++ b/mpn/x86_64w/fat/fat.c @@ -0,0 +1,234 @@ +/* x86 fat binary initializers. + + THE FUNCTIONS AND VARIABLES IN THIS FILE ARE FOR INTERNAL USE ONLY. + THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR + COMPLETELY IN FUTURE GNU MP RELEASES. + +Copyright 2003, 2004 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + +#include /* for printf */ +#include /* for getenv */ +#include + +#include "mpir.h" +#include "gmp-impl.h" + +/* Change this to "#define TRACE(x) x" for some traces. */ +#define TRACE(x) + +/* Change this to 1 to take the cpuid from GMP_CPU_TYPE env var. */ +#define WANT_FAKE_CPUID 0 + + +/* fat_entry.asm */ +long __gmpn_cpuid __GMP_PROTO ((char dst[12], int id)); +int __gmpn_cpuid_available __GMP_PROTO ((void)); + + + +#if WANT_FAKE_CPUID +/* The "name"s in the table are values for the GMP_CPU_TYPE environment + variable. Anything can be used, but for now it's the canonical cpu types + as per config.guess/config.sub. */ + +#define __gmpn_cpuid fake_cpuid +#define __gmpn_cpuid_available fake_cpuid_available + +#define MAKE_FMS(family, model) \ + (((family) << 8) + ((model << 4))) + +static struct { + const char *name; + const char vendor[13]; + unsigned fms; +} fake_cpuid_table[] = { + { "i386", "" }, + { "i486", "GenuineIntel", MAKE_FMS (4, 0) }, + { "pentium", "GenuineIntel", MAKE_FMS (5, 0) }, + { "pentiummmx", "GenuineIntel", MAKE_FMS (5, 4) }, + { "pentiumpro", "GenuineIntel", MAKE_FMS (6, 0) }, + { "pentium2", "GenuineIntel", MAKE_FMS (6, 2) }, + { "pentium3", "GenuineIntel", MAKE_FMS (6, 7) }, + { "pentium4", "GenuineIntel", MAKE_FMS (7, 0) }, + + { "k5", "AuthenticAMD", MAKE_FMS (5, 0) }, + { "k6", "AuthenticAMD", MAKE_FMS (5, 3) }, + { "k62", "AuthenticAMD", MAKE_FMS (5, 8) }, + { "k63", "AuthenticAMD", MAKE_FMS (5, 9) }, + { "athlon", "AuthenticAMD", MAKE_FMS (6, 0) }, + { "x86_64", "AuthenticAMD", MAKE_FMS (15, 0) }, + + { "viac3", "CentaurHauls", MAKE_FMS (6, 0) }, + { "viac32", "CentaurHauls", MAKE_FMS (6, 9) }, +}; + +static int +fake_cpuid_lookup (void) +{ + char *s; + int i; + + s = getenv ("GMP_CPU_TYPE"); + if (s == NULL) + { + printf ("Need GMP_CPU_TYPE environment variable for fake cpuid\n"); + abort (); + } + + for (i = 0; i < numberof (fake_cpuid_table); i++) + if (strcmp (s, fake_cpuid_table[i].name) == 0) + return i; + + printf ("GMP_CPU_TYPE=%s unknown\n", s); + abort (); +} + +static int +fake_cpuid_available (void) +{ + return fake_cpuid_table[fake_cpuid_lookup()].vendor[0] != '\0'; +} + +static long +fake_cpuid (char dst[12], int id) +{ + int i = fake_cpuid_lookup(); + + switch (id) { + case 0: + memcpy (dst, fake_cpuid_table[i].vendor, 12); + return 0; + case 1: + return fake_cpuid_table[i].fms; + default: + printf ("fake_cpuid(): oops, unknown id %d\n", id); + abort (); + } +} +#endif + + +typedef DECL_preinv_divrem_1 ((*preinv_divrem_1_t)); +typedef DECL_preinv_mod_1 ((*preinv_mod_1_t)); + +struct cpuvec_t __gmpn_cpuvec = { + __MPN(add_n_init), + __MPN(addmul_1_init), + __MPN(copyd_init), + __MPN(copyi_init), + __MPN(divexact_1_init), + __MPN(divexact_by3c_init), + __MPN(divexact_byfobm1_init), + __MPN(divrem_1_init), + __MPN(divrem_2_init), + __MPN(divrem_euclidean_qr_1_init), + __MPN(divrem_euclidean_qr_2_init), + __MPN(gcd_1_init), + __MPN(lshift_init), + __MPN(mod_1_init), + __MPN(mod_34lsub1_init), + __MPN(modexact_1c_odd_init), + __MPN(mul_1_init), + __MPN(mul_basecase_init), + __MPN(preinv_divrem_1_init), + __MPN(preinv_mod_1_init), + __MPN(redc_basecase_init), + __MPN(rshift_init), + __MPN(sqr_basecase_init), + __MPN(sub_n_init), + __MPN(submul_1_init), + __MPN(sumdiff_n_init), + 0 +}; + + +/* The following setups start with generic x86, then overwrite with + specifics for a chip, and higher versions of that chip. + + The arrangement of the setups here will normally be the same as the $path + selections in configure.in for the respective chips. + + This code is reentrant and thread safe. We always calculate the same + decided_cpuvec, so if two copies of the code are running it doesn't + matter which completes first, both write the same to __gmpn_cpuvec. + + We need to go via decided_cpuvec because if one thread has completed + __gmpn_cpuvec then it may be making use of the threshold values in that + vector. If another thread is still running __gmpn_cpuvec_init then we + don't want it to write different values to those fields since some of the + asm routines only operate correctly up to their own defined threshold, + not an arbitrary value. */ + +void +__gmpn_cpuvec_init (void) +{ + struct cpuvec_t decided_cpuvec; + + TRACE (printf ("__gmpn_cpuvec_init:\n")); + + memset (&decided_cpuvec, '\0', sizeof (decided_cpuvec)); + + CPUVEC_SETUP_x86_64; + CPUVEC_SETUP_fat; + + if (! __gmpn_cpuid_available ()) + { + TRACE (printf (" 80386, or early 80486 without cpuid\n")); + } + else + { + +#define CONFIG_GUESS 0 +#define CONFIG_GUESS_32BIT 0 +#define CONFIG_GUESS_64BIT 0 +#define FAT32 0 +#define FAT64 1 +#define INFAT 1 + +#define CPUSETUP_core2 CPUVEC_SETUP_core2 +#define CPUSETUP_penryn CPUVEC_SETUP_core2;CPUVEC_SETUP_core2_penryn +#define CPUSETUP_nehalem CPUVEC_SETUP_nehalem +#define CPUSETUP_westmere CPUVEC_SETUP_nehalem;CPUVEC_SETUP_nehalem_westmere +#define CPUSETUP_atom CPUVEC_SETUP_atom +#define CPUSETUP_nano CPUVEC_SETUP_nano +#define CPUSETUP_netburst CPUVEC_SETUP_netburst +#define CPUSETUP_netburstlahf CPUVEC_SETUP_netburst;CPUVEC_SETUP_netburst_netburstlahf +#define CPUSETUP_k8 CPUVEC_SETUP_k8;CPUVEC_SETUP_k8_k8only +#define CPUSETUP_k10 CPUVEC_SETUP_k8;CPUVEC_SETUP_k8_k10 +#define CPUSETUP_k102 CPUVEC_SETUP_k8;CPUVEC_SETUP_k8_k10;CPUVEC_SETUP_k8_k10_k102 + +#include "cpuid.c" + + } + /* There's no x86 generic mpn_preinv_divrem_1 or mpn_preinv_mod_1. + Instead default to the plain versions from whichever CPU we detected. + The function arguments are compatible, no need for any glue code. */ + if (decided_cpuvec.preinv_divrem_1 == NULL) + decided_cpuvec.preinv_divrem_1 =(preinv_divrem_1_t)decided_cpuvec.divrem_1; + if (decided_cpuvec.preinv_mod_1 == NULL) + decided_cpuvec.preinv_mod_1 =(preinv_mod_1_t) decided_cpuvec.mod_1; + + ASSERT_CPUVEC (decided_cpuvec); + CPUVEC_INSTALL (decided_cpuvec); + + /* Set this once the threshold fields are ready. + Use volatile to prevent it getting moved. */ + ((volatile struct cpuvec_t *) &__gmpn_cpuvec)->initialized = 1; +} diff --git a/mpn/x86_64w/fat/fat_entry.asm b/mpn/x86_64w/fat/fat_entry.asm new file mode 100644 index 00000000..8734315a --- /dev/null +++ b/mpn/x86_64w/fat/fat_entry.asm @@ -0,0 +1,224 @@ +dnl x86 fat binary entrypoints. + +dnl Copyright 2003 Free Software Foundation, Inc. +dnl +dnl This file is part of the GNU MP Library. +dnl +dnl The GNU MP Library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public License as +dnl published by the Free Software Foundation; either version 2.1 of the +dnl License, or (at your option) any later version. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with the GNU MP Library; see the file COPYING.LIB. If +dnl not, write to the Free Software Foundation, Inc., 51 Franklin Street, +dnl Fifth Floor, Boston, MA 02110-1301, USA. + +include(`../config.m4') + + +dnl Forcibly disable profiling. +dnl +dnl The entrypoints and inits are small enough not to worry about, the real +dnl routines arrived at will have any profiling. Also, the way the code +dnl here ends with a jump means we won't work properly with the +dnl "instrument" profiling scheme anyway. + +define(`WANT_PROFILING',no) + + + TEXT + + +dnl Usage: FAT_ENTRY(name, offset) +dnl +dnl Emit a fat binary entrypoint function of the given name. This is the +dnl normal entry for applications, eg. __gmpn_add_n. +dnl +dnl The code simply jumps through the function pointer in __gmpn_cpuvec at +dnl the given "offset" (in bytes). +dnl +dnl For non-PIC, the jumps are 5 bytes each, aligning them to 8 should be +dnl fine for all x86s. +dnl +dnl For PIC, the jumps are 20 bytes each, and are best aligned to 16 to +dnl ensure at least the first two instructions don't cross a cache line +dnl boundary. +dnl +dnl Note the extra `' ahead of PROLOGUE obscures it from the HAVE_NATIVE +dnl grepping in configure, stopping that code trying to eval something with +dnl $1 in it. + +define(FAT_ENTRY, +m4_assert_numargs(2) +` ALIGN(ifdef(`PIC',16,8)) +`'PROLOGUE($1) +ifdef(`PIC', +` call L(movl_eip_edx) +L(entry_here$2): + addq $_GLOBAL_OFFSET_TABLE_+[.-L(entry_here$2)], %r11 + movq GSYM_PREFIX`'__gmpn_cpuvec@GOT(%r11), %r11 + jmp *m4_empty_if_zero($2)(%r11) +',`dnl non-PIC + jmp *GSYM_PREFIX`'__gmpn_cpuvec+$2 +') +EPILOGUE() +') + + +dnl FAT_ENTRY for each CPUVEC_FUNCS_LIST +dnl + +define(`CPUVEC_offset',0) +foreach(i, +`FAT_ENTRY(MPN(i),CPUVEC_offset) +define(`CPUVEC_offset',eval(CPUVEC_offset + 8))', +CPUVEC_FUNCS_LIST) + +ifdef(`PIC',` + ALIGN(8) +L(movl_eip_edx): + movq (%rsp), %r11 + ret_internal +') + + +dnl Usage: FAT_INIT(name, offset) +dnl +dnl Emit a fat binary initializer function of the given name. These +dnl functions are the initial values for the pointers in __gmpn_cpuvec. +dnl +dnl The code simply calls __gmpn_cpuvec_init, and then jumps back through +dnl the __gmpn_cpuvec pointer, at the given "offset" (in bytes). +dnl __gmpn_cpuvec_init will have stored the address of the selected +dnl implementation there. +dnl +dnl Only one of these routines will be executed, and only once, since after +dnl that all the __gmpn_cpuvec pointers go to real routines. So there's no +dnl need for anything special here, just something small and simple. To +dnl keep code size down, "fat_init" is a shared bit of code, arrived at +dnl with the offset in %al. %al is used since the movb instruction is 2 +dnl bytes where %eax would be 4. +dnl +dnl Note having `PROLOGUE in FAT_INIT obscures that PROLOGUE from the +dnl HAVE_NATIVE grepping in configure, preventing that code trying to eval +dnl something with $1 in it. + +define(FAT_INIT, +m4_assert_numargs(2) +`PROLOGUE($1) + pushq %rax + pushq %rbx + pushq %rsi + pushq %rdi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp + +ifdef(`PIC',` + call L(movl_eip_ebx) +L(init_here$2): + addq $_GLOBAL_OFFSET_TABLE_+[.-L(init_here$2)], %rbx + call GSYM_PREFIX`'__gmpn_cpuvec_init@PLT + movq GSYM_PREFIX`'__gmpn_cpuvec@GOT(%rbx), %r11 + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rdi + popq %rsi + popq %rbx + popq %rax + jmp *m4_empty_if_zero($2)(%r11) + +',`dnl non-PIC + call GSYM_PREFIX`'__gmpn_cpuvec_init + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rdi + popq %rsi + popq %rbx + popq %rax + jmp *GSYM_PREFIX`'__gmpn_cpuvec+$2 +') +EPILOGUE() +') + +L(movl_eip_ebx): + movq (%rsp), %rbx + ret_internal + + +dnl FAT_INIT for each CPUVEC_FUNCS_LIST +dnl + +define(`CPUVEC_offset',0) +foreach(i, +`FAT_INIT(MPN(i`'_init),CPUVEC_offset) +define(`CPUVEC_offset',eval(CPUVEC_offset + 8))', +CPUVEC_FUNCS_LIST) + + + +C long __gmpn_cpuid (char dst[12], int id); +C +C This is called only once, so just something simple and compact is fine. + +defframe(PARAM_ID, 8) +defframe(PARAM_DST, 4) +deflit(`FRAME',0) + +PROLOGUE(__gmpn_cpuid) + pushq %rbx FRAME_pushq() + movq %rsi, %rax + cpuid + movl %ebx, (%rdi) + movl %edx, 4(%rdi) + movl %ecx, 8(%rdi) + popq %rbx + ret +EPILOGUE() + + +C int __gmpn_cpuid_available (void); +C +C Return non-zero if the cpuid instruction is available, which means late +C model 80486 and higher. 80386 and early 80486 don't have cpuid. +C +C The test follows Intel AP-485 application note, namely that if bit 21 is +C modifiable then cpuid is supported. This test is reentrant and thread +C safe, since of course any interrupt or context switch will preserve the +C flags while we're tinkering with them. +C +C This is called only once, so just something simple and compact is fine. + +PROLOGUE(__gmpn_cpuid_available) + pushf + popq %rcx C old flags + + movq %rcx, %rdx + xorq $0x200000, %rdx + pushq %rdx + popf + pushf + popq %rdx C tweaked flags + + movq $1, %rax + cmpq %rcx, %rdx + jne L(available) + xorq %rax, %rax C not changed, so cpuid not available + +L(available): + ret +EPILOGUE() diff --git a/mpn/x86_64w/fat/gcd_1.c b/mpn/x86_64w/fat/gcd_1.c new file mode 100644 index 00000000..52ac9418 --- /dev/null +++ b/mpn/x86_64w/fat/gcd_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_gcd_1. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/gcd_1.c" diff --git a/mpn/x86_64w/fat/gmp-mparam.h b/mpn/x86_64w/fat/gmp-mparam.h new file mode 100644 index 00000000..ea84f36a --- /dev/null +++ b/mpn/x86_64w/fat/gmp-mparam.h @@ -0,0 +1,77 @@ +/* Fat binary x86 gmp-mparam.h -- Compiler/machine parameter header file. + +Copyright 1991, 1993, 1994, 2000, 2001, 2002, 2003 Free Software Foundation, +Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + +#define BITS_PER_MP_LIMB 64 +#define BYTES_PER_MP_LIMB 8 + + +/* mpn_divexact_1 is faster than mpn_divrem_1 at all sizes. The only time + this might not be true currently is for actual 80386 and 80486 chips, + where mpn/x86/dive_1.asm might be slower than mpn/x86/divrem_1.asm, but + that's not worth worrying about. */ +#define DIVEXACT_1_THRESHOLD 0 + +/* Only some of the x86s have an mpn_preinv_divrem_1, but we set + USE_PREINV_DIVREM_1 so that all callers use it, and then let the + __gmpn_cpuvec pointer go to plain mpn_divrem_1 if there's not an actual + preinv. */ +#define USE_PREINV_DIVREM_1 1 + +/* mpn_sqr_basecase is faster than mpn_mul_basecase at all sizes, no need + for mpn_sqr_n to call the latter. */ +#define SQR_BASECASE_THRESHOLD 0 + +/* Sensible fallbacks for these, when not taken from a cpu-specific + gmp-mparam.h. */ +#define MUL_KARATSUBA_THRESHOLD 20 +#define MUL_TOOM3_THRESHOLD 130 +#define MUL_TOOM4_THRESHOLD 426 +#define MUL_TOOM7_THRESHOLD 507 +#define SQR_KARATSUBA_THRESHOLD 30 +#define SQR_TOOM3_THRESHOLD 200 +#define SQR_TOOM4_THRESHOLD 662 +#define SQR_TOOM7_THRESHOLD 1300 + +/* These are values more or less in the middle of what the typical x86 chips + come out as. For a fat binary it's necessary to have values for these, + since the defaults for MUL_FFT_TABLE and SQR_FFT_TABLE otherwise come out + as non-constant array initializers. FIXME: Perhaps these should be done + in the cpuvec structure like other thresholds. */ +#define MUL_FFT_TABLE { 464, 1056, 3264, 3840, 7168, 28672, 114688, 327680, 0 } +#define MUL_FFT_MODF_THRESHOLD 496 +#define MUL_FFT_THRESHOLD 5888 + +#define SQR_FFT_TABLE { 688, 928, 2752, 3328, 7168, 28672, 114688, 327680, 0 } +#define SQR_FFT_MODF_THRESHOLD 688 +#define SQR_FFT_THRESHOLD 4864 + +#define MUL_FFT_TABLE2 {{1, 3}, {205, 4}, {377, 5}, {386, 4}, {404, 5}, {813, 6}, {850, 5}, {869, 6}, {971, 5}, {993, 6}, {2392, 7}, {2445, 6}, {2668, 7}, {2727, 6}, {2787, 7}, {2976, 6}, {3042, 7}, {3109, 6}, {3178, 7}, {3248, 8}, {3393, 7}, {3468, 8}, {3544, 7}, {3784, 8}, {3867, 6}, {3952, 7}, {4039, 8}, {4407, 7}, {4504, 8}, {4914, 7}, {5022, 8}, {6957, 9}, {7756, 8}, {8460, 9}, {8836, 8}, {9030, 9}, {9850, 8}, {10513, 9}, {11976, 8}, {12239, 9}, {13939, 8}, {14245, 9}, {15876, 8}, {16224, 9}, {22461, 10}, {23970, 9}, {26142, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {33906, 10}, {36184, 9}, {36977, 10}, {40326, 9}, {41210, 10}, {44943, 11}, {45928, 10}, {46934, 11}, {47962, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {73983, 11}, {80681, 10}, {86099, 11}, {98051, 10}, {102394, 11}, {114110, 12}, {127165, 11}, {164920, 12}, {196129, 11}, {228243, 12}, {233241, 13}, {254354, 12}, {259924, 11}, {277377, 12}, {456509, 13}, {519871, 12}, {659749, 13}, {784582, 14}, {MP_SIZE_T_MAX,0}} + +#define MUL_FFTM_TABLE2 {{1, 4}, {344, 5}, {360, 4}, {377, 5}, {743, 6}, {777, 5}, {813, 6}, {850, 5}, {869, 6}, {1612, 7}, {1685, 6}, {1760, 7}, {1922, 6}, {2009, 7}, {3867, 6}, {3952, 7}, {4504, 8}, {4603, 7}, {4808, 8}, {4914, 7}, {5022, 8}, {5132, 7}, {5360, 8}, {5478, 7}, {5598, 8}, {6518, 9}, {6661, 8}, {7266, 9}, {9850, 8}, {10066, 9}, {14876, 10}, {15535, 9}, {18480, 10}, {19722, 9}, {21047, 10}, {21508, 9}, {22461, 10}, {23970, 9}, {25032, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {32468, 10}, {36184, 9}, {36977, 10}, {44943, 11}, {47962, 10}, {52305, 11}, {55819, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {67840, 11}, {72397, 10}, {73983, 11}, {80681, 10}, {82448, 11}, {114110, 12}, {127165, 11}, {147989, 12}, {161386, 11}, {172223, 12}, {196129, 11}, {204813, 12}, {228243, 13}, {254354, 12}, {259924, 11}, {265616, 12}, {329862, 13}, {392279, 12}, {456509, 13}, {466506, 14}, {508731, 13}, {519871, 12}, {554776, 13}, {913042, 14}, {MP_SIZE_T_MAX,0}} + +#define SQR_FFT_TABLE2 {{1, 4}, {344, 5}, {360, 4}, {377, 5}, {386, 4}, {404, 5}, {813, 6}, {850, 5}, {869, 6}, {2144, 7}, {2191, 6}, {2289, 7}, {2340, 6}, {2392, 7}, {2445, 6}, {2499, 7}, {2610, 6}, {2668, 7}, {2727, 8}, {2849, 7}, {3248, 8}, {3393, 7}, {3784, 8}, {3867, 6}, {4039, 7}, {4128, 8}, {6957, 9}, {7756, 8}, {8460, 9}, {8836, 8}, {9030, 9}, {9850, 8}, {10066, 9}, {11976, 8}, {12239, 9}, {13939, 10}, {14876, 9}, {15876, 8}, {16224, 9}, {18084, 10}, {19722, 9}, {22461, 10}, {23970, 9}, {26142, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {32468, 10}, {36184, 9}, {36977, 10}, {44943, 11}, {47962, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {73983, 11}, {80681, 10}, {86099, 11}, {114110, 12}, {127165, 11}, {164920, 12}, {196129, 11}, {213882, 12}, {218566, 13}, {254354, 12}, {259924, 11}, {277377, 12}, {456509, 13}, {519871, 12}, {659749, 13}, {784582, 14}, {MP_SIZE_T_MAX,0}} + +#define SQR_FFTM_TABLE2 {{1, 4}, {306, 5}, {328, 4}, {344, 5}, {360, 4}, {377, 5}, {680, 6}, {711, 5}, {743, 6}, {777, 5}, {813, 6}, {1476, 7}, {1543, 6}, {1612, 7}, {1685, 6}, {1760, 7}, {3867, 6}, {3952, 7}, {4312, 8}, {4407, 7}, {4504, 8}, {4704, 7}, {4808, 8}, {4914, 7}, {5022, 8}, {5132, 7}, {5360, 8}, {5478, 7}, {5598, 8}, {6518, 9}, {6661, 8}, {7266, 9}, {14876, 10}, {15535, 9}, {16944, 10}, {17696, 9}, {18084, 10}, {19722, 9}, {21047, 10}, {21508, 9}, {22461, 10}, {23970, 9}, {24495, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {32468, 10}, {44943, 11}, {47962, 10}, {52305, 11}, {55819, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {67840, 11}, {72397, 10}, {73983, 11}, {80681, 10}, {82448, 11}, {89912, 12}, {91881, 11}, {93893, 12}, {95949, 11}, {114110, 12}, {127165, 11}, {147989, 12}, {161386, 11}, {172223, 12}, {228243, 13}, {254354, 12}, {329862, 13}, {392279, 12}, {456509, 13}, {466506, 14}, {508731, 13}, {519871, 12}, {554776, 13}, {913042, 14}, {MP_SIZE_T_MAX,0}} + +#define MUL_FFT_FULL_TABLE2 {{16, 1}, {1092, 2}, {1116, 1}, {1811, 2}, {1851, 1}, {2066, 4}, {2112, 1}, {2207, 2}, {2256, 1}, {2462, 2}, {2516, 1}, {2572, 2}, {2629, 1}, {2869, 2}, {2932, 1}, {3343, 4}, {3417, 1}, {3648, 4}, {3728, 1}, {3894, 2}, {4068, 3}, {4158, 2}, {4440, 5}, {4638, 4}, {4844, 1}, {4951, 4}, {5060, 3}, {5171, 2}, {5401, 4}, {5520, 2}, {5765, 4}, {6154, 2}, {6568, 3}, {6712, 2}, {6859, 1}, {7010, 4}, {7482, 1}, {7814, 4}, {7986, 6}, {8161, 4}, {8710, 6}, {9096, 5}, {9296, 1}, {10140, 3}, {10363, 2}, {10590, 1}, {10822, 4}, {11059, 2}, {11302, 1}, {11803, 4}, {12327, 1}, {13155, 3}, {13444, 1}, {14040, 2}, {14348, 1}, {15993, 2}, {16344, 1}, {17068, 2}, {17824, 1}, {18215, 3}, {18614, 1}, {20300, 3}, {20745, 1}, {22140, 2}, {22625, 1}, {23628, 2}, {24146, 4}, {25216, 1}, {25769, 3}, {26911, 1}, {32708, 2}, {33425, 1}, {36452, 4}, {38901, 1}, {40624, 3}, {41514, 1}, {44303, 2}, {47280, 4}, {50456, 1}, {52691, 3}, {53845, 1}, {57462, 4}, {61321, 1}, {62664, 2}, {64037, 1}, {65440, 2}, {66873, 5}, {68338, 8}, {69835, 4}, {71365, 6}, {72928, 5}, {74525, 4}, {79530, 1}, {81272, 3}, {83052, 1}, {84871, 3}, {86730, 1}, {88630, 2}, {94582, 1}, {96654, 2}, {98771, 4}, {100934, 6}, {103145, 9}, {107713, 5}, {110072, 1}, {114947, 4}, {122667, 1}, {130905, 2}, {145881, 5}, {149076, 6}, {152341, 4}, {155677, 1}, {162570, 3}, {166130, 1}, {169768, 3}, {173486, 1}, {177285, 2}, {197567, 4}, {206315, 3}, {215450, 1}, {261830, 2}, {267564, 5}, {273423, 8}, {279411, 9}, {291783, 7}, {298173, 6}, {304703, 4}, {325163, 3}, {346997, 2}, {395159, 4}, {403812, 7}, {412655, 10}, {430925, 8}, {440362, 6}, {450005, 5}, {469929, 1}, {523686, 2}, {583592, 5}, {596372, 6}, {609431, 4}, {650350, 3}, {694016, 2}, {790340, 1}, {MP_SIZE_T_MAX,0}} + +#define SQR_FFT_FULL_TABLE2 {{16, 2}, {1022, 1}, {1045, 2}, {1068, 1}, {1092, 2}, {1116, 1}, {1219, 2}, {1274, 1}, {1811, 2}, {1851, 1}, {1934, 2}, {1977, 1}, {2066, 2}, {2112, 1}, {2207, 2}, {2256, 1}, {2462, 2}, {2516, 1}, {2572, 2}, {2629, 1}, {3343, 4}, {3417, 1}, {3894, 2}, {4068, 3}, {4158, 2}, {4440, 5}, {4740, 4}, {4844, 1}, {4951, 3}, {5171, 2}, {5401, 4}, {5520, 2}, {5765, 4}, {6154, 6}, {6289, 2}, {6427, 4}, {6568, 3}, {6712, 4}, {7482, 1}, {7814, 4}, {7986, 6}, {8161, 4}, {8710, 2}, {8901, 5}, {9296, 1}, {9922, 2}, {10140, 3}, {10363, 2}, {10590, 1}, {10822, 4}, {11059, 1}, {11803, 4}, {12597, 1}, {12873, 2}, {13155, 3}, {13444, 1}, {14040, 4}, {14348, 2}, {14663, 4}, {14985, 1}, {15993, 2}, {16344, 1}, {17068, 2}, {17824, 1}, {18215, 3}, {18614, 1}, {20300, 3}, {20745, 1}, {22140, 2}, {22625, 1}, {23628, 2}, {24146, 4}, {24675, 1}, {25769, 3}, {26911, 1}, {28720, 2}, {29349, 4}, {29992, 1}, {32007, 2}, {33425, 1}, {34905, 2}, {35670, 1}, {36452, 4}, {37251, 1}, {40624, 3}, {41514, 1}, {44303, 2}, {45274, 1}, {47280, 4}, {50456, 1}, {52691, 3}, {53845, 1}, {57462, 2}, {60007, 4}, {61321, 1}, {62664, 2}, {64037, 1}, {65440, 2}, {66873, 5}, {68338, 8}, {69835, 7}, {71365, 8}, {72928, 5}, {74525, 6}, {76157, 4}, {79530, 1}, {81272, 3}, {83052, 1}, {84871, 3}, {86730, 1}, {88630, 2}, {94582, 4}, {96654, 2}, {98771, 4}, {100934, 6}, {103145, 9}, {107713, 5}, {112483, 1}, {114947, 4}, {122667, 1}, {130905, 2}, {142755, 5}, {145881, 7}, {149076, 6}, {152341, 4}, {155677, 1}, {159086, 4}, {162570, 3}, {166130, 2}, {169768, 3}, {173486, 2}, {197567, 4}, {206315, 3}, {215450, 1}, {261830, 2}, {267564, 5}, {273423, 8}, {279411, 9}, {291783, 7}, {298173, 6}, {304703, 4}, {325163, 3}, {346997, 2}, {395159, 4}, {403812, 7}, {412655, 10}, {430925, 6}, {450005, 5}, {469929, 1}, {523686, 2}, {583592, 5}, {596372, 6}, {609431, 4}, {650350, 3}, {694016, 2}, {790340, 1}, {MP_SIZE_T_MAX,0}} diff --git a/mpn/x86_64w/fat/mod_1.c b/mpn/x86_64w/fat/mod_1.c new file mode 100644 index 00000000..242a0b4c --- /dev/null +++ b/mpn/x86_64w/fat/mod_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_mod_1. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/mod_1.c" diff --git a/mpn/x86_64w/fat/mod_34lsub1.c b/mpn/x86_64w/fat/mod_34lsub1.c new file mode 100644 index 00000000..ae8919e8 --- /dev/null +++ b/mpn/x86_64w/fat/mod_34lsub1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_mod_34lsub1. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/mod_34lsub1.c" diff --git a/mpn/x86_64w/fat/modexact_1c_odd.c b/mpn/x86_64w/fat/modexact_1c_odd.c new file mode 100644 index 00000000..cbeb3221 --- /dev/null +++ b/mpn/x86_64w/fat/modexact_1c_odd.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_modexact_1c_odd. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/modexact_1c_odd.c" diff --git a/mpn/x86_64w/fat/mul_basecase.c b/mpn/x86_64w/fat/mul_basecase.c new file mode 100644 index 00000000..f9b4f832 --- /dev/null +++ b/mpn/x86_64w/fat/mul_basecase.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_mul_basecase + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/mul_basecase.c" diff --git a/mpn/x86_64w/fat/preinv_divrem_1.c b/mpn/x86_64w/fat/preinv_divrem_1.c new file mode 100644 index 00000000..ede0da63 --- /dev/null +++ b/mpn/x86_64w/fat/preinv_divrem_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_pre_divrem_1. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/preinv_divrem_1.c" diff --git a/mpn/x86_64w/fat/preinv_mod_1.c b/mpn/x86_64w/fat/preinv_mod_1.c new file mode 100644 index 00000000..87725cf1 --- /dev/null +++ b/mpn/x86_64w/fat/preinv_mod_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_pre_mod_1. + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/preinv_mod_1.c" diff --git a/mpn/x86_64w/fat/redc_basecase.c b/mpn/x86_64w/fat/redc_basecase.c new file mode 100644 index 00000000..849f8f1d --- /dev/null +++ b/mpn/x86_64w/fat/redc_basecase.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_redc_basecase + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/redc_basecase.c" diff --git a/mpn/x86_64w/fat/sqr_basecase.c b/mpn/x86_64w/fat/sqr_basecase.c new file mode 100644 index 00000000..dfe8e755 --- /dev/null +++ b/mpn/x86_64w/fat/sqr_basecase.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_sqr_basecase + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/sqr_basecase.c" diff --git a/mpn/x86_64w/fat/sumdiff_n.c b/mpn/x86_64w/fat/sumdiff_n.c new file mode 100644 index 00000000..000defda --- /dev/null +++ b/mpn/x86_64w/fat/sumdiff_n.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_sumdiff_n + +Copyright 2003 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. */ + + +#include "mpn/generic/sumdiff_n.c"