mini-gmp errors on SYSTYPE: powerpc750-unknown-linux-gnu

Torbjörn Granlund tg at gmplib.org
Tue Dec 17 22:18:53 UTC 2019


Marco Bodrato <bodrato at mail.dm.unipi.it> writes:

  From our testing system is emerging an error on some powerpc750.

  The test t-cmp_d for mini-gmp is failing with:

  mpz_cmp_d wrong (from check_infinity)
    got  1
    want -1
    x=141246703213942603[...]
  [...]
    y 3.40282e+38
    y 47 F0 00 00 00 00 00 00

  This comes from the following lines in mini-gmp/tests/t-cmp_d.c:

  void
  check_infinity (void)
  {
    mpz_t   x;
    double  y = HUGE_VAL;
    if (y != 2*y)
      return;
  [..]
    /* 2^5000 cmp inf */
    mpz_set_ui (x, 1L);
    mpz_mul_2exp (x, x, 5000L);
    check_one ("check_infinity", x,  y, -1, -1);
  [..]

  So, it seems that on that systems HUGE_VAL is defined as 3.40282e+38.
  This probably is the larger value that can be represented, because the
  function does not stop the test after the "if (y != 2*y) return;"
  check.

  But in the function cmp_d, the double value is not multiplied, it is
  divided... maybe if we change the initial test into "if (y != y/2)
  return;", then the test is simply skipped in this case. May this be
  the desired behaviour?

These systems run behind ashell under qemu, on a new 12-core Ryzen
3900X.  You can test there.

We often run into qemu bugs, and this might be another example.  It
might be possible to find a version of qemu which runs the present
binaries correctly.

I will link lots of qemu versions under /usr/bin/qemu/VERSION when I
have the time to modify my scripts.  Thereby, it is possible to manually
run a binary under a different qemu version.

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list