Skip to content

Commit 7f8ea96

Browse files
committed
[X86][MC] Support Enc/Dec for EGPR for promoted INVPCID instruction
1 parent 68f0bc6 commit 7f8ea96

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

llvm/lib/Target/X86/X86InstrSystem.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,11 @@ def INVPCID32 : I<0x82, MRMSrcMem, (outs), (ins GR32:$src1, i128mem:$src2),
679679
def INVPCID64 : I<0x82, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2),
680680
"invpcid\t{$src2, $src1|$src1, $src2}", []>, T8PD,
681681
Requires<[In64BitMode, HasINVPCID]>;
682+
683+
let CD8_Scale = 0 in
684+
def INVPCID64_EVEX : I<0xF2, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2),
685+
"invpcid\t{$src2, $src1|$src1, $src2}", []>,
686+
EVEX, T_MAP4XS, Requires<[In64BitMode, HasINVPCID]>;
682687
} // SchedRW
683688

684689
let Predicates = [In64BitMode, HasINVPCID] in {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
2+
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
3+
4+
# ATT: invpcid 291(%r28,%r29,4), %r19
5+
# INTEL: invpcid r19, xmmword ptr [r28 + 4*r29 + 291]
6+
0x62,0x8c,0x7a,0x08,0xf2,0x9c,0xac,0x23,0x01,0x00,0x00

llvm/test/MC/X86/apx/invpcid-att.s

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
2+
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
3+
4+
# ERROR-COUNT-1: error:
5+
# ERROR-NOT: error:
6+
# CHECK: invpcid 291(%r28,%r29,4), %r19
7+
# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf2,0x9c,0xac,0x23,0x01,0x00,0x00]
8+
invpcid 291(%r28,%r29,4), %r19

llvm/test/MC/X86/apx/invpcid-intel.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
2+
3+
# CHECK: invpcid r19, xmmword ptr [r28 + 4*r29 + 291]
4+
# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf2,0x9c,0xac,0x23,0x01,0x00,0x00]
5+
invpcid r19, xmmword ptr [r28 + 4*r29 + 291]

0 commit comments

Comments
 (0)