[Gmp-commit] /var/hg/gmp: 4 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Thu Jun 13 22:16:43 UTC 2019
details: /var/hg/gmp/rev/6d0ec1f54c4c
changeset: 17769:6d0ec1f54c4c
user: Torbjorn Granlund <tg at gmplib.org>
date: Fri Jun 14 00:11:43 2019 +0200
description:
* longlong.h (mips64): Provide r6 asm code as default expression yields
libcall.
details: /var/hg/gmp/rev/7f320dbf960d
changeset: 17770:7f320dbf960d
user: Torbjorn Granlund <tg at gmplib.org>
date: Fri Jun 14 00:12:08 2019 +0200
description:
* configure.ac (mips64): Use separate paths for r6 and non-r6 as these
architectures are mutually incompatible.
details: /var/hg/gmp/rev/1cfbd47b7d36
changeset: 17771:1cfbd47b7d36
user: Torbjorn Granlund <tg at gmplib.org>
date: Fri Jun 14 00:13:46 2019 +0200
description:
Move code which uses hi and lo registers into hilo subdir.
details: /var/hg/gmp/rev/0aa90be6fadc
changeset: 17772:0aa90be6fadc
user: Torbjorn Granlund <tg at gmplib.org>
date: Fri Jun 14 00:16:39 2019 +0200
description:
ChangeLog
diffstat:
ChangeLog | 11 ++++
configure.ac | 14 ++++-
longlong.h | 12 +++-
mpn/mips64/addmul_1.asm | 101 ---------------------------------------
mpn/mips64/hilo/addmul_1.asm | 101 +++++++++++++++++++++++++++++++++++++++
mpn/mips64/hilo/mul_1.asm | 92 +++++++++++++++++++++++++++++++++++
mpn/mips64/hilo/sqr_diagonal.asm | 77 +++++++++++++++++++++++++++++
mpn/mips64/hilo/submul_1.asm | 101 +++++++++++++++++++++++++++++++++++++++
mpn/mips64/hilo/umul.asm | 45 +++++++++++++++++
mpn/mips64/mul_1.asm | 92 -----------------------------------
mpn/mips64/sqr_diagonal.asm | 77 -----------------------------
mpn/mips64/submul_1.asm | 101 ---------------------------------------
mpn/mips64/umul.asm | 45 -----------------
13 files changed, 449 insertions(+), 420 deletions(-)
diffs (truncated from 949 to 300 lines):
diff -r 695951e4b643 -r 0aa90be6fadc ChangeLog
--- a/ChangeLog Tue May 28 21:55:58 2019 +0200
+++ b/ChangeLog Fri Jun 14 00:16:39 2019 +0200
@@ -1,3 +1,14 @@
+2019-06-14 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h (mips64): Provide r6 asm code as default expression yields
+ libcall.
+
+ * configure.ac (mips64): Use separate paths for r6 and non-r6 as these
+ architectures are mutually incompatible.
+
+ * mpn/mips64/{addmul_1,mul_1,sqr_diagonal,submul_1,umul}.asm:
+ Move into hilo subdir.
+
2019-04-20 Niels Möller <nisse at lysator.liu.se>
* doc/gmp.texi (References): Link to paper on subquadratic GCD.
diff -r 695951e4b643 -r 0aa90be6fadc configure.ac
--- a/configure.ac Tue May 28 21:55:58 2019 +0200
+++ b/configure.ac Fri Jun 14 00:16:39 2019 +0200
@@ -1016,7 +1016,6 @@
gcc_n32_cflags_abi="-mabi=n32 -mn32"
cc_n32_cflags="-O2 -n32" # no -g, it disables all optimizations
limb_n32=longlong
- path_n32="mips64"
cclist_64="gcc cc"
gcc_64_cflags_optlist="abi"
@@ -1025,7 +1024,18 @@
gcc_64_ldflags="-Wc,-mabi=64"
cc_64_cflags="-O2 -64" # no -g, it disables all optimizations
cc_64_ldflags="-Wc,-64"
- path_64="mips64"
+
+ case $host_cpu in
+ [mips64r[6789]* | mipsisa64r[6789]*])
+ path_n32="mips64/r6 mips64"
+ path_64="mips64/r6 mips64"
+ ;;
+ *)
+ path_n32="mips64/hilo mips64"
+ path_64="mips64/hilo mips64"
+ ;;
+ esac
+
;;
esac
;;
diff -r 695951e4b643 -r 0aa90be6fadc longlong.h
--- a/longlong.h Tue May 28 21:55:58 2019 +0200
+++ b/longlong.h Fri Jun 14 00:16:39 2019 +0200
@@ -1,6 +1,6 @@
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
-Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2018 Free Software
+Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2019 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -1253,7 +1253,15 @@
#endif /* __mips */
#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-#if __GMP_GNUC_PREREQ (4,4)
+#if defined (_MIPS_ARCH_MIPS64R6)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __m0 = (u), __m1 = (v); \
+ (w0) = __m0 * __m1; \
+ __asm__ ("dmuhu\t%0, %1, %2" : "=d" (w1) : "d" (__m0), "d" (__m1)); \
+ } while (0)
+#endif
+#if !defined (umul_ppmm) && __GMP_GNUC_PREREQ (4,4)
#define umul_ppmm(w1, w0, u, v) \
do { \
typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
diff -r 695951e4b643 -r 0aa90be6fadc mpn/mips64/addmul_1.asm
--- a/mpn/mips64/addmul_1.asm Tue May 28 21:55:58 2019 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-dnl MIPS64 mpn_addmul_1 -- Multiply a limb vector with a single limb and add
-dnl the product to a second limb vector.
-
-dnl Copyright 1992, 1994, 1995, 2000-2002 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 INPUT PARAMETERS
-C res_ptr $4
-C s1_ptr $5
-C size $6
-C s2_limb $7
-
-ASM_START()
-PROLOGUE(mpn_addmul_1)
-
-C feed-in phase 0
- ld $8,0($5)
-
-C feed-in phase 1
- daddiu $5,$5,8
- dmultu $8,$7
-
- daddiu $6,$6,-1
- beq $6,$0,$LC0
- move $2,$0 C zero cy2
-
- daddiu $6,$6,-1
- beq $6,$0,$LC1
- ld $8,0($5) C load new s1 limb as early as possible
-
-Loop: ld $10,0($4)
- mflo $3
- mfhi $9
- daddiu $5,$5,8
- daddu $3,$3,$2 C add old carry limb to low product limb
- dmultu $8,$7
- ld $8,0($5) C load new s1 limb as early as possible
- daddiu $6,$6,-1 C decrement loop counter
- sltu $2,$3,$2 C carry from previous addition -> $2
- daddu $3,$10,$3
- sltu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- daddiu $4,$4,8
- bne $6,$0,Loop
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 1
-$LC1: ld $10,0($4)
- mflo $3
- mfhi $9
- daddu $3,$3,$2
- sltu $2,$3,$2
- dmultu $8,$7
- daddu $3,$10,$3
- sltu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- daddiu $4,$4,8
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 0
-$LC0: ld $10,0($4)
- mflo $3
- mfhi $9
- daddu $3,$3,$2
- sltu $2,$3,$2
- daddu $3,$10,$3
- sltu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- j $31
- daddu $2,$9,$2 C add high product limb and carry from addition
-EPILOGUE(mpn_addmul_1)
diff -r 695951e4b643 -r 0aa90be6fadc mpn/mips64/hilo/addmul_1.asm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/mips64/hilo/addmul_1.asm Fri Jun 14 00:16:39 2019 +0200
@@ -0,0 +1,101 @@
+dnl MIPS64 mpn_addmul_1 -- Multiply a limb vector with a single limb and add
+dnl the product to a second limb vector.
+
+dnl Copyright 1992, 1994, 1995, 2000-2002 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 INPUT PARAMETERS
+C res_ptr $4
+C s1_ptr $5
+C size $6
+C s2_limb $7
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+
+C feed-in phase 0
+ ld $8,0($5)
+
+C feed-in phase 1
+ daddiu $5,$5,8
+ dmultu $8,$7
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC0
+ move $2,$0 C zero cy2
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC1
+ ld $8,0($5) C load new s1 limb as early as possible
+
+Loop: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddiu $5,$5,8
+ daddu $3,$3,$2 C add old carry limb to low product limb
+ dmultu $8,$7
+ ld $8,0($5) C load new s1 limb as early as possible
+ daddiu $6,$6,-1 C decrement loop counter
+ sltu $2,$3,$2 C carry from previous addition -> $2
+ daddu $3,$10,$3
+ sltu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ daddiu $4,$4,8
+ bne $6,$0,Loop
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 1
+$LC1: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddu $3,$3,$2
+ sltu $2,$3,$2
+ dmultu $8,$7
+ daddu $3,$10,$3
+ sltu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ daddiu $4,$4,8
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 0
+$LC0: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddu $3,$3,$2
+ sltu $2,$3,$2
+ daddu $3,$10,$3
+ sltu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ j $31
+ daddu $2,$9,$2 C add high product limb and carry from addition
+EPILOGUE(mpn_addmul_1)
diff -r 695951e4b643 -r 0aa90be6fadc mpn/mips64/hilo/mul_1.asm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/mips64/hilo/mul_1.asm Fri Jun 14 00:16:39 2019 +0200
@@ -0,0 +1,92 @@
+dnl MIPS64 mpn_mul_1 -- Multiply a limb vector with a single limb and store
+dnl the product in a second limb vector.
+
+dnl Copyright 1992, 1994, 1995, 2000-2002 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:
More information about the gmp-commit
mailing list