Patch to enable build on s390x

Andreas Krebbel krebbel at
Mon Sep 19 10:20:41 CEST 2011

On 09/19/2011 09:57 AM, Torbjorn Granlund wrote:
> I think we should port GMP properly, not merely apply a patch that works
> around one observed problem.

Here is a preliminary version of the patch. I did the tuning for 31 and 64 on the latest
CPU generation: zEnterprise z196.

I've replaced the store clock timing with clock_gettime. stck is not "virtualized" so it
is almost impossible to get a valid measurement if you don't own a System z yourself :)

Also there is thread specific variant of clock_gettime which has vdso support starting
with kernel 2.6.29. That way the time measurement avoids the context switch and therefore
creates much less overhead. I've changed time.c to always prefer that variant if available.

I didn't implement umul_ppmm for s390x yet but I'll try to do soon.

Please have a look and tell me what you think is still missing.



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gmp-s390
URL: <>

More information about the gmp-bugs mailing list