-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
A few discrepancies in X86-64 Instruction Semantics #376
Comments
@sdasgup3 Can you verify if the fixes are acceptable? |
Sure, I will. |
Thanks, @kumarak & @pgoodman for the fixes. Most of the semantics got fixed except for the followings. Also, I have attached the artfacts against which I am comparing.
The X86 semantics generates the following summary for the
and symbolically executing the LLVM IR that remill generates gives the following summary (with embedded comments to highlight the potential discrepenacy)
You may reproduce the error using
|
@sdasgup3 does the issue_376 branch resolve these issues? |
Hi @pgoodman
Let me know if I need to provide any other information. |
* New x86 instructions * Add some isels * Fixes Issue #376 * Fixes Issue #433. Thanks @adahsuzixin for the semantics and tests * Fixes Issue #374 * Minor fix to the semantics for VINSERTF128, it should only look at the low bit of imm8 * Minor fixes for sparc isel naming
Hello Team,
I was validating McSema's semantics of various x86-64 instructions against the formal sematics using solver checks and found the following discrepancies.
Reasons
R1
The Intel Manual says the implementation should be
DEST←NOT(DEST) AND SRC
, whereas McSema performsDEST←NOT(SRC) AND DEST
R2
The Intel Manual says the implementation should be
OTOH McSema performs
DEST[63:0] ← DEST[31:0] ∗ SRC[31:0];
As per the Manual, the semantics should be
For
cmpxchgl %ecx, %ebx
However, McSema compares the entire
64'DEST
, which is TEMP as per the above pseudocode, against the accumulatorConcat(32'0, RAX[31:0])
For
cmpxchgb %ah, %al
,The control should get into the
THEN
part which must lead toDEST (al) <- SRC(ah)
. However, McSema keeps the lower 8 bits of RAX unchanged.Please note that all the bugs are double-checked by looking into the lifted IR that McSema generated for these cases. We hope that this information might be useful to you.
Let me know your opinion.
The text was updated successfully, but these errors were encountered: