Skip to content

Commit 9634633

Browse files
phoebewangllvmbot
authored andcommitted
[X86][APX] Do not emit {evex} prefix for memory variant (#109759)
This was mistakely changed by #109579, which doesn't match with other EVEX decoding. (cherry picked from commit 70529b2)
1 parent 0ab42b3 commit 9634633

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

llvm/lib/Target/X86/X86InstrAVX512.td

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,20 +2617,19 @@ defm VFPCLASS : avx512_fp_fpclass_all<"vfpclass", 0x66, 0x67, SchedWriteFCmp>, E
26172617
multiclass avx512_mask_mov<bits<8> opc_kk, bits<8> opc_km, bits<8> opc_mk,
26182618
string OpcodeStr, RegisterClass KRC, ValueType vvt,
26192619
X86MemOperand x86memop, string Suffix = ""> {
2620-
let explicitOpPrefix = !if(!eq(Suffix, ""), NoExplicitOpPrefix, ExplicitEVEX) in {
2621-
let isMoveReg = 1, hasSideEffects = 0, SchedRW = [WriteMove] in
2622-
def kk#Suffix : I<opc_kk, MRMSrcReg, (outs KRC:$dst), (ins KRC:$src),
2623-
!strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"), []>,
2624-
Sched<[WriteMove]>;
2625-
def km#Suffix : I<opc_km, MRMSrcMem, (outs KRC:$dst), (ins x86memop:$src),
2626-
!strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
2627-
[(set KRC:$dst, (vvt (load addr:$src)))]>,
2628-
Sched<[WriteLoad]>, NoCD8;
2629-
def mk#Suffix : I<opc_mk, MRMDestMem, (outs), (ins x86memop:$dst, KRC:$src),
2630-
!strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
2631-
[(store KRC:$src, addr:$dst)]>,
2632-
Sched<[WriteStore]>, NoCD8;
2633-
}
2620+
let isMoveReg = 1, hasSideEffects = 0, SchedRW = [WriteMove],
2621+
explicitOpPrefix = !if(!eq(Suffix, ""), NoExplicitOpPrefix, ExplicitEVEX) in
2622+
def kk#Suffix : I<opc_kk, MRMSrcReg, (outs KRC:$dst), (ins KRC:$src),
2623+
!strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"), []>,
2624+
Sched<[WriteMove]>;
2625+
def km#Suffix : I<opc_km, MRMSrcMem, (outs KRC:$dst), (ins x86memop:$src),
2626+
!strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
2627+
[(set KRC:$dst, (vvt (load addr:$src)))]>,
2628+
Sched<[WriteLoad]>, NoCD8;
2629+
def mk#Suffix : I<opc_mk, MRMDestMem, (outs), (ins x86memop:$dst, KRC:$src),
2630+
!strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
2631+
[(store KRC:$src, addr:$dst)]>,
2632+
Sched<[WriteStore]>, NoCD8;
26342633
}
26352634

26362635
multiclass avx512_mask_mov_gpr<bits<8> opc_kr, bits<8> opc_rk,

llvm/test/MC/Disassembler/X86/apx/kmov.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
# INTEL: {evex} kmovq k2, k1
1818
0x62,0xf1,0xfc,0x08,0x90,0xd1
1919

20-
# ATT: {evex} kmovb -16(%rax), %k0
21-
# INTEL: {evex} kmovb k0, byte ptr [rax - 16]
20+
# ATT: kmovb -16(%rax), %k0
21+
# INTEL: kmovb k0, byte ptr [rax - 16]
2222
0x62,0xf1,0x7d,0x08,0x90,0x40,0xf0
2323

24-
# ATT: {evex} kmovw -16(%rax), %k0
25-
# INTEL: {evex} kmovw k0, word ptr [rax - 16]
24+
# ATT: kmovw -16(%rax), %k0
25+
# INTEL: kmovw k0, word ptr [rax - 16]
2626
0x62,0xf1,0x7c,0x08,0x90,0x40,0xf0
2727

28-
# ATT: {evex} kmovd -16(%rax), %k0
29-
# INTEL: {evex} kmovd k0, dword ptr [rax - 16]
28+
# ATT: kmovd -16(%rax), %k0
29+
# INTEL: kmovd k0, dword ptr [rax - 16]
3030
0x62,0xf1,0xfd,0x08,0x90,0x40,0xf0
3131

32-
# ATT: {evex} kmovq -16(%rax), %k0
33-
# INTEL: {evex} kmovq k0, qword ptr [rax - 16]
32+
# ATT: kmovq -16(%rax), %k0
33+
# INTEL: kmovq k0, qword ptr [rax - 16]
3434
0x62,0xf1,0xfc,0x08,0x90,0x40,0xf0
3535

3636
# ATT-NOT: {evex}

0 commit comments

Comments
 (0)