-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
Showing
5 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# RUN: llvm-mc -triple x86_64 -disassemble %s | FileCheck %s --check-prefix=ATT | ||
# RUN: llvm-mc -triple x86_64 -disassemble -output-asm-variant=1 %s | FileCheck %s --check-prefix=INTEL | ||
|
||
# ATT: pushp %rax | ||
# INTEL: pushp rax | ||
0xd5,0x08,0x50 | ||
|
||
# ATT: pushp %rbx | ||
# INTEL: pushp rbx | ||
0xd5,0x08,0x53 | ||
|
||
# ATT: pushp %r15 | ||
# INTEL: pushp r15 | ||
0xd5,0x09,0x57 | ||
|
||
# ATT: pushp %r16 | ||
# INTEL: pushp r16 | ||
0xd5,0x18,0x50 | ||
|
||
# ATT: popp %rax | ||
# INTEL: popp rax | ||
0xd5,0x08,0x58 | ||
|
||
# ATT: popp %rbx | ||
# INTEL: popp rbx | ||
0xd5,0x08,0x5b | ||
|
||
# ATT: popp %r15 | ||
# INTEL: popp r15 | ||
0xd5,0x09,0x5f | ||
|
||
# ATT: popp %r16 | ||
# INTEL: popp r16 | ||
0xd5,0x18,0x58 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# RUN: llvm-mc -triple x86_64 -show-encoding %s | FileCheck %s | ||
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR | ||
|
||
# ERROR-COUNT-8: error: | ||
# ERROR-NOT: error: | ||
|
||
# CHECK: pushp %rax | ||
# CHECK: encoding: [0xd5,0x08,0x50] | ||
pushp %rax | ||
# CHECK: pushp %rbx | ||
# CHECK: encoding: [0xd5,0x08,0x53] | ||
pushp %rbx | ||
# CHECK: pushp %r15 | ||
# CHECK: encoding: [0xd5,0x09,0x57] | ||
pushp %r15 | ||
# CHECK: pushp %r16 | ||
# CHECK: encoding: [0xd5,0x18,0x50] | ||
pushp %r16 | ||
|
||
# CHECK: popp %rax | ||
# CHECK: encoding: [0xd5,0x08,0x58] | ||
popp %rax | ||
# CHECK: popp %rbx | ||
# CHECK: encoding: [0xd5,0x08,0x5b] | ||
popp %rbx | ||
# CHECK: popp %r15 | ||
# CHECK: encoding: [0xd5,0x09,0x5f] | ||
popp %r15 | ||
# CHECK: popp %r16 | ||
# CHECK: encoding: [0xd5,0x18,0x58] | ||
popp %r16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# RUN: llvm-mc -triple x86_64 -show-encoding -x86-asm-syntax=intel -output-asm-variant=1 %s | FileCheck %s | ||
|
||
# CHECK: pushp rax | ||
# CHECK: encoding: [0xd5,0x08,0x50] | ||
pushp rax | ||
# CHECK: pushp rbx | ||
# CHECK: encoding: [0xd5,0x08,0x53] | ||
pushp rbx | ||
# CHECK: pushp r15 | ||
# CHECK: encoding: [0xd5,0x09,0x57] | ||
pushp r15 | ||
# CHECK: pushp r16 | ||
# CHECK: encoding: [0xd5,0x18,0x50] | ||
pushp r16 | ||
|
||
# CHECK: popp rax | ||
# CHECK: encoding: [0xd5,0x08,0x58] | ||
popp rax | ||
# CHECK: popp rbx | ||
# CHECK: encoding: [0xd5,0x08,0x5b] | ||
popp rbx | ||
# CHECK: popp r15 | ||
# CHECK: encoding: [0xd5,0x09,0x5f] | ||
popp r15 | ||
# CHECK: popp r16 | ||
# CHECK: encoding: [0xd5,0x18,0x58] | ||
popp r16 |