Handle gcc __builtin_strcmp using 128/256 bit vectors with sse4.1, avx/avx2
commitb8ad8a0774c4be2d2260bfb6a11a660334dba3e8
authorJulian Seward <jseward.tech@gmail.com>
Mon, 11 Mar 2024 16:53:14 +0000 (11 17:53 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 15 Mar 2024 16:01:10 +0000 (15 17:01 +0100)
tree02f807936d3c3058b14f5288dd785f36e3099597
parentccdde6d76fc442360153a8950176700982509fbd
Handle gcc __builtin_strcmp using 128/256 bit vectors with sse4.1, avx/avx2

* amd64 front end: redo the translation into IR for PTEST, so as to
  use only IROps which we know Memcheck can do exact instrumentation
  for.  Handling for both the 128- and 256-bit cases is has been
  changed.

* ir_opt.c: add some constant folding rules to support the above.  In
  particular, for the case `ptest %reg, %reg` (the same reg twice), we
  want rflags.C to be set to a defined-1 even if %reg is completely
  undefined.  Doing that requires folding `x and not(x)` to zero when
  x has type V128 or V256.

* memcheck/tests/amd64/rh2257546_{128,256}.c: new test cases

https://bugzilla.redhat.com/show_bug.cgi?id=2257546
VEX/priv/guest_amd64_toIR.c
VEX/priv/ir_opt.c
memcheck/tests/amd64/Makefile.am
memcheck/tests/amd64/rh2257546_128.c [new file with mode: 0644]
memcheck/tests/amd64/rh2257546_128.stderr.exp [new file with mode: 0644]
memcheck/tests/amd64/rh2257546_128.stdout.exp [new file with mode: 0644]
memcheck/tests/amd64/rh2257546_128.vgtest [new file with mode: 0644]
memcheck/tests/amd64/rh2257546_256.c [new file with mode: 0644]
memcheck/tests/amd64/rh2257546_256.stderr.exp [new file with mode: 0644]
memcheck/tests/amd64/rh2257546_256.stdout.exp [new file with mode: 0644]
memcheck/tests/amd64/rh2257546_256.vgtest [new file with mode: 0644]