Home My Page Projects GMP-ECM (Elliptic Curve Method)
Summary Activity Forums Tracker Lists Tasks Docs News SCM Files

[#15469] Compilation problem/speed regression on PowerPC64

Date:
2013-03-08 13:56
Priority:
3
State:
Open
Submitted by:
Alexander Kruppa (kruppa)
Assigned to:
Nobody (None)
Category:
none
Group:
none
Resolution:
none
Summary:
Compilation problem/speed regression on PowerPC64

Detailed description
In thread

http://mersenneforum.org/showthread.php?t=16444

reports a compilation problem with the new PowerPC64 assembler code:

m4 -I../ -DOPERATION_mulredc1 `test -f mulredc1.asm || echo './'`mulredc1.asm >mulredc1.s
/bin/sh ../libtool --mode=compile gcc-4.2 -m64 -c -o mulredc1.lo mulredc1.s
libtool: compile: gcc-4.2 -m64 -c mulredc1.s -o mulredc1.o
mulredc1.s:40:Invalid mnemonic 'tocbase,'
mulredc1.s:41:Unknown pseudo-op: .size
mulredc1.s:41:Rest of line ignored. 1st junk character valued 95 (_).
mulredc1.s:58:Unknown pseudo-op: .size
mulredc1.s:58:Rest of line ignored. 1st junk character valued 46 (.).
make[2]: *** [mulredc1.lo] Error 1

With --disable-asm, it compiles, but he reports a speed regression wrt. 6.3, possibly due to disabled asm code.
Message  ↓
Date: 2016-04-08 12:58
Sender: Paul Zimmermann

revision 2914 should fix this issue: now the powerpc64 assembly is used only when the assembly format is ELF.

Date: 2016-03-08 12:59
Sender: Paul Zimmermann

is the compilation problem still there?
And the speed regression?

Paul

Date: 2013-03-08 22:33
Sender: Leif Leonhardy

Actually my somewhat preliminary patch from nearly a year ago [1] (meant for Sage in the first place, but Paul quickly merged it upstream) doesn't support anything but ELF on PPC64...

(I never returned to improving it, also because the Linux PPC64 machine I had access to was unavailable for quite a while then.)

Quoting myself [2]:

Replying to leif:

> I've attached  a patch to the three .asm / .m4 files all PPC64 assembly files
> are generated from. (FWIW, also applies clean to GMP-ECM 6.4.2.)


> While the original files seem partially over-autoconf'd to me (e.g. TEXT,
> defined in config.m4 after configure), I've currently "hardcoded" the ELF
> function descriptors, i.e., haven't used new macros for them at all. Even
> if GMP-ECM currently only supports systems using ELF on PPC64 (I think;
> Darwin PPC is 32-bit, and asm-redc is disabled on it, although it IMHO
> wouldn't have to be), one could at least write some m4 macros for [PowerPC]
> ELF[64] for convenience and put them into (e.g.) powerpc64/elf.m4, then
> probably only "enable" them if configure determines it's an ELF system.
> (I didn't want to mess with the autoconf files anyway.)

Patching configure[.in] to also include powerpc64/elf.m4 if appropriate is
trivial, so I'll probably add that, too. (And write [slightly corrected]
PROLOG() / EPILOG() macros.)

> One could also add some debugging info to the functions, i.e. traceback
> tables.

[Planned.]


> Perhaps François could test the attached patch with vanilla GMP-ECM on AIX.

Reading configure.in (of GMP-ECM 6.4.2), I see that asm-redc for PPC64 is
currently only supported on Linux anyway, so testing it on AIX doesn't make
sense. (On AIX, it isn't enabled by default, and explicitly enabling it will
just raise a configure error, so that's fine [for now].)

[...]

===============================================

I'll see whether I can do something about it. Still, the assumption was that PPC on Darwin is 32-bit only (and/or asm-redc is disabled on Darwin PPC64 anyway), so most probably something changed in 'configure' w.r.t. that, too.

For upgrading Sage's GMP-ECM spkg to 6.4.4, we'll probably have to deal with that anyway (although Sage adds a second layer, so can simply configure GMP-ECM differently if necessary). Unfortunately only very few Sage developers have (occasionally) access to Darwin PPC (G4/G5) boxes...


-leif

__________________________

[1] http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11705/GMP-ECM_PPC64_ELF_function_descriptors.patch ("Patch to GMP-ECM's PowerPC64 assembly[-generating] files to support dynamic linking (on ELF systems only).")

[2] http://trac.sagemath.org/sage_trac/ticket/11705#comment:107

Date: 2013-03-08 20:49
Sender: Leif Leonhardy

I replied on the Mersenne forum, but I don't see my answer yet -- it's probably in moderation, as I wasn't subscribed to it before.

Looks like he's on MacOS X, where code for the PowerPC ELF(64) ABI of course makes no sense (i.e., Apple's assembler doesn't understand it), so I guess it's some configure issue.

I've asked for more details there (and suggested to try with '--disable-shared', FWIW).

No Changes Have Been Made to This Item