Update to 6.2.0. Release notes:

https://gmplib.org/gmp6.2.html

Tested on aarch64, amd64, i386; powerpc (cwen@), sparc64 (kmos@, jca@)
This commit is contained in:
naddy 2020-02-21 23:36:54 +00:00
parent c4ba9282a9
commit 6b9ef6fd45
8 changed files with 38 additions and 276 deletions

View File

@ -1,18 +1,16 @@
# $OpenBSD: Makefile,v 1.40 2019/07/12 20:44:10 sthen Exp $
# $OpenBSD: Makefile,v 1.41 2020/02/21 23:36:54 naddy Exp $
COMMENT-main= library for arbitrary precision arithmetic
COMMENT-cxx= C++ library for arbitrary precision arithmetic
VERSION= 6.1.2
VERSION= 6.2.0
DISTNAME= gmp-${VERSION}
MULTI_PACKAGES= -main -cxx
PKGNAME-main= gmp-${VERSION}
PKGNAME-cxx= gmpxx-${VERSION}
REVISION= 3
REVISION-cxx= 4
SHARED_LIBS += gmp 10.0 # 13.2
SHARED_LIBS += gmpxx 2.0 # 9.2
SHARED_LIBS += gmp 11.0 # 14.0
SHARED_LIBS += gmpxx 3.0 # 10.0
CATEGORIES= devel math
HOMEPAGE= https://gmplib.org/
@ -29,14 +27,15 @@ MASTER_SITES= https://gmplib.org/download/gmp/ \
WANTLIB-main= # empty
WANTLIB-cxx= gmp m ${COMPILER_LIBCXX}
LIB_DEPENDS-cxx=${BASE_PKGPATH},-main \
LIB_DEPENDS-cxx=${FULLPKGNAME-main}:${BASE_PKGPATH},-main \
${MODGCC4_CPPLIBDEP}
PSEUDO_FLAVORS= no_cxx bootstrap
FLAVOR?=
CONFIGURE_STYLE=autoconf
AUTOCONF_VERSION=2.69
DEBUG_PACKAGES= ${BUILD_PACKAGES}
CONFIGURE_STYLE=gnu
# Don't try to optimize for the local CPU submodel
CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-unknown-openbsd${OSrev}
@ -46,10 +45,4 @@ COMPILER= base-clang ports-gcc base-gcc
CONFIGURE_ARGS+=--enable-cxx
.endif
post-patch:
@cp ${FILESDIR}/mpn_m88k_add_n.asm ${WRKSRC}/mpn/m88k/add_n.asm
@cp ${FILESDIR}/mpn_m88k_sub_n.asm ${WRKSRC}/mpn/m88k/sub_n.asm
@rm ${WRKSRC}/mpn/m88k/add_n.s ${WRKSRC}/mpn/m88k/sub_n.s \
${WRKSRC}/mpn/m88k/mul_1.s
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (gmp-6.1.2.tar.xz) = h7Vl6JqaaE/k6+7duDmdziWZ+ckEmFTKjA373qDiGRI=
SIZE (gmp-6.1.2.tar.xz) = 1946336
SHA256 (gmp-6.2.0.tar.xz) = JY5s1Rs/vfwYXHFtVfgsCK/1ffDG+9FDz27VYSZ6FSY=
SIZE (gmp-6.2.0.tar.xz) = 2012444

View File

