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

            Bug ID: 360415
           Summary: amd64 instructions ADCX and ADOX are not implemented
                    in VEX
           Product: valgrind
           Version: unspecified
          Platform: unspecified
                OS: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: vex
          Assignee: jsew...@acm.org
          Reporter: jacobly....@gmail.com

I have written and tested a patch that adds these instructions to VEX guest
amd64.

Reproducible: Always

Steps to Reproduce:
Run a program under valgrind that executes an ADCX or ADOX instruction.

Actual Results:  
 $ valgrind VEX/test/test-amd64 >/dev/null
==30659== Memcheck, a memory error detector
==30659== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==30659== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==30659== Command: VEX/test/test-amd64
==30659== 
vex amd64->IR: unhandled instruction bytes: 0x66 0x48 0xF 0x38 0xF6 0xD1 0x9C
0x58
vex amd64->IR:   REX=1 REX.W=1 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F38
vex amd64->IR:   PFX.66=1 PFX.F2=0 PFX.F3=0
==30659== valgrind: Unrecognised instruction at address 0x404713.
==30659==    at 0x404713: exec_adcxq (test-amd64.h:69)
==30659==    by 0x4048E6: exec_adcx (test-amd64.h:123)
==30659==    by 0x404981: test_adcx (test-amd64.h:166)
==30659==    by 0x410EA5: main (test-amd64.c:1699)
==30659== Your program just tried to execute an instruction that Valgrind
==30659== did not recognise.  There are two possible reasons for this.
==30659== 1. Your program has a bug and erroneously jumped to a non-code
==30659==    location.  If you are running Memcheck and you just saw a
==30659==    warning about a bad jump, it's probably your program's fault.
==30659== 2. The instruction is legitimate but Valgrind doesn't handle it,
==30659==    i.e. it's Valgrind's fault.  If you think this is the case or
==30659==    you are not sure, please let us know and we'll try to fix it.
==30659== Either way, Valgrind will now raise a SIGILL signal which will
==30659== probably kill your program.
==30659== 
==30659== Process terminating with default action of signal 4 (SIGILL)
==30659==  Illegal opcode at address 0x404713
==30659==    at 0x404713: exec_adcxq (test-amd64.h:69)
==30659==    by 0x4048E6: exec_adcx (test-amd64.h:123)
==30659==    by 0x404981: test_adcx (test-amd64.h:166)
==30659==    by 0x410EA5: main (test-amd64.c:1699)
==30659== 
==30659== HEAP SUMMARY:
==30659==     in use at exit: 0 bytes in 0 blocks
==30659==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==30659== 
==30659== All heap blocks were freed -- no leaks are possible
==30659== 
==30659== For counts of detected and suppressed errors, rerun with: -v
==30659== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction


Expected Results:  
 $ diff -s <(VEX/test/test-amd64) <(./vg-in-place VEX/test/test-amd64)
==9408== Memcheck, a memory error detector
==9408== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==9408== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==9408== Command: VEX/test/test-amd64
==9408== 
==9408== 
==9408== HEAP SUMMARY:
==9408==     in use at exit: 0 bytes in 0 blocks
==9408==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==9408== 
==9408== All heap blocks were freed -- no leaks are possible
==9408== 
==9408== For counts of detected and suppressed errors, rerun with: -v
==9408== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Files /dev/fd/63 and /dev/fd/62 are identical


MULX is already implemented since it is part of BMI2.

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

Reply via email to