aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
diff options
context:
space:
mode:
authorShengchen Kan <shengchen.kan@intel.com>2023-11-23 16:17:17 +0800
committerGitHub <noreply@github.com>2023-11-23 16:17:17 +0800
commita3cab1fa17ebf29b01fcb566648e2f3fb2955993 (patch)
tree6888801e502e268b878e321e5f038fe36bfcf6cb /llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
parentd76d8e541dab6d65b2490957707341352eac8320 (diff)
downloadllvm-a3cab1fa17ebf29b01fcb566648e2f3fb2955993.zip
llvm-a3cab1fa17ebf29b01fcb566648e2f3fb2955993.tar.gz
llvm-a3cab1fa17ebf29b01fcb566648e2f3fb2955993.tar.bz2
[X86][MC] Support encoding/decoding for PUSHP/POPP (#73092)
A PUSH and its corresponding POP may be marked with a 1-bit Push-Pop Acceleration (PPX) hint to indicate that the POP reads the value written by the PUSH from the stack. The PPX hint is encoded by setting REX2.W = 1 and is applicable only to PUSH with opcode 0x50+rd and POP with opcode 0x58+rd in the legacy space. It is not applicable to any other variants of PUSH and POP.
Diffstat (limited to 'llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp')
-rw-r--r--llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp b/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
index 3e42499..d5218d3 100644
--- a/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
+++ b/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
@@ -1257,9 +1257,9 @@ static int getInstructionID(struct InternalInstruction *insn,
attrMask &= ~ATTR_ADSIZE;
}
- // Absolute jump need special handling
+ // Absolute jump and pushp/popp need special handling
if (insn->rex2ExtensionPrefix[0] == 0xd5 && insn->opcodeType == ONEBYTE &&
- insn->opcode == 0xA1)
+ (insn->opcode == 0xA1 || (insn->opcode & 0xf0) == 0x50))
attrMask |= ATTR_REX2;
if (insn->mode == MODE_16BIT) {