From 467839f2f5103fe06ae48b20950aa0ec3a5ae3bd Mon Sep 17 00:00:00 2001 From: Elena Demikhovsky Date: Sun, 26 Oct 2014 09:52:24 +0000 Subject: [PATCH] AVX-512: Fixed encoding of VPBROADCASTM and added SKX forms of this instruction llvm-svn: 220638 --- lib/Target/X86/X86InstrAVX512.td | 25 +++++++++++++++++-------- test/MC/Disassembler/X86/avx-512.txt | 9 ++++++++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/Target/X86/X86InstrAVX512.td b/lib/Target/X86/X86InstrAVX512.td index 05c09e25ed5..3853e15db0a 100644 --- a/lib/Target/X86/X86InstrAVX512.td +++ b/lib/Target/X86/X86InstrAVX512.td @@ -735,18 +735,27 @@ def : Pat<(v8i32 (X86VBroadcastm (v8i1 VK8WM:$mask), (loadi32 addr:$src))), //--- multiclass avx512_mask_broadcast opc, string OpcodeStr, - RegisterClass DstRC, RegisterClass KRC, - ValueType OpVT, ValueType SrcVT> { -def rr : AVX512XS8I { +let Predicates = [HasCDI] in +def Zrr : AVX512XS8I, EVEX; + []>, EVEX, EVEX_V512; + +let Predicates = [HasCDI, HasVLX] in { +def Z128rr : AVX512XS8I, EVEX, EVEX_V128; +def Z256rr : AVX512XS8I, EVEX, EVEX_V256; +} } let Predicates = [HasCDI] in { -defm VPBROADCASTMW2D : avx512_mask_broadcast<0x3A, "vpbroadcastmw2d", VR512, - VK16, v16i32, v16i1>, EVEX_V512; -defm VPBROADCASTMB2Q : avx512_mask_broadcast<0x2A, "vpbroadcastmb2q", VR512, - VK8, v8i64, v8i1>, EVEX_V512, VEX_W; +defm VPBROADCASTMW2D : avx512_mask_broadcast<0x3A, "vpbroadcastmw2d", + VK16>; +defm VPBROADCASTMB2Q : avx512_mask_broadcast<0x2A, "vpbroadcastmb2q", + VK8>, VEX_W; } //===----------------------------------------------------------------------===// diff --git a/test/MC/Disassembler/X86/avx-512.txt b/test/MC/Disassembler/X86/avx-512.txt index f78db552935..62fc35bd1cf 100644 --- a/test/MC/Disassembler/X86/avx-512.txt +++ b/test/MC/Disassembler/X86/avx-512.txt @@ -1,4 +1,5 @@ # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 -mcpu=knl | FileCheck %s +# RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 -mcpu=skx | FileCheck --check-prefix=CHECK-SKX %s # CHECK: vpbroadcastd %xmm18, %zmm28 {%k7} {z} 0x62 0x22 0x7d 0xcf 0x58 0xe2 @@ -13,7 +14,13 @@ 0x62 0x32 0xed 0x48 0x16 0x04 0x96 # CHECK: vpbroadcastmw2d %k2, %zmm8 -0x62 0xd2 0x7e 0x48 0x3a 0xd0 +0x62 0x72 0x7e 0x48 0x3a 0xc2 + +# CHECK-SKX: vpbroadcastmw2d %k2, %xmm8 +0x62 0x72 0x7e 0x08 0x3a 0xc2 + +# CHECK-SKX: vpbroadcastmw2d %k2, %ymm8 +0x62 0x72 0x7e 0x28 0x3a 0xc2 # CHECK: vpbroadcastq (%r9,%rax), %zmm28 0x62 0x42 0xfd 0x48 0x59 0x24 0x01