Bug 406132 - vex amd64->IR: CMPS without rep prefix is not handled
Summary: vex amd64->IR: CMPS without rep prefix is not handled
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (other bugs)
Version First Reported In: 3.14.0
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-02 04:20 UTC by Ignacio Losiggio
Modified: 2019-04-02 04:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Patch fixing the issue like it was fixed in movs (853 bytes, patch)
2019-04-02 04:20 UTC, Ignacio Losiggio
Details
Example strcmp implementation using cmpsb without a rep prefix (253 bytes, text/plain)
2019-04-02 04:21 UTC, Ignacio Losiggio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacio Losiggio 2019-04-02 04:20:02 UTC
Created attachment 119205 [details]
Patch fixing the issue like it was fixed in movs

SUMMARY
The instruction CMPS{B,W,D,Q} can be used with or without prefix, the x86->IR valgrind backend supports the instruction without prefix but the amd64 one does not.

Attached to the issue is a patch fixing it.

STEPS TO REPRODUCE
1. Write any small program that uses cmps{b,w,d,q} on amd64.

OBSERVED RESULT
VEX will say that the instructions is not handled.

EXPECTED RESULT
Correct handling of the instruction like in the x86->IR backend
Comment 1 Ignacio Losiggio 2019-04-02 04:21:45 UTC
Created attachment 119206 [details]
Example strcmp implementation using cmpsb without a rep prefix

Added example code.