Re: Update: devel/gmp needs testing on other archs

2020-02-07 Thread Stuart Henderson
On 2020/02/07 22:18, Christian Weisgerber wrote:
> On 2020-02-04, Jeremie Courreges-Anglas  wrote:
> 
> > It fails to package though, because of an installed (gmp-6.1.2p3) vs
> > built packages mismatch.  My brain is unavail right now, so I'll let you
> > sort this out. :)
> 
> The problem is that the LIB_DEPENDS resolves to a package spec of
> gmp-*.  We could tighten it with something like this:
> 
>   LIB_DEPENDS-cxx=${BASE_PKGPATH},-main>=${VERSION} \
>   ${MODGCC4_CPPLIBDEP}
> 
> Or even more specific:
> 
>   LIB_DEPENDS-cxx=${FULLPKGNAME-main}:${BASE_PKGPATH},-main \
>   ${MODGCC4_CPPLIBDEP}
> 
> Seems odd in that you would want this for just about every
> MULTI_PACKAGES port with a dependent subpackage, but at the same
> time it isn't used in the ports tree.
> 
> I don't know.

Did something change with this? I ran into this with some other port
recently but I'm sure it didn't happen in the past.



Re: Update: devel/gmp needs testing on other archs

2020-02-07 Thread Christian Weisgerber
On 2020-02-04, Jeremie Courreges-Anglas  wrote:

> It fails to package though, because of an installed (gmp-6.1.2p3) vs
> built packages mismatch.  My brain is unavail right now, so I'll let you
> sort this out. :)

The problem is that the LIB_DEPENDS resolves to a package spec of
gmp-*.  We could tighten it with something like this:

  LIB_DEPENDS-cxx=${BASE_PKGPATH},-main>=${VERSION} \
  ${MODGCC4_CPPLIBDEP}

Or even more specific:

  LIB_DEPENDS-cxx=${FULLPKGNAME-main}:${BASE_PKGPATH},-main \
  ${MODGCC4_CPPLIBDEP}

Seems odd in that you would want this for just about every
MULTI_PACKAGES port with a dependent subpackage, but at the same
time it isn't used in the ports tree.

I don't know.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: Update: devel/gmp needs testing on other archs

2020-02-04 Thread Jeremie Courreges-Anglas
On Mon, Feb 03 2020, Christian Weisgerber  wrote:
> Jeremie Courreges-Anglas:
>
>> Fails to build on sparc64:
>
>> build log: https://pbot.rmdir.de/9cefjLlzIP4QEsKwn-g0UA
>> tmp-gcd_11.s: https://pbot.rmdir.de/pWyiZKnS6FSGcqsuuLs-YQ
>
> Thanks.
>
> The problem is this upstream commit:
> https://gmplib.org/repo/gmp/rev/20cf1131dc94
> It uses %gdop(), which is not implemented by our binutils 2.17.
>
> Partially reverting this should fix it.  New patch below.

This one succeeded.  make test log:

  https://pbot.rmdir.de/fiPSWsf8rJc5NJj6TzwbuQ

It fails to package though, because of an installed (gmp-6.1.2p3) vs
built packages mismatch.  My brain is unavail right now, so I'll let you
sort this out. :)

