From a89a14ef5da44684a16b204e7a70460cc8c4922a Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 21 Jun 2024 23:36:36 +0200 Subject: Basic constant folding implementation --- .../gmp-6.3.0/mpn/sparc64/ultrasparct1/add_n.asm | 68 +++++++++ .../mpn/sparc64/ultrasparct1/addlsh1_n.asm | 41 ++++++ .../mpn/sparc64/ultrasparct1/addlsh2_n.asm | 41 ++++++ .../mpn/sparc64/ultrasparct1/addlshC_n.asm | 69 +++++++++ .../mpn/sparc64/ultrasparct1/addmul_1.asm | 86 ++++++++++++ .../mpn/sparc64/ultrasparct1/gmp-mparam.h | 154 +++++++++++++++++++++ .../gmp-6.3.0/mpn/sparc64/ultrasparct1/mul_1.asm | 82 +++++++++++ .../mpn/sparc64/ultrasparct1/rsblsh1_n.asm | 41 ++++++ .../mpn/sparc64/ultrasparct1/rsblsh2_n.asm | 41 ++++++ .../mpn/sparc64/ultrasparct1/rsblshC_n.asm | 69 +++++++++ .../gmp-6.3.0/mpn/sparc64/ultrasparct1/sub_n.asm | 68 +++++++++ .../mpn/sparc64/ultrasparct1/sublsh1_n.asm | 41 ++++++ .../mpn/sparc64/ultrasparct1/sublsh2_n.asm | 41 ++++++ .../mpn/sparc64/ultrasparct1/sublshC_n.asm | 69 +++++++++ .../mpn/sparc64/ultrasparct1/submul_1.asm | 86 ++++++++++++ 15 files changed, 997 insertions(+) create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/add_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlshC_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addmul_1.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/gmp-mparam.h create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/mul_1.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sub_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublshC_n.asm create mode 100644 vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/submul_1.asm (limited to 'vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1') diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/add_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/add_n.asm new file mode 100644 index 0000000..954c7f6 --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/add_n.asm @@ -0,0 +1,68 @@ +dnl SPARC v9 mpn_add_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + +C cycles/limb +C UltraSPARC T1: ? +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%o0') +define(`up', `%o1') +define(`vp', `%o2') +define(`n', `%o3') +define(`cy', `%o4') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(mpn_add_nc) + b,a L(ent) +EPILOGUE() +PROLOGUE(mpn_add_n) + mov 0, cy +L(ent): cmp %g0, cy +L(top): ldx [up+0], %o4 + add up, 8, up + ldx [vp+0], %o5 + add vp, 8, vp + add rp, 8, rp + add n, -1, n + srlx %o4, 32, %g1 + srlx %o5, 32, %g2 + addccc %o4, %o5, %g3 + addccc %g1, %g2, %g0 + brgz n, L(top) + stx %g3, [rp-8] + + retl + addc %g0, %g0, %o0 +EPILOGUE() diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm new file mode 100644 index 0000000..3134797 --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm @@ -0,0 +1,41 @@ +dnl SPARC v9 mpn_addlsh1_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + + +define(LSH, 1) +define(RSH, 63) + +define(func, mpn_addlsh1_n) + +MULFUNC_PROLOGUE(mpn_addlsh1_n) + +include_mpn(`sparc64/ultrasparct1/addlshC_n.asm') diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm new file mode 100644 index 0000000..ee1afd0 --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm @@ -0,0 +1,41 @@ +dnl SPARC v9 mpn_addlsh2_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + + +define(LSH, 2) +define(RSH, 62) + +define(func, mpn_addlsh2_n) + +MULFUNC_PROLOGUE(mpn_addlsh2_n) + +include_mpn(`sparc64/ultrasparct1/addlshC_n.asm') diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlshC_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlshC_n.asm new file mode 100644 index 0000000..5be9a0d --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addlshC_n.asm @@ -0,0 +1,69 @@ +dnl SPARC v9 mpn_addlshC_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +C cycles/limb +C UltraSPARC T1: 21 +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%o0') +define(`up', `%o1') +define(`vp', `%o2') +define(`n', `%o3') +define(`cy', `%o4') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(func) + mov 0, cy + mov 0, %g5 + cmp %g0, cy +L(top): ldx [up+0], %o4 + add up, 8, up + ldx [vp+0], %o5 + add vp, 8, vp + add rp, 8, rp + + sllx %o5, LSH, %g4 + add n, -1, n + or %g5, %g4, %g4 + srlx %o5, RSH, %g5 + + srlx %o4, 32, %g1 + srlx %g4, 32, %g2 + addccc %o4, %g4, %g3 + addccc %g1, %g2, %g0 + brgz n, L(top) + stx %g3, [rp-8] + + retl + addc %g5, %g0, %o0 +EPILOGUE() diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addmul_1.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addmul_1.asm new file mode 100644 index 0000000..29dba96 --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/addmul_1.asm @@ -0,0 +1,86 @@ +dnl SPARC v9 mpn_addmul_1 for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + +C cycles/limb +C UltraSPARC T1: 74 +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%i0') +define(`up', `%i1') +define(`n', `%i2') +define(`v0', `%i3') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(mpn_addmul_1) + save %sp, -176, %sp + mov 1, %o2 + mov %i0, %g2 + srlx %i3, 32, %o4 + sllx %o2, 32, %o2 + srl %i3, 0, %i3 + mov 0, %g3 + mov 0, %i0 + +L(top): ldx [%i1+%g3], %g1 + srl %g1, 0, %g4 + mulx %g4, %i3, %o5 + srlx %g1, 32, %g1 + mulx %g1, %i3, %g5 + mulx %g4, %o4, %g4 + mulx %g1, %o4, %g1 + srlx %o5, 32, %o1 + add %g5, %o1, %o1 + addcc %o1, %g4, %g4 + srl %o5, 0, %o0 + ldx [%g2+%g3], %o5 + sllx %g4, 32, %o1 + add %g1, %o2, %l1 + movlu %xcc, %l1, %g1 + add %o1, %o0, %l0 + addcc %l0, %i0, %g5 + srlx %g4, 32, %i0 + add %i0, 1, %g4 + movlu %xcc, %g4, %i0 + addcc %o5, %g5, %g5 + stx %g5, [%g2+%g3] + add %i0, 1, %g4 + movlu %xcc, %g4, %i0 + add %i2, -1, %i2 + add %i0, %g1, %i0 + brnz,pt %i2, L(top) + add %g3, 8, %g3 + return %i7+8 + nop +EPILOGUE() diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/gmp-mparam.h b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/gmp-mparam.h new file mode 100644 index 0000000..99db78a --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/gmp-mparam.h @@ -0,0 +1,154 @@ +/* Sparc64 gmp-mparam.h -- Compiler/machine parameter header file. + +Copyright 1991, 1993, 1994, 1999-2002, 2004, 2006, 2008-2010 Free Software +Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of either: + + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at your + option) any later version. + +or + + * the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any + later version. + +or both in parallel, as here. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received copies of the GNU General Public License and the +GNU Lesser General Public License along with the GNU MP Library. If not, +see https://www.gnu.org/licenses/. */ + +#define GMP_LIMB_BITS 64 +#define GMP_LIMB_BYTES 8 + +/* 1000 MHz ultrasparc t1 running GNU/Linux */ + +#define DIVREM_1_NORM_THRESHOLD 0 /* always */ +#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */ +#define MOD_1_1P_METHOD 2 +#define MOD_1_NORM_THRESHOLD 0 /* always */ +#define MOD_1_UNNORM_THRESHOLD 0 /* always */ +#define MOD_1N_TO_MOD_1_1_THRESHOLD 13 +#define MOD_1U_TO_MOD_1_1_THRESHOLD MP_SIZE_T_MAX +#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */ +#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */ +#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 34 +#define USE_PREINV_DIVREM_1 1 +#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */ +#define DIVEXACT_1_THRESHOLD 0 /* always */ +#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */ + +#define MUL_TOOM22_THRESHOLD 8 +#define MUL_TOOM33_THRESHOLD 50 +#define MUL_TOOM44_THRESHOLD 99 +#define MUL_TOOM6H_THRESHOLD 125 +#define MUL_TOOM8H_THRESHOLD 187 + +#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65 +#define MUL_TOOM32_TO_TOOM53_THRESHOLD 77 +#define MUL_TOOM42_TO_TOOM53_THRESHOLD 65 +#define MUL_TOOM42_TO_TOOM63_THRESHOLD 50 +#define MUL_TOOM43_TO_TOOM54_THRESHOLD 34 + +#define SQR_BASECASE_THRESHOLD 0 /* always */ +#define SQR_TOOM2_THRESHOLD 14 +#define SQR_TOOM3_THRESHOLD 57 +#define SQR_TOOM4_THRESHOLD 133 +#define SQR_TOOM6_THRESHOLD 156 +#define SQR_TOOM8_THRESHOLD 260 + +#define MULMID_TOOM42_THRESHOLD 12 + +#define MULMOD_BNM1_THRESHOLD 7 +#define SQRMOD_BNM1_THRESHOLD 7 + +#define MUL_FFT_MODF_THRESHOLD 176 /* k = 5 */ +#define MUL_FFT_TABLE3 \ + { { 176, 5}, { 7, 6}, { 4, 5}, { 9, 6}, \ + { 5, 5}, { 11, 6}, { 11, 7}, { 6, 6}, \ + { 13, 7}, { 7, 6}, { 15, 7}, { 9, 8}, \ + { 5, 7}, { 13, 8}, { 7, 7}, { 15, 6}, \ + { 32, 7}, { 24, 8}, { 21, 9}, { 11, 8}, \ + { 23,10}, { 7, 9}, { 15, 8}, { 33, 9}, \ + { 19, 8}, { 39, 9}, { 23,10}, { 15, 9}, \ + { 43,10}, { 23,11}, { 15,10}, { 31, 9}, \ + { 63, 8}, { 127, 9}, { 67,10}, { 39, 9}, \ + { 79, 8}, { 159,10}, { 47, 9}, { 95,11}, \ + { 2048,12}, { 4096,13}, { 8192,14}, { 16384,15}, \ + { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \ + { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \ + {8388608,24} } +#define MUL_FFT_TABLE3_SIZE 53 +#define MUL_FFT_THRESHOLD 1728 + + +#define SQR_FFT_MODF_THRESHOLD 148 /* k = 5 */ +#define SQR_FFT_TABLE3 \ + { { 148, 5}, { 7, 6}, { 4, 5}, { 9, 6}, \ + { 5, 5}, { 11, 6}, { 11, 7}, { 6, 6}, \ + { 13, 7}, { 7, 6}, { 15, 7}, { 13, 8}, \ + { 7, 7}, { 16, 8}, { 9, 6}, { 38, 7}, \ + { 20, 8}, { 11, 7}, { 24, 8}, { 13, 9}, \ + { 7, 7}, { 30, 8}, { 19, 9}, { 11, 8}, \ + { 25,10}, { 7, 9}, { 15, 8}, { 31, 9}, \ + { 19, 8}, { 39, 9}, { 27,10}, { 15, 9}, \ + { 39,10}, { 23, 9}, { 47, 8}, { 95, 9}, \ + { 51,11}, { 15,10}, { 31, 8}, { 127,10}, \ + { 39, 9}, { 79, 8}, { 159,10}, { 47, 9}, \ + { 95,11}, { 2048,12}, { 4096,13}, { 8192,14}, \ + { 16384,15}, { 32768,16}, { 65536,17}, { 131072,18}, \ + { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \ + {4194304,23}, {8388608,24} } +#define SQR_FFT_TABLE3_SIZE 58 +#define SQR_FFT_THRESHOLD 1344 + +#define MULLO_BASECASE_THRESHOLD 0 /* always */ +#define MULLO_DC_THRESHOLD 28 +#define MULLO_MUL_N_THRESHOLD 3176 + +#define DC_DIV_QR_THRESHOLD 27 +#define DC_DIVAPPR_Q_THRESHOLD 106 +#define DC_BDIV_QR_THRESHOLD 27 +#define DC_BDIV_Q_THRESHOLD 62 + +#define INV_MULMOD_BNM1_THRESHOLD 14 +#define INV_NEWTON_THRESHOLD 163 +#define INV_APPR_THRESHOLD 117 + +#define BINV_NEWTON_THRESHOLD 166 +#define REDC_1_TO_REDC_N_THRESHOLD 31 + +#define MU_DIV_QR_THRESHOLD 734 +#define MU_DIVAPPR_Q_THRESHOLD 748 +#define MUPI_DIV_QR_THRESHOLD 67 +#define MU_BDIV_QR_THRESHOLD 562 +#define MU_BDIV_Q_THRESHOLD 734 + +#define POWM_SEC_TABLE 4,29,188,643,2741 + +#define MATRIX22_STRASSEN_THRESHOLD 11 +#define HGCD_THRESHOLD 58 +#define HGCD_APPR_THRESHOLD 55 +#define HGCD_REDUCE_THRESHOLD 637 +#define GCD_DC_THRESHOLD 186 +#define GCDEXT_DC_THRESHOLD 140 +#define JACOBI_BASE_METHOD 3 + +#define GET_STR_DC_THRESHOLD 20 +#define GET_STR_PRECOMPUTE_THRESHOLD 33 +#define SET_STR_DC_THRESHOLD 268 +#define SET_STR_PRECOMPUTE_THRESHOLD 960 + +#define FAC_DSC_THRESHOLD 268 +#define FAC_ODD_THRESHOLD 0 /* always */ diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/mul_1.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/mul_1.asm new file mode 100644 index 0000000..1fea2a1 --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/mul_1.asm @@ -0,0 +1,82 @@ +dnl SPARC v9 mpn_mul_1 for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + +C cycles/limb +C UltraSPARC T1: 68 +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%i0') +define(`up', `%i1') +define(`n', `%i2') +define(`v0', `%i3') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(mpn_mul_1) + save %sp, -176, %sp + mov 1, %o2 + mov %i0, %g2 + srlx %i3, 32, %o4 + sllx %o2, 32, %o2 + srl %i3, 0, %i3 + mov 0, %g3 + mov 0, %i0 + +L(top): ldx [%i1+%g3], %g1 + srl %g1, 0, %g4 + mulx %g4, %i3, %o5 + srlx %g1, 32, %g1 + mulx %g1, %i3, %g5 + mulx %g4, %o4, %g4 + mulx %g1, %o4, %g1 + srlx %o5, 32, %o1 + add %g5, %o1, %o1 + addcc %o1, %g4, %g4 + srl %o5, 0, %o0 + sllx %g4, 32, %o1 + add %g1, %o2, %l1 + movlu %xcc, %l1, %g1 + add %o1, %o0, %l0 + addcc %l0, %i0, %g5 + srlx %g4, 32, %i0 + add %i0, 1, %g4 + movlu %xcc, %g4, %i0 + stx %g5, [%g2+%g3] + add %i2, -1, %i2 + add %i0, %g1, %i0 + brnz,pt %i2, L(top) + add %g3, 8, %g3 + return %i7+8 + nop +EPILOGUE() diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm new file mode 100644 index 0000000..51bd4ab --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm @@ -0,0 +1,41 @@ +dnl SPARC v9 mpn_rsblsh1_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + + +define(LSH, 1) +define(RSH, 63) + +define(func, mpn_rsblsh1_n) + +MULFUNC_PROLOGUE(mpn_rsblsh1_n) + +include_mpn(`sparc64/ultrasparct1/rsblshC_n.asm') diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm new file mode 100644 index 0000000..f0d208e --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm @@ -0,0 +1,41 @@ +dnl SPARC v9 mpn_rsblsh2_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + + +define(LSH, 2) +define(RSH, 62) + +define(func, mpn_rsblsh2_n) + +MULFUNC_PROLOGUE(mpn_rsblsh2_n) + +include_mpn(`sparc64/ultrasparct1/rsblshC_n.asm') diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm new file mode 100644 index 0000000..7c03e9f --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm @@ -0,0 +1,69 @@ +dnl SPARC v9 mpn_rsblshC_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +C cycles/limb +C UltraSPARC T1: 21 +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%o0') +define(`up', `%o1') +define(`vp', `%o2') +define(`n', `%o3') +define(`cy', `%o4') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(func) + mov 0, cy + mov 0, %g5 + cmp %g0, cy +L(top): ldx [up+0], %o4 + add up, 8, up + ldx [vp+0], %o5 + add vp, 8, vp + add rp, 8, rp + + sllx %o5, LSH, %g4 + add n, -1, n + or %g5, %g4, %g4 + srlx %o5, RSH, %g5 + + srlx %o4, 32, %g1 + srlx %g4, 32, %g2 + subccc %g4, %o4, %g3 + subccc %g2, %g1, %g0 + brgz n, L(top) + stx %g3, [rp-8] + + retl + subc %g5, %g0, %o0 +EPILOGUE() diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sub_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sub_n.asm new file mode 100644 index 0000000..c2af89f --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sub_n.asm @@ -0,0 +1,68 @@ +dnl SPARC v9 mpn_sub_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + +C cycles/limb +C UltraSPARC T1: ? +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%o0') +define(`up', `%o1') +define(`vp', `%o2') +define(`n', `%o3') +define(`cy', `%o4') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(mpn_sub_nc) + b,a L(ent) +EPILOGUE() +PROLOGUE(mpn_sub_n) + mov 0, cy +L(ent): cmp %g0, cy +L(top): ldx [up+0], %o4 + add up, 8, up + ldx [vp+0], %o5 + add vp, 8, vp + add rp, 8, rp + add n, -1, n + srlx %o4, 32, %g1 + srlx %o5, 32, %g2 + subccc %o4, %o5, %g3 + subccc %g1, %g2, %g0 + brgz n, L(top) + stx %g3, [rp-8] + + retl + addc %g0, %g0, %o0 +EPILOGUE() diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm new file mode 100644 index 0000000..8c8fa80 --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm @@ -0,0 +1,41 @@ +dnl SPARC v9 mpn_sublsh1_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + + +define(LSH, 1) +define(RSH, 63) + +define(func, mpn_sublsh1_n) + +MULFUNC_PROLOGUE(mpn_sublsh1_n) + +include_mpn(`sparc64/ultrasparct1/sublshC_n.asm') diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm new file mode 100644 index 0000000..2fd5eee --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm @@ -0,0 +1,41 @@ +dnl SPARC v9 mpn_sublsh2_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + + +define(LSH, 2) +define(RSH, 62) + +define(func, mpn_sublsh2_n) + +MULFUNC_PROLOGUE(mpn_sublsh2_n) + +include_mpn(`sparc64/ultrasparct1/sublshC_n.asm') diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublshC_n.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublshC_n.asm new file mode 100644 index 0000000..01eafef --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/sublshC_n.asm @@ -0,0 +1,69 @@ +dnl SPARC v9 mpn_sublshC_n for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +C cycles/limb +C UltraSPARC T1: 21 +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%o0') +define(`up', `%o1') +define(`vp', `%o2') +define(`n', `%o3') +define(`cy', `%o4') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(func) + mov 0, cy + mov 0, %g5 + cmp %g0, cy +L(top): ldx [up+0], %o4 + add up, 8, up + ldx [vp+0], %o5 + add vp, 8, vp + add rp, 8, rp + + sllx %o5, LSH, %g4 + add n, -1, n + or %g5, %g4, %g4 + srlx %o5, RSH, %g5 + + srlx %o4, 32, %g1 + srlx %g4, 32, %g2 + subccc %o4, %g4, %g3 + subccc %g1, %g2, %g0 + brgz n, L(top) + stx %g3, [rp-8] + + retl + addc %g5, %g0, %o0 +EPILOGUE() diff --git a/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/submul_1.asm b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/submul_1.asm new file mode 100644 index 0000000..4f553a8 --- /dev/null +++ b/vendor/gmp-6.3.0/mpn/sparc64/ultrasparct1/submul_1.asm @@ -0,0 +1,86 @@ +dnl SPARC v9 mpn_submul_1 for T1/T2. + +dnl Copyright 2010 Free Software Foundation, Inc. + +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 modify +dnl it under the terms of either: +dnl +dnl * the GNU Lesser General Public License as published by the Free +dnl Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl or +dnl +dnl * the GNU General Public License as published by the Free Software +dnl Foundation; either version 2 of the License, or (at your option) any +dnl later version. +dnl +dnl or both in parallel, as here. +dnl +dnl The GNU MP Library is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received copies of the GNU General Public License and the +dnl GNU Lesser General Public License along with the GNU MP Library. If not, +dnl see https://www.gnu.org/licenses/. + +include(`../config.m4') + +C cycles/limb +C UltraSPARC T1: 74 +C UltraSPARC T2: ? + +C INPUT PARAMETERS +define(`rp', `%i0') +define(`up', `%i1') +define(`n', `%i2') +define(`v0', `%i3') + +ASM_START() + REGISTER(%g2,#scratch) + REGISTER(%g3,#scratch) +PROLOGUE(mpn_submul_1) + save %sp, -176, %sp + mov 1, %o2 + mov %i0, %g2 + srlx %i3, 32, %o4 + sllx %o2, 32, %o2 + srl %i3, 0, %i3 + mov 0, %g3 + mov 0, %i0 + +L(top): ldx [%i1+%g3], %g1 + srl %g1, 0, %g4 + mulx %g4, %i3, %o5 + srlx %g1, 32, %g1 + mulx %g1, %i3, %g5 + mulx %g4, %o4, %g4 + mulx %g1, %o4, %g1 + srlx %o5, 32, %o1 + add %g5, %o1, %o1 + addcc %o1, %g4, %g4 + srl %o5, 0, %o0 + ldx [%g2+%g3], %o5 + sllx %g4, 32, %o1 + add %g1, %o2, %l1 + movlu %xcc, %l1, %g1 + add %o1, %o0, %l0 + addcc %l0, %i0, %g5 + srlx %g4, 32, %i0 + add %i0, 1, %g4 + movlu %xcc, %g4, %i0 + subcc %o5, %g5, %g5 + stx %g5, [%g2+%g3] + add %i0, 1, %g4 + movlu %xcc, %g4, %i0 + add %i2, -1, %i2 + add %i0, %g1, %i0 + brnz,pt %i2, L(top) + add %g3, 8, %g3 + return %i7+8 + nop +EPILOGUE() -- cgit v1.2.3