@ -1,117 +0,0 @@
dnl mc88100 mpn_add_n -- Add two limb vectors of the same length > 0 and store
dnl sum in a third limb vector.
dnl Copyright 1992, 1994, 1995, 2000 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl The GNU MP 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 by
dnl the Free Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
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 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 GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C INPUT PARAMETERS
C res_ptr %r2
C s1_ptr %r3
C s2_ptr %r4
C size %r5
C This code has been optimized to run one instruction per clock, avoiding
C load stalls and writeback contention. As a result, the instruction
C order is not always natural.
C The speed is about 4.6 clocks/limb + 18 clocks/limb-vector on an 88100,
C but on the 88110, it seems to run much slower, 6.6 clocks/limb.
ASM_START()
PROLOGUE(mpn_add_n)
ld %r6,%r3,0 C read first limb from s1_ptr
extu %r10,%r5,3
ld %r7,%r4,0 C read first limb from s2_ptr
subu.co %r5,%r0,%r5 C (clear carry as side effect)
mak %r5,%r5,3<4>
bcnd eq0,%r5,Lzero
ifdef(`PIC',`
or %r9,%r0,%r25
or %r11,%r0,%r1
or.u %r25,%r0,%hi16(.Lpic#abdiff)
bsr.n .Lpic
or %r25,%r25,%lo16(.Lpic#abdiff)
.Lpic: add %r25,%r25,%r1
or %r1,%r0,%r11
or.u %r11,%r0,%hi16(Lbase#got_rel)
or %r11,%r11,%lo16(Lbase#got_rel)
ld %r12,%r25,%r11
or %r25,%r0,%r9
',`
or %r12,%r0,%lo16(Lbase)
or.u %r12,%r12,%hi16(Lbase)
')
addu %r12,%r12,%r5 C %r12 is address for entering in loop
extu %r5,%r5,2 C divide by 4
subu %r2,%r2,%r5 C adjust res_ptr
subu %r3,%r3,%r5 C adjust s1_ptr
subu %r4,%r4,%r5 C adjust s2_ptr
or %r8,%r6,%r0
jmp.n %r12
or %r9,%r7,%r0
Loop: addu %r3,%r3,32
st %r8,%r2,28
addu %r4,%r4,32
ld %r6,%r3,0
addu %r2,%r2,32
ld %r7,%r4,0
Lzero: subu %r10,%r10,1 C add 0 + 8r limbs (adj loop cnt)
Lbase: ld %r8,%r3,4
addu.cio %r6,%r6,%r7
ld %r9,%r4,4
st %r6,%r2,0
ld %r6,%r3,8 C add 7 + 8r limbs
addu.cio %r8,%r8,%r9
ld %r7,%r4,8
st %r8,%r2,4
ld %r8,%r3,12 C add 6 + 8r limbs
addu.cio %r6,%r6,%r7
ld %r9,%r4,12
st %r6,%r2,8
ld %r6,%r3,16 C add 5 + 8r limbs
addu.cio %r8,%r8,%r9
ld %r7,%r4,16
st %r8,%r2,12
ld %r8,%r3,20 C add 4 + 8r limbs
addu.cio %r6,%r6,%r7
ld %r9,%r4,20
st %r6,%r2,16
ld %r6,%r3,24 C add 3 + 8r limbs
addu.cio %r8,%r8,%r9
ld %r7,%r4,24
st %r8,%r2,20
ld %r8,%r3,28 C add 2 + 8r limbs
addu.cio %r6,%r6,%r7
ld %r9,%r4,28
st %r6,%r2,24
bcnd.n ne0,%r10,Loop C add 1 + 8r limbs
addu.cio %r8,%r8,%r9
st %r8,%r2,28 C store most significant limb
jmp.n %r1
addu.ci %r2,%r0,%r0 C return carry-out from most sign. limb
EPILOGUE(mpn_add_n)

View File

@ -1,118 +0,0 @@
dnl mc88100 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
dnl store difference in a third limb vector.
dnl Copyright 1992, 1994, 1996, 2000 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl The GNU MP 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 by
dnl the Free Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
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 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 GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C INPUT PARAMETERS
C res_ptr %r2
C s1_ptr %r3
C s2_ptr %r4
C size %r5
C This code has been optimized to run one instruction per clock, avoiding
C load stalls and writeback contention. As a result, the instruction
C order is not always natural.
C The speed is about 4.6 clocks/limb + 18 clocks/limb-vector on an 88100,
C but on the 88110, it seems to run much slower, 6.6 clocks/limb.
ASM_START()
PROLOGUE(mpn_sub_n)
ld %r6,%r3,0 C read first limb from s1_ptr
extu %r10,%r5,3
ld %r7,%r4,0 C read first limb from s2_ptr
subu %r5,%r0,%r5
mak %r5,%r5,3<4>
bcnd.n eq0,%r5,Lzero
subu.co %r0,%r0,%r0 C initialize carry
ifdef(`PIC',`
or %r9,%r0,%r25
or %r11,%r0,%r1
or.u %r25,%r0,%hi16(.Lpic#abdiff)
bsr.n .Lpic
or %r25,%r25,%lo16(.Lpic#abdiff)
.Lpic: add %r25,%r25,%r1
or %r1,%r0,%r11
or.u %r11,%r0,%hi16(Lbase#got_rel)
or %r11,%r11,%lo16(Lbase#got_rel)
ld %r12,%r25,%r11
or %r25,%r0,%r9
',`
or %r12,%r0,%lo16(Lbase)
or.u %r12,%r12,%hi16(Lbase)
')
addu %r12,%r12,%r5 C %r12 is address for entering in loop
extu %r5,%r5,2 C divide by 4
subu %r2,%r2,%r5 C adjust res_ptr
subu %r3,%r3,%r5 C adjust s1_ptr
subu %r4,%r4,%r5 C adjust s2_ptr
or %r8,%r6,%r0
jmp.n %r12
or %r9,%r7,%r0
Loop: addu %r3,%r3,32
st %r8,%r2,28
addu %r4,%r4,32
ld %r6,%r3,0
addu %r2,%r2,32
ld %r7,%r4,0
Lzero: subu %r10,%r10,1 C subtract 0 + 8r limbs (adj loop cnt)
Lbase: ld %r8,%r3,4
subu.cio %r6,%r6,%r7
ld %r9,%r4,4
st %r6,%r2,0
ld %r6,%r3,8 C subtract 7 + 8r limbs
subu.cio %r8,%r8,%r9
ld %r7,%r4,8
st %r8,%r2,4
ld %r8,%r3,12 C subtract 6 + 8r limbs
subu.cio %r6,%r6,%r7
ld %r9,%r4,12
st %r6,%r2,8
ld %r6,%r3,16 C subtract 5 + 8r limbs
subu.cio %r8,%r8,%r9
ld %r7,%r4,16
st %r8,%r2,12
ld %r8,%r3,20 C subtract 4 + 8r limbs
subu.cio %r6,%r6,%r7
ld %r9,%r4,20
st %r6,%r2,16
ld %r6,%r3,24 C subtract 3 + 8r limbs
subu.cio %r8,%r8,%r9
ld %r7,%r4,24
st %r8,%r2,20
ld %r8,%r3,28 C subtract 2 + 8r limbs
subu.cio %r6,%r6,%r7
ld %r9,%r4,28
st %r6,%r2,24
bcnd.n ne0,%r10,Loop C subtract 1 + 8r limbs
subu.cio %r8,%r8,%r9
st %r8,%r2,28 C store most significant limb
addu.ci %r2,%r0,%r0 C return carry-out from most sign. limb
jmp.n %r1
xor %r2,%r2,1
EPILOGUE(mpn_sub_n)

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-acinclude_m4,v 1.2 2017/11/05 15:12:56 jca Exp $
Zero out the memory before testing for overwrite bug.
Fixed in unstable, not in the gmp-6.1 branch:
https://gmplib.org/repo/gmp/rev/2ce5c60f5372
Index: acinclude.m4
--- acinclude.m4.orig
+++ acinclude.m4
@@ -741,7 +741,7 @@ main ()
long i;
for (i = 0; i < 88 + 1; i++)
a[i] = ~0L;
- r = malloc (10000 * sizeof (unsigned long));
+ r = calloc (10000, sizeof (unsigned long));
r2 = r;
for (i = 0; i < 528; i += 23)
{

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-mpn_sparc32_sparc-defs_m4,v 1.1 2020/02/21 23:36:55 naddy Exp $
as(1) from binutils 2.17 does not support %gdop(). Partially revert
https://gmplib.org/repo/gmp/rev/20cf1131dc94
Index: mpn/sparc32/sparc-defs.m4
--- mpn/sparc32/sparc-defs.m4.orig
+++ mpn/sparc32/sparc-defs.m4
@@ -80,9 +80,10 @@ m4_assert_defined(`HAVE_GOTDATA')
sethi %hi(_GLOBAL_OFFSET_TABLE_+4), %`$3'
add %`$3', %lo(_GLOBAL_OFFSET_TABLE_+8), %`$3'
add %`$2', %`$3', %`$3'
- sethi %gdop_hix22(`$1'), %`$2'
- xor %`$2', %gdop_lox10(`$1'), %`$2'
- ldx [%`$3' + %`$2'], %`$2', %gdop(`$1')
+ sethi %hi(`$1'), %`$2'
+ or %`$2', %lo(`$1'), %`$2'
+ ldx [%`$3' + %`$2'], %`$2'',`
+ setx `$1', %`$3', %`$2'
',`
sethi %h44(`$1'), %`$2'
or %`$2', %m44(`$1'), %`$2'

View File

@ -1,6 +1,7 @@
@comment $OpenBSD: PLIST-cxx,v 1.1 2018/11/02 18:43:56 naddy Exp $
@comment $OpenBSD: PLIST-cxx,v 1.2 2020/02/21 23:36:55 naddy Exp $
@conflict gmp-<6.1.2p2
include/gmpxx.h
lib/libgmpxx.a
@static-lib lib/libgmpxx.a
lib/libgmpxx.la
@lib lib/libgmpxx.so.${LIBgmpxx_VERSION}
lib/pkgconfig/gmpxx.pc

View File

@ -1,7 +1,8 @@
@comment $OpenBSD: PLIST-main,v 1.1 2018/11/02 18:43:56 naddy Exp $
@comment $OpenBSD: PLIST-main,v 1.2 2020/02/21 23:36:55 naddy Exp $
@pkgpath devel/gmp
include/gmp.h
@info info/gmp.info
lib/libgmp.a
@static-lib lib/libgmp.a
lib/libgmp.la
@lib lib/libgmp.so.${LIBgmp_VERSION}
lib/pkgconfig/gmp.pc