--8<--
===>  Building package for gmp-6.2.0
Create /usr/ports/packages/sparc64/all/gmp-6.2.0.tgz
Creating package gmp-6.2.0
Link to /usr/ports/packages/sparc64/ftp/gmp-6.2.0.tgz
`/usr/ports/pobj/gmp-6.2.0/fake-sparc64/.fake_done' is up to date.
===>  Building package for gmpxx-6.2.0
Create /usr/ports/packages/sparc64/all/gmpxx-6.2.0.tgz
Creating package gmpxx-6.2.0
|library gmp.11.0 not found
| /usr/local/lib/libgmp.so.10.0 (gmp-6.1.2p3): bad major
Direct dependencies for gmpxx-6.2.0 resolve to gcc-libs-8.3.0p4 gmp-6.1.2p3
Full dependency tree is gmp-6.1.2p3 gcc-libs-8.3.0p4
pkg_create: can't continue
-->8--



-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: Update: devel/gmp needs testing on other archs

2020-02-03 Thread Christian Weisgerber
Stuart Henderson:

> Really ports-gcc ought to be using a compatible version of gas.. Do we need
> a ports-binutils?

ports-gcc doesn't generate the assembly in question.  It's original
assembly code that the compiler just passes through to as(1).

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: Update: devel/gmp needs testing on other archs

2020-02-03 Thread Christian Weisgerber
Jeremie Courreges-Anglas:

> Fails to build on sparc64:

> build log: https://pbot.rmdir.de/9cefjLlzIP4QEsKwn-g0UA
> tmp-gcd_11.s: https://pbot.rmdir.de/pWyiZKnS6FSGcqsuuLs-YQ

Thanks.

The problem is this upstream commit:
https://gmplib.org/repo/gmp/rev/20cf1131dc94
It uses %gdop(), which is not implemented by our binutils 2.17.

Partially reverting this should fix it.  New patch below.


There is actually a configure check for this feature, but sparc-defs.m4
fails to use the result properly.  Basically there should be something
like ifelse(HAVE_GOTDATA, yes, ...) that picks one implementation
or the other.  I don't have a sparc64 to test, though, and there's
no chance I'll get the m4 quoting right when flying blind.  Maybe
somebody else wants to give it a try.


Index: Makefile
===
RCS file: /cvs/ports/devel/gmp/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- Makefile12 Jul 2019 20:44:10 -  1.40
+++ Makefile3 Feb 2020 12:14:21 -
@@ -3,16 +3,14 @@
 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 +=  gmpxx2.0  # 9.2
+SHARED_LIBS +=  gmp  11.0 # 14.0
+SHARED_LIBS +=  gmpxx3.0  # 10.0
 CATEGORIES=devel math
 
 HOMEPAGE=  https://gmplib.org/
@@ -35,8 +33,9 @@ LIB_DEPENDS-cxx=${BASE_PKGPATH},-main \
 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}
 
@@ -45,11 +44,5 @@ CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-
 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 
Index: distinfo
===
RCS file: /cvs/ports/devel/gmp/distinfo,v
retrieving revision 1.17
diff -u -p -r1.17 distinfo
--- distinfo19 Dec 2016 21:48:12 -  1.17
+++ distinfo3 Feb 2020 12:14:21 -
@@ -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
Index: files/mpn_m88k_add_n.asm
===
RCS file: files/mpn_m88k_add_n.asm
diff -N files/mpn_m88k_add_n.asm
--- files/mpn_m88k_add_n.asm13 Apr 2013 20:19:50 -  1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -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>
-   bcndeq0,%r5,Lzero
-
-ifdef(`PIC',`
-

Re: Update: devel/gmp needs testing on other archs

2020-02-03 Thread Stuart Henderson
Really ports-gcc ought to be using a compatible version of gas.. Do we need 
a ports-binutils?


--
Sent from a phone, apologies for poor formatting.

On 3 February 2020 00:12:18 Jeremie Courreges-Anglas  wrote:


On Sun, Feb 02 2020, Christian Weisgerber  wrote:

This updates devel/gmp to 6.2.0.
gmp has a ton of machine-specific optimizations, so success on one
arch doesn't mean it will work elsewhere.


Indeed :)


I have successfully run the regression tests on
* aarch64
* amd64
* i386

I'd like to see it tested on a few more archs, say, powerpc/sparc64/
mips64, before I commit it.


Fails to build on sparc64:

--8<--
/usr/bin/libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" cc -c 
-DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I..  -DOPERATION_`echo gcd_11 
| sed 's/_$//'`-O2 -pipe  `test -f 'gcd_11.asm' || echo './'`gcd_11.asm
../mpn/m4-ccas --m4=m4 cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP 
-I.. -DOPERATION_gcd_11 -O2 -pipe gcd_11.asm -fPIC -DPIC -o .libs/gcd_11.o
m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_gcd_11 -DPIC gcd_11.asm 
>tmp-gcd_11.s
cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_11 
-O2 -pipe tmp-gcd_11.s -fPIC -DPIC -o .libs/gcd_11.o

tmp-gcd_11.s: Assembler messages:
tmp-gcd_11.s:210: Error: Illegal operands
tmp-gcd_11.s:211: Error: Illegal operands
egcc: internal compiler error: Segmentation fault signal terminated program as
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Error while executing ../mpn/m4-ccas --m4=m4 cc -c -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_11 -O2 -pipe gcd_11.asm -fPIC -DPIC 
-o .libs/gcd_11.o

*** Error 4 in mpn (Makefile:768 'gcd_11.lo')
*** Error 1 in . (Makefile:1020 'all-recursive': @fail=;  if 
(target_option=k; case ${target_option-} in  ?) ;;  *) echo 
"am__make_running_w...)

*** Error 2 in /usr/ports/pobj/gmp-6.2.0/gmp-6.2.0 (Makefile:785 'all')
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2891 
'/usr/ports/pobj/gmp-6.2.0/.build_done': @cd 
/usr/ports/pobj/gmp-6.2.0/gmp-6...)
*** Error 2 in /usr/ports/devel/gmp 
(/usr/ports/infrastructure/mk/bsd.port.mk:2557 'test': @lock=gmp-6.2.0;  
export _LOCKS_HELD=" gmp-6.2.0"...)

-->8--

build log: https://pbot.rmdir.de/9cefjLlzIP4QEsKwn-g0UA
tmp-gcd_11.s: https://pbot.rmdir.de/pWyiZKnS6FSGcqsuuLs-YQ

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE






