https://bugs.kde.org/show_bug.cgi?id=384930

Niels Möller <ni...@lysator.liu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ni...@lysator.liu.se

--- Comment #1 from Niels Möller <ni...@lysator.liu.se> ---
I'm seeing a similar problem, was about to file a new bug, but instead
commenting here:

I'm trying to run gmp test under valgrind. Earlier versions complained that it
didn't recognize all instructions, but after upgrading to the valgrind package
in debian stable valgrind runs without complaints. My machine has a x86_64
broadwell cpu ("Core i3-5010U") with adx and bmi2 extensions. 

I'm using gmp master, with the mul_basecase code from
https://gmplib.org/repo/gmp/file/tip/mpn/x86_64/coreibwl/mul_basecase.asm,
using all of mulx, adcx and adox. I will also attach a disassembly of the
corresponding object file. Consider the following test program:

#include <stdio.h>
#include <gmp.h>

int main (int argc, char **argv) 
{
  mpz_t a, b, c;
  mpz_inits(a, b, c, NULL);
  mpz_set_str (a,
"ffffffffffffffffffffff00000007ffffffffffffff00000000000000fffffffffffffffffffff",
16);
  mpz_set_str (b, "1fffffffffffffffffffffffffffffffffffffffe00007ffffffff",
16);
  mpz_mul(c, a, b);
  gmp_printf("%Zx\n", c);
  mpz_clears(a, b, c, NULL);
  return 0;
}

When run, it outputs the number 

1fffffffffffffffffffffe0000000ffffffffffdfffe7ffffffff000020001ffff7ff000040fffdfff81ffff800000000e00007ffffffff00000001ffff800000001

However, when ran under valgrind, 

==19918== Memcheck, a memory error detector
==19918== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19918== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==19918== Command: ./a.out
==19918== 
1ffffeffffffffffffffffe0000100fffff7ffffffffe00001000000001ffffefffffffffffffffe0000100000000000000010000000000000001001ffff800000001

Note the output is quite different, the most significant (1ffff) and least
significant (001ffff800000001) words agree, but the all the rest differ.

I suspect it's one of the new and somewhat obscure instructions adox, adcx or
mulx that isn't handled correctly.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to