Skip to content
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

x86: Sign-extend 32-bit immediates for 64-bit SBB instructions #6521

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sleigh-InSPECtor
Copy link
Contributor

The 64-bit immediate form of the SBB (Integer Subtraction With Borrow) instruction, uses the wrong field variant for the immediate, causing it to be zero-extended instead of sign-extended.

e.g.:

4f1dffffffff "SBB RAX,-0x1"

  • Hardware Reference (AMD CPU): { RAX=0x1, CF=1, SF=0 }
  • x86:LE:64:default (Existing): "SBB RAX,0xffffffff" { RAX=0xffffffff00000001, CF=1, SF=1 }
  • x86:LE:64:default (This patch): "SBB RAX,-0x1" { RAX=0x1, CF=1, SF=0 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Processor/x86 Status: Triage Information is being gathered
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants