Bug 493003

Summary: amd64: Support cmps repnz prefix and non-repeating cases
Product: [Developer tools] valgrind Reporter: Matt Borgerson <contact>
Component: vexAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 3.23 GIT   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch

Description Matt Borgerson 2024-09-12 06:19:36 UTC
Created attachment 173576 [details]
Patch

SUMMARY

Attached patch adds support for repnz prefix, which is another encoding for rep cmps, and the case where there is no rep prefix for a cmps instruction.

Closes 253436, 340469, 406132

STEPS TO REPRODUCE

Build and run https://github.com/qemu/qemu/blob/master/tests/tcg/i386/test-i386.c

OBSERVED RESULT

Crash when these instructions are encountered.

EXPECTED RESULT

cmps should work with the repnz prefix, and without a rep prefix.

SOFTWARE/OS VERSIONS
Valgrind: VALGRIND_3_23_0-108-g5d404b97d

ADDITIONAL INFORMATION

Discovered via QEMU differential tests. A version of these tests, with these particular cases commented out, are in Valgrind at /VEX/test/test-amd64.c, but the test in Valgrind repo does not compile.
Comment 1 Matt Borgerson 2024-09-12 06:26:24 UTC
Unfortunately I cannot edit the above comment, so please ignore my obvious error in description:

> which is another encoding for rep cmps,