Re: Update: devel/gmp needs testing on other archs

2020-02-02 Thread Jeremie Courreges-Anglas
On Sun, Feb 02 2020, Christian Weisgerber  wrote:
> This updates devel/gmp to 6.2.0.
> gmp has a ton of machine-specific optimizations, so success on one
> arch doesn't mean it will work elsewhere.

Indeed :)

> I have successfully run the regression tests on
> * aarch64
> * amd64
> * i386
>
> I'd like to see it tested on a few more archs, say, powerpc/sparc64/
> mips64, before I commit it.

Fails to build on sparc64:

--8<--
/usr/bin/libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" cc -c 
-DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I..  -DOPERATION_`echo gcd_11 | 
sed 's/_$//'`-O2 -pipe  `test -f 'gcd_11.asm' || echo './'`gcd_11.asm
../mpn/m4-ccas --m4=m4 cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. 
-DOPERATION_gcd_11 -O2 -pipe gcd_11.asm -fPIC -DPIC -o .libs/gcd_11.o
m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_gcd_11 -DPIC gcd_11.asm 
>tmp-gcd_11.s
 cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_11 -O2 
-pipe tmp-gcd_11.s -fPIC -DPIC -o .libs/gcd_11.o
tmp-gcd_11.s: Assembler messages:
tmp-gcd_11.s:210: Error: Illegal operands
tmp-gcd_11.s:211: Error: Illegal operands
egcc: internal compiler error: Segmentation fault signal terminated program as
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Error while executing ../mpn/m4-ccas --m4=m4 cc -c -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_11 -O2 -pipe gcd_11.asm -fPIC -DPIC -o 
.libs/gcd_11.o
*** Error 4 in mpn (Makefile:768 'gcd_11.lo')
*** Error 1 in . (Makefile:1020 'all-recursive': @fail=;  if (target_option=k; 
case ${target_option-} in  ?) ;;  *) echo "am__make_running_w...)
*** Error 2 in /usr/ports/pobj/gmp-6.2.0/gmp-6.2.0 (Makefile:785 'all')
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2891 
'/usr/ports/pobj/gmp-6.2.0/.build_done': @cd /usr/ports/pobj/gmp-6.2.0/gmp-6...)
*** Error 2 in /usr/ports/devel/gmp 
(/usr/ports/infrastructure/mk/bsd.port.mk:2557 'test': @lock=gmp-6.2.0;  export 
_LOCKS_HELD=" gmp-6.2.0"...)
-->8--

build log: https://pbot.rmdir.de/9cefjLlzIP4QEsKwn-g0UA
tmp-gcd_11.s: https://pbot.rmdir.de/pWyiZKnS6FSGcqsuuLs-YQ

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: Update: devel/gmp needs testing on other archs

2020-02-02 Thread Kurt Mosiejczuk
On Sun, Feb 02, 2020 at 10:39:16PM +0100, Christian Weisgerber wrote:
> This updates devel/gmp to 6.2.0.
> gmp has a ton of machine-specific optimizations, so success on one
> arch doesn't mean it will work elsewhere.

> I have successfully run the regression tests on
> * aarch64
> * amd64
> * i386

> I'd like to see it tested on a few more archs, say, powerpc/sparc64/
> mips64, before I commit it.

Unfortunately, it blows up on sparc64:
 cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_11 -O2 
-pipe tmp-gcd_11.s -fPIC -DPIC -o .libs/gcd_11.o
tmp-gcd_11.s: Assembler messages:
tmp-gcd_11.s:210: Error: Illegal operands
tmp-gcd_11.s:211: Error: Illegal operands
egcc: internal compiler error: Segmentation fault signal terminated program as
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Error while executing ../mpn/m4-ccas --m4=m4 cc -c -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_11 -O2 -pipe gcd_11.asm -fPIC -DPIC -o 
.libs/gcd_11.o
*** Error 4 in mpn (Makefile:768 'gcd_11.lo')
*** Error 1 in . (Makefile:1020 'all-recursive': @fail=;  if (target_option=k; 
case ${target_option-} in  ?) ;;  *) echo "am__make_running_w...)
*** Error 2 in /usr/ports/pobj/gmp-6.2.0/gmp-6.2.0 (Makefile:785 'all')
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2890 
'/usr/ports/pobj/gmp-6.2.0/.build_done': @cd /usr/ports/pobj/gmp-6.2.0/gmp-6...)
*** Error 2 in /usr/ports/devel/gmp 
(/usr/ports/infrastructure/mk/bsd.port.mk:2556 'all': @lock=gmp-6.2.0;  export 
_LOCKS_HELD=" gmp-6.2.0";...)

--Kurt



Re: Update: devel/gmp needs testing on other archs

