diff options
author | Shengchen Kan <shengchen.kan@intel.com> | 2023-11-24 12:29:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-24 12:29:56 +0800 |
commit | 8c2537fde66406dd08021d28e302e1cdb862fc3f (patch) | |
tree | 14364168d20184b1f520b6dbd1d321b0a4cdbff8 /llvm/utils/TableGen/X86DisassemblerTables.cpp | |
parent | be0307d5769f87a2e64b7e9e78a78bcd3dcca800 (diff) | |
download | llvm-8c2537fde66406dd08021d28e302e1cdb862fc3f.zip llvm-8c2537fde66406dd08021d28e302e1cdb862fc3f.tar.gz llvm-8c2537fde66406dd08021d28e302e1cdb862fc3f.tar.bz2 |
[X86][MC] Support encoding/decoding for PUSH2[P]/POP2[P] (#73233)
PUSH2 and POP2 are two new instructions for (respectively)
pushing/popping 2 GPRs at a time to/from
the stack. The opcodes of PUSH2 and POP2 are those of “PUSH r/m” and
“POP r/m” from legacy map 0, but we
require ModRM.Mod = 3 in order to disallow memory operand.
The 1-bit Push-Pop Acceleration hint described in #73092 applies to
PUSH2/POP2 too, then we have PUSH2P/POP2P.
For AT&T syntax, PUSH2[P] pushes the registers from right to left onto
the stack. POP2[P] pops the stack to registers from right to left. Intel
syntax has the opposite order - from left to right.
The assembly syntax is aligned with GCC & binutils
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637718.html
Diffstat (limited to 'llvm/utils/TableGen/X86DisassemblerTables.cpp')
-rw-r--r-- | llvm/utils/TableGen/X86DisassemblerTables.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/X86DisassemblerTables.cpp b/llvm/utils/TableGen/X86DisassemblerTables.cpp index e8dffaa..f879a9f 100644 --- a/llvm/utils/TableGen/X86DisassemblerTables.cpp +++ b/llvm/utils/TableGen/X86DisassemblerTables.cpp @@ -983,9 +983,10 @@ void DisassemblerTables::emitContextDecisions(raw_ostream &o1, raw_ostream &o2, emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[5], XOP9_MAP_STR); emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[6], XOPA_MAP_STR); emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[7], THREEDNOW_MAP_STR); - emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[8], MAP5_STR); - emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[9], MAP6_STR); - emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[10], MAP7_STR); + emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[8], MAP4_STR); + emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[9], MAP5_STR); + emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[10], MAP6_STR); + emitContextDecision(o1, o2, i1, i2, ModRMTableNum, *Tables[11], MAP7_STR); } void DisassemblerTables::emit(raw_ostream &o) const { |