-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add psubq
instruction (x86)
#2553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one small comment but it looks good to me otherwise!
manticore/native/cpu/x86.py
Outdated
for i in reversed(range(0, dest.size, 64)): | ||
a = Operators.EXTRACT(value_a, i, 64) | ||
b = Operators.EXTRACT(value_b, i, 64) | ||
result.append((a - b) & 0xFFFFFFFFFFFFFFFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are subtracting on 64 bits already so I don't think masking with 0xffffffffffffffff
is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! I thought it should be used to explicitly mask any negative results, but I think this is also done in CONCAT
so I will remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah bitvector arithmetic will round up to 64 bits anyway.
* master: Add `psubq` instruction (x86) (#2553)
Adds support for
psubq
x86 instruction. Implementation very similar topsubb
.