Patch to enable build on s390x

Andreas Krebbel krebbel at
Thu Sep 22 10:15:37 CEST 2011

On 09/20/2011 03:07 PM, Torbjorn Granlund wrote:
> Andreas Krebbel <krebbel at> writes:
>   Yes that's intentional. clock_gettime should be the better choice for both platforms.
>   Using STCK directly has a higher resolution but is not stopped when the CPU is taken away
>   from your system so in general the results will not be reliable when trying to measure the
>   CPU cycles spent for a certain workload.
> This is the case for many accurate measurement mechanisms under the
> kernel Linux.  E.g., the x86 rdtsc is not managed properly by that
> kernel.
> Our experience is that it is nevertheless better to use rdtsc than
> low-accuracy measurement mechanisms.  Most GMP threshold parameters are
> for computations that take just a few nanoseconds.

>From the comments in time.c I expected that this is compensated by running the tests more
often and divide the time by the number of runs.

>From a first glance using stck seems to require the CPU frequency and this is not that
easy to determine. The only way I can think of is putting a cpu table into the code which
would need updating whenever a new CPU appears. So for now clock_gettime appears to be a
bit easier to me. Btw. libatlas also seems to rely on clock_gettime - however their tests
seem to run much longer.



More information about the gmp-bugs mailing list