2020-02-02 Thread Charlene Wendling
On Sun, 2 Feb 2020 22:39:16 +0100
Christian Weisgerber wrote:

> This updates devel/gmp to 6.2.0.
> gmp has a ton of machine-specific optimizations, so success on one
> arch doesn't mean it will work elsewhere.
> 
> I have successfully run the regression tests on
> * aarch64
> * amd64
> * i386
> 
> I'd like to see it tested on a few more archs, say, powerpc/sparc64/
> mips64, before I commit it.

There is no failure on macppc, see

https://bin.charlenew.xyz/gmp.powerpc.test.log

> 
> Index: Makefile
> ===
> RCS file: /cvs/ports/devel/gmp/Makefile,v
> retrieving revision 1.40
> diff -u -p -r1.40 Makefile
> --- Makefile  12 Jul 2019 20:44:10 -  1.40
> +++ Makefile  2 Feb 2020 21:33:07 -
> @@ -3,16 +3,14 @@
>  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 +=  gmpxx2.0  # 9.2
> +SHARED_LIBS +=  gmp  11.0 # 14.0
> +SHARED_LIBS +=  gmpxx3.0  # 10.0
>  CATEGORIES=  devel math
>  
>  HOMEPAGE=https://gmplib.org/
> @@ -35,8 +33,7 @@ LIB_DEPENDS-cxx=${BASE_PKGPATH},-main \
>  PSEUDO_FLAVORS=  no_cxx bootstrap
>  FLAVOR?=
>  
> -CONFIGURE_STYLE=autoconf
> -AUTOCONF_VERSION=2.69
> +CONFIGURE_STYLE=gnu
>  # Don't try to optimize for the local CPU submodel
>  CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-unknown-openbsd${OSrev}
>  
> @@ -45,11 +42,5 @@ CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-
>  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 
> Index: distinfo
> ===
> RCS file: /cvs/ports/devel/gmp/distinfo,v
> retrieving revision 1.17
> diff -u -p -r1.17 distinfo
> --- distinfo  19 Dec 2016 21:48:12 -  1.17
> +++ distinfo  2 Feb 2020 21:33:07 -
> @@ -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 Index: files/mpn_m88k_add_n.asm
> ===
> RCS file: files/mpn_m88k_add_n.asm
> diff -N files/mpn_m88k_add_n.asm
> --- files/mpn_m88k_add_n.asm  13 Apr 2013 20:19:50 -
> 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -
> @@ -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>
> - bcndeq0,%r5,Lzero
> -
> -ifdef(`PIC',`
> - or  %r9,%r0,%r25
> - or  %r11,%r0,%r1
> - or.u%r25,%r0,%hi16(.Lpic#abdiff)
> - bsr.n   .Lpic
> -  

Update: devel/gmp needs testing on other archs

2020-02-02 Thread Christian Weisgerber
This updates devel/gmp to 6.2.0.
gmp has a ton of machine-specific optimizations, so success on one
arch doesn't mean it will work elsewhere.

I have successfully run the regression tests on
* aarch64
* amd64
* i386

I'd like to see it tested on a few more archs, say, powerpc/sparc64/
mips64, before I commit it.


Index: Makefile
===
RCS file: /cvs/ports/devel/gmp/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- Makefile12 Jul 2019 20:44:10 -  1.40
+++ Makefile2 Feb 2020 21:33:07 -
@@ -3,16 +3,14 @@
 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 +=  gmpxx2.0  # 9.2
+SHARED_LIBS +=  gmp  11.0 # 14.0
+SHARED_LIBS +=  gmpxx3.0  # 10.0
 CATEGORIES=devel math
 
 HOMEPAGE=  https://gmplib.org/
@@ -35,8 +33,7 @@ LIB_DEPENDS-cxx=${BASE_PKGPATH},-main \
 PSEUDO_FLAVORS=no_cxx bootstrap
 FLAVOR?=
 
-CONFIGURE_STYLE=autoconf
-AUTOCONF_VERSION=2.69
+CONFIGURE_STYLE=gnu
 # Don't try to optimize for the local CPU submodel
 CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-unknown-openbsd${OSrev}
 
@@ -45,11 +42,5 @@ CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-
 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 
Index: distinfo
===
RCS file: /cvs/ports/devel/gmp/distinfo,v
retrieving revision 1.17
diff -u -p -r1.17 distinfo
--- distinfo19 Dec 2016 21:48:12 -  1.17
+++ distinfo2 Feb 2020 21:33:07 -
@@ -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
Index: files/mpn_m88k_add_n.asm
===
RCS file: files/mpn_m88k_add_n.asm
diff -N files/mpn_m88k_add_n.asm
--- files/mpn_m88k_add_n.asm13 Apr 2013 20:19:50 -  1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -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>
-   bcndeq0,%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