From 3f15c30522fb1a391a25af2f693739f6955d072d Mon Sep 17 00:00:00 2001 From: jasonmoxham Date: Thu, 7 Apr 2011 14:19:31 +0000 Subject: [PATCH] make sure fat dir has every file in fat structure --- mpn/x86_64/add_n.as | 87 ----------------------- mpn/x86_64/addmul_1.asm | 145 -------------------------------------- mpn/x86_64/fat/add_n.c | 23 ++++++ mpn/x86_64/fat/addmul_1.c | 23 ++++++ mpn/x86_64/fat/copyd.c | 2 - mpn/x86_64/fat/copyi.c | 2 - mpn/x86_64/fat/lshift.c | 23 ++++++ mpn/x86_64/fat/mul_1.c | 23 ++++++ mpn/x86_64/fat/rshift.c | 23 ++++++ mpn/x86_64/fat/sub_n.c | 23 ++++++ mpn/x86_64/fat/submul_1.c | 23 ++++++ mpn/x86_64/lshift.as | 96 ------------------------- mpn/x86_64/mul_1.asm | 145 -------------------------------------- mpn/x86_64/rshift.asm | 139 ------------------------------------ mpn/x86_64/sub_n.as | 87 ----------------------- mpn/x86_64/submul_1.asm | 145 -------------------------------------- 16 files changed, 161 insertions(+), 848 deletions(-) delete mode 100644 mpn/x86_64/add_n.as delete mode 100644 mpn/x86_64/addmul_1.asm create mode 100644 mpn/x86_64/fat/add_n.c create mode 100644 mpn/x86_64/fat/addmul_1.c create mode 100644 mpn/x86_64/fat/lshift.c create mode 100644 mpn/x86_64/fat/mul_1.c create mode 100644 mpn/x86_64/fat/rshift.c create mode 100644 mpn/x86_64/fat/sub_n.c create mode 100644 mpn/x86_64/fat/submul_1.c delete mode 100644 mpn/x86_64/lshift.as delete mode 100644 mpn/x86_64/mul_1.asm delete mode 100644 mpn/x86_64/rshift.asm delete mode 100644 mpn/x86_64/sub_n.as delete mode 100644 mpn/x86_64/submul_1.asm diff --git a/mpn/x86_64/add_n.as b/mpn/x86_64/add_n.as deleted file mode 100644 index f4be711e..00000000 --- a/mpn/x86_64/add_n.as +++ /dev/null @@ -1,87 +0,0 @@ - -; AMD64 mpn_add_n -; Copyright 2008 Jason Moxham -; This file is part of the MPIR Library. -; The MPIR 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 MPIR 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 MPIR 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. - -; (rdi,rcx) = (rsi,rcx)+(rdx,rcx) -; rax = carry - -%include 'yasm_mac.inc' - - BITS 64 - - GLOBAL_FUNC mpn_add_n - mov rax, rcx - and rax, 3 - shr rcx, 2 - cmp rcx, 0 -; carry flag is clear here - jnz loop1 - mov r11, [rsi] - add r11, [rdx] - mov [rdi], r11 - dec rax - jz end1 - mov r11, [rsi+8] - adc r11, [rdx+8] - mov [rdi+8], r11 - dec rax - jz end1 - mov r11, [rsi+16] - adc r11, [rdx+16] - mov [rdi+16], r11 - dec rax -end1: - adc rax, rax - ret - align 8 -loop1 - mov r11, [rsi] - mov r8, [rsi+8] - lea rsi, [rsi+32] - adc r11, [rdx] - adc r8, [rdx+8] - lea rdx, [rdx+32] - mov [rdi], r11 - mov [rdi+8], r8 - lea rdi, [rdi+32] - mov r9, [rsi-16] - mov r10, [rsi-8] - adc r9, [rdx-16] - adc r10, [rdx-8] - mov [rdi-16], r9 - dec rcx - mov [rdi-8], r10 - jnz loop1 - inc rax - dec rax - jz end - mov r11, [rsi] - adc r11, [rdx] - mov [rdi], r11 - dec rax - jz end - mov r11, [rsi+8] - adc r11, [rdx+8] - mov [rdi+8], r11 - dec rax - jz end - mov r11, [rsi+16] - adc r11, [rdx+16] - mov [rdi+16], r11 - dec rax -end: - adc rax, rax - ret diff --git a/mpn/x86_64/addmul_1.asm b/mpn/x86_64/addmul_1.asm deleted file mode 100644 index b194cd6b..00000000 --- a/mpn/x86_64/addmul_1.asm +++ /dev/null @@ -1,145 +0,0 @@ -dnl mpn_addmul_1 - -dnl Copyright 2011 The Code Cavern - -dnl This file is part of the MPIR Library. - -dnl The MPIR Library is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU Lesser General Public License as published -dnl by the Free Software Foundation; either version 2.1 of the License, or (at -dnl your option) any later version. - -dnl The MPIR 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 Lesser General Public -dnl License for more details. - -dnl You should have received a copy of the GNU Lesser General Public License -dnl along with the MPIR Library; see the file COPYING.LIB. If not, write -dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -dnl Boston, MA 02110-1301, USA. - -include(`../config.m4') - -ASM_START() -PROLOGUE(mpn_addmul_1) -mov (%rsi),%rax -cmp $1,%rdx -je one -mov $5,%r11 -lea -40(%rsi,%rdx,8),%rsi -lea -40(%rdi,%rdx,8),%rdi -sub %rdx,%r11 -mul %rcx -.byte 0x26 -mov %rax,%r8 -.byte 0x26 -mov 8(%rsi,%r11,8),%rax -.byte 0x26 -mov %rdx,%r9 -.byte 0x26 -cmp $0,%r11 -.byte 0x26 -mov %r12,-8(%rsp) -.byte 0x26 -jge skiplp -lp: xor %r10,%r10 - mul %rcx - add %r8,(%rdi,%r11,8) - adc %rax,%r9 - adc %rdx,%r10 - mov 16(%rsi,%r11,8),%rax - mul %rcx - add %r9,8(%rdi,%r11,8) - adc %rax,%r10 - mov $0,%r12d - adc %rdx,%r12 - mov 24(%rsi,%r11,8),%rax - xor %r8,%r8 - xor %r9,%r9 - mul %rcx - add %r10,16(%rdi,%r11,8) - adc %rax,%r12 - adc %rdx,%r8 - mov 32(%rsi,%r11,8),%rax - mul %rcx - add %r12,24(%rdi,%r11,8) - adc %rax,%r8 - adc %rdx,%r9 - add $4,%r11 - mov 8(%rsi,%r11,8),%rax - jnc lp -skiplp: -xor %r10,%r10 -mul %rcx -add %r8,(%rdi,%r11,8) -adc %rax,%r9 -adc %rdx,%r10 -cmp $2,%r11 -ja case0 -jz case1 -jp case2 -case3: mov 16(%rsi),%rax - mul %rcx - add %r9,8(%rdi) - adc %rax,%r10 - mov $0,%r12d - adc %rdx,%r12 - mov 24(%rsi),%rax - xor %r8,%r8 - xor %r9,%r9 - mul %rcx - add %r10,16(%rdi) - adc %rax,%r12 - adc %rdx,%r8 - mov 32(%rsi),%rax - mul %rcx - add %r12,24(%rdi) - adc %rax,%r8 - adc %rdx,%r9 - add %r8,32(%rdi) - adc $0,%r9 - mov -8(%rsp),%r12 - mov %r9,%rax - ret -case2: mov 24(%rsi),%rax - mul %rcx - add %r9,16(%rdi) - adc %rax,%r10 - mov $0,%r12d - adc %rdx,%r12 - mov 32(%rsi),%rax - xor %r8,%r8 - #xor %r9,%r9 - mul %rcx - add %r10,24(%rdi) - adc %rax,%r12 - adc %rdx,%r8 - add %r12,32(%rdi) - adc $0,%r8 - mov -8(%rsp),%r12 - mov %r8,%rax - ret -ALIGN(16) -case1: mov 32(%rsi),%rax - mul %rcx - add %r9,24(%rdi) - adc %rax,%r10 - mov $0,%r12d - adc %rdx,%r12 - add %r10,32(%rdi) - adc $0,%r12 - mov %r12,%rax - mov -8(%rsp),%r12 - ret -one: mul %rcx - add %rax,(%rdi) - adc $0,%rdx - mov %rdx,%rax - ret -case0: add %r9,32(%rdi) - adc $0,%r10 - mov -8(%rsp),%r12 - mov %r10,%rax - ret -EPILOGUE() diff --git a/mpn/x86_64/fat/add_n.c b/mpn/x86_64/fat/add_n.c new file mode 100644 index 00000000..05f29c45 --- /dev/null +++ b/mpn/x86_64/fat/add_n.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_add_n + +Copyright 2011 Jason Moxham + +This file is part of the MPIR Library. + +The MPIR 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 MPIR 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/add_n.c" diff --git a/mpn/x86_64/fat/addmul_1.c b/mpn/x86_64/fat/addmul_1.c new file mode 100644 index 00000000..4e821cc3 --- /dev/null +++ b/mpn/x86_64/fat/addmul_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_addmul_1 + +Copyright 2011 Jason Moxham + +This file is part of the MPIR Library. + +The MPIR 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 MPIR 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/addmul_1.c" diff --git a/mpn/x86_64/fat/copyd.c b/mpn/x86_64/fat/copyd.c index 4c348363..26fab7e0 100644 --- a/mpn/x86_64/fat/copyd.c +++ b/mpn/x86_64/fat/copyd.c @@ -22,7 +22,5 @@ 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_64/fat/copyi.c b/mpn/x86_64/fat/copyi.c index 08e33c04..339f227d 100644 --- a/mpn/x86_64/fat/copyi.c +++ b/mpn/x86_64/fat/copyi.c @@ -22,7 +22,5 @@ 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_64/fat/lshift.c b/mpn/x86_64/fat/lshift.c new file mode 100644 index 00000000..5e89cf60 --- /dev/null +++ b/mpn/x86_64/fat/lshift.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_lshift + +Copyright 2011 Jason Moxham + +This file is part of the MPIR Library. + +The MPIR 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 MPIR 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/lshift.c" diff --git a/mpn/x86_64/fat/mul_1.c b/mpn/x86_64/fat/mul_1.c new file mode 100644 index 00000000..b7ee5107 --- /dev/null +++ b/mpn/x86_64/fat/mul_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_mul_1 + +Copyright 2011 Jason Moxham + +This file is part of the MPIR Library. + +The MPIR 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 MPIR 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_1.c" diff --git a/mpn/x86_64/fat/rshift.c b/mpn/x86_64/fat/rshift.c new file mode 100644 index 00000000..563dd4be --- /dev/null +++ b/mpn/x86_64/fat/rshift.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_rshift + +Copyright 2011 Jason Moxham + +This file is part of the MPIR Library. + +The MPIR 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 MPIR 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/rshift.c" diff --git a/mpn/x86_64/fat/sub_n.c b/mpn/x86_64/fat/sub_n.c new file mode 100644 index 00000000..c55f3334 --- /dev/null +++ b/mpn/x86_64/fat/sub_n.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_sub_n + +Copyright 2011 Jason Moxham + +This file is part of the MPIR Library. + +The MPIR 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 MPIR 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/sub_n.c" diff --git a/mpn/x86_64/fat/submul_1.c b/mpn/x86_64/fat/submul_1.c new file mode 100644 index 00000000..292c4412 --- /dev/null +++ b/mpn/x86_64/fat/submul_1.c @@ -0,0 +1,23 @@ +/* Fat binary fallback mpn_submul_1 + +Copyright 2011 Jason Moxham + +This file is part of the MPIR Library. + +The MPIR 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 MPIR 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/submul_1.c" diff --git a/mpn/x86_64/lshift.as b/mpn/x86_64/lshift.as deleted file mode 100644 index f39690c5..00000000 --- a/mpn/x86_64/lshift.as +++ /dev/null @@ -1,96 +0,0 @@ - -; AMD64 mpn_lshift -; Copyright 2008 Jason Moxham -; This file is part of the MPIR Library. -; The MPIR 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 MPIR 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 MPIR 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. - -; (rdi,rdx) = (rsi,rdx)<