[AVX512] Added VPBROADCAST{BWDQ} (Load with Broadcast Integer Data from General Purpose Register) encodings for AVX512-BW/VL subsets

Added encoding tests.
        


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223787 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Robert Khasanov 2014-12-09 16:38:41 +00:00
parent b49ee78320
commit c50f9f15f5
5 changed files with 213 additions and 23 deletions

View File

@ -661,48 +661,58 @@ def : Pat<(int_x86_avx512_vbroadcast_ss_512 addr:$src),
def : Pat<(int_x86_avx512_vbroadcast_sd_512 addr:$src),
(VBROADCASTSDZm addr:$src)>;
multiclass avx512_int_broadcast_reg<bits<8> opc, string OpcodeStr,
RegisterClass SrcRC, RegisterClass KRC> {
def Zrr : AVX5128I<opc, MRMSrcReg, (outs VR512:$dst), (ins SrcRC:$src),
!strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
[]>, EVEX, EVEX_V512;
def Zkrr : AVX5128I<opc, MRMSrcReg, (outs VR512:$dst),
(ins KRC:$mask, SrcRC:$src),
!strconcat(OpcodeStr,
"\t{$src, $dst {${mask}} {z}|$dst {${mask}} {z}, $src}"),
[]>, EVEX, EVEX_V512, EVEX_KZ;
multiclass avx512_int_broadcast_reg<bits<8> opc, X86VectorVTInfo _,
RegisterClass SrcRC> {
defm r : AVX512_maskable_in_asm<opc, MRMSrcReg, _, (outs _.RC:$dst),
(ins SrcRC:$src), "vpbroadcast"##_.Suffix,
"$src", "$src", []>, T8PD, EVEX;
}
defm VPBROADCASTDr : avx512_int_broadcast_reg<0x7C, "vpbroadcastd", GR32, VK16WM>;
defm VPBROADCASTQr : avx512_int_broadcast_reg<0x7C, "vpbroadcastq", GR64, VK8WM>,
VEX_W;
multiclass avx512_int_broadcast_reg_vl<bits<8> opc, AVX512VLVectorVTInfo _,
RegisterClass SrcRC, Predicate prd> {
let Predicates = [prd] in
defm Z : avx512_int_broadcast_reg<opc, _.info512, SrcRC>, EVEX_V512;
let Predicates = [prd, HasVLX] in {
defm Z256 : avx512_int_broadcast_reg<opc, _.info256, SrcRC>, EVEX_V256;
defm Z128 : avx512_int_broadcast_reg<opc, _.info128, SrcRC>, EVEX_V128;
}
}
defm VPBROADCASTBr : avx512_int_broadcast_reg_vl<0x7A, avx512vl_i8_info, GR32,
HasBWI>;
defm VPBROADCASTWr : avx512_int_broadcast_reg_vl<0x7B, avx512vl_i16_info, GR32,
HasBWI>;
defm VPBROADCASTDr : avx512_int_broadcast_reg_vl<0x7C, avx512vl_i32_info, GR32,
HasAVX512>;
defm VPBROADCASTQr : avx512_int_broadcast_reg_vl<0x7C, avx512vl_i64_info, GR64,
HasAVX512>, VEX_W;
def : Pat <(v16i32 (X86vzext VK16WM:$mask)),
(VPBROADCASTDrZkrr VK16WM:$mask, (i32 (MOV32ri 0x1)))>;
(VPBROADCASTDrZrkz VK16WM:$mask, (i32 (MOV32ri 0x1)))>;
def : Pat <(v8i64 (X86vzext VK8WM:$mask)),
(VPBROADCASTQrZkrr VK8WM:$mask, (i64 (MOV64ri 0x1)))>;
(VPBROADCASTQrZrkz VK8WM:$mask, (i64 (MOV64ri 0x1)))>;
def : Pat<(v16i32 (X86VBroadcast (i32 GR32:$src))),
(VPBROADCASTDrZrr GR32:$src)>;
(VPBROADCASTDrZr GR32:$src)>;
def : Pat<(v16i32 (X86VBroadcastm VK16WM:$mask, (i32 GR32:$src))),
(VPBROADCASTDrZkrr VK16WM:$mask, GR32:$src)>;
(VPBROADCASTDrZrkz VK16WM:$mask, GR32:$src)>;
def : Pat<(v8i64 (X86VBroadcast (i64 GR64:$src))),
(VPBROADCASTQrZrr GR64:$src)>;
(VPBROADCASTQrZr GR64:$src)>;
def : Pat<(v8i64 (X86VBroadcastm VK8WM:$mask, (i64 GR64:$src))),
(VPBROADCASTQrZkrr VK8WM:$mask, GR64:$src)>;
(VPBROADCASTQrZrkz VK8WM:$mask, GR64:$src)>;
def : Pat<(v16i32 (int_x86_avx512_pbroadcastd_i32_512 (i32 GR32:$src))),
(VPBROADCASTDrZrr GR32:$src)>;
(VPBROADCASTDrZr GR32:$src)>;
def : Pat<(v8i64 (int_x86_avx512_pbroadcastq_i64_512 (i64 GR64:$src))),
(VPBROADCASTQrZrr GR64:$src)>;
(VPBROADCASTQrZr GR64:$src)>;
def : Pat<(v16i32 (int_x86_avx512_mask_pbroadcast_d_gpr_512 (i32 GR32:$src),
(v16i32 immAllZerosV), (i16 GR16:$mask))),
(VPBROADCASTDrZkrr (COPY_TO_REGCLASS GR16:$mask, VK16WM), GR32:$src)>;
(VPBROADCASTDrZrkz (COPY_TO_REGCLASS GR16:$mask, VK16WM), GR32:$src)>;
def : Pat<(v8i64 (int_x86_avx512_mask_pbroadcast_q_gpr_512 (i64 GR64:$src),
(bc_v8i64 (v16i32 immAllZerosV)), (i8 GR8:$mask))),
(VPBROADCASTQrZkrr (COPY_TO_REGCLASS GR8:$mask, VK8WM), GR64:$src)>;
(VPBROADCASTQrZrkz (COPY_TO_REGCLASS GR8:$mask, VK8WM), GR64:$src)>;
multiclass avx512_int_broadcast_rm<bits<8> opc, string OpcodeStr,
X86MemOperand x86memop, PatFrag ld_frag,

View File

@ -1513,6 +1513,42 @@
// CHECK: encoding: [0x62,0xe1,0xdd,0x58,0xdb,0x8a,0xf8,0xfb,0xff,0xff]
vpandq -1032(%rdx){1to8}, %zmm4, %zmm17
// CHECK: vpbroadcastd %eax, %zmm11
// CHECK: encoding: [0x62,0x72,0x7d,0x48,0x7c,0xd8]
vpbroadcastd %eax, %zmm11
// CHECK: vpbroadcastd %eax, %zmm11 {%k6}
// CHECK: encoding: [0x62,0x72,0x7d,0x4e,0x7c,0xd8]
vpbroadcastd %eax, %zmm11 {%k6}
// CHECK: vpbroadcastd %eax, %zmm11 {%k6} {z}
// CHECK: encoding: [0x62,0x72,0x7d,0xce,0x7c,0xd8]
vpbroadcastd %eax, %zmm11 {%k6} {z}
// CHECK: vpbroadcastd %ebp, %zmm11
// CHECK: encoding: [0x62,0x72,0x7d,0x48,0x7c,0xdd]
vpbroadcastd %ebp, %zmm11
// CHECK: vpbroadcastd %r13d, %zmm11
// CHECK: encoding: [0x62,0x52,0x7d,0x48,0x7c,0xdd]
vpbroadcastd %r13d, %zmm11
// CHECK: vpbroadcastq %rax, %zmm1
// CHECK: encoding: [0x62,0xf2,0xfd,0x48,0x7c,0xc8]
vpbroadcastq %rax, %zmm1
// CHECK: vpbroadcastq %rax, %zmm1 {%k6}
// CHECK: encoding: [0x62,0xf2,0xfd,0x4e,0x7c,0xc8]
vpbroadcastq %rax, %zmm1 {%k6}
// CHECK: vpbroadcastq %rax, %zmm1 {%k6} {z}
// CHECK: encoding: [0x62,0xf2,0xfd,0xce,0x7c,0xc8]
vpbroadcastq %rax, %zmm1 {%k6} {z}
// CHECK: vpbroadcastq %r8, %zmm1
// CHECK: encoding: [0x62,0xd2,0xfd,0x48,0x7c,0xc8]
vpbroadcastq %r8, %zmm1
// CHECK: vpcmpd $171, %zmm10, %zmm25, %k5
// CHECK: encoding: [0x62,0xd3,0x35,0x40,0x1f,0xea,0xab]
vpcmpd $171, %zmm10, %zmm25, %k5

View File

@ -72,6 +72,29 @@
// CHECK: encoding: [0x62,0xe1,0x3d,0x40,0xfd,0x8a,0xc0,0xdf,0xff,0xff]
vpaddw -8256(%rdx), %zmm24, %zmm17
// CHECK: vpbroadcastb %eax, %zmm19
// CHECK: encoding: [0x62,0xe2,0x7d,0x48,0x7a,0xd8]
vpbroadcastb %eax, %zmm19
// CHECK: vpbroadcastb %eax, %zmm19 {%k7}
// CHECK: encoding: [0x62,0xe2,0x7d,0x4f,0x7a,0xd8]
vpbroadcastb %eax, %zmm19 {%k7}
// CHECK: vpbroadcastb %eax, %zmm19 {%k7} {z}
// CHECK: encoding: [0x62,0xe2,0x7d,0xcf,0x7a,0xd8]
vpbroadcastb %eax, %zmm19 {%k7} {z}
// CHECK: vpbroadcastw %eax, %zmm24
// CHECK: encoding: [0x62,0x62,0x7d,0x48,0x7b,0xc0]
vpbroadcastw %eax, %zmm24
// CHECK: vpbroadcastw %eax, %zmm24 {%k1}
// CHECK: encoding: [0x62,0x62,0x7d,0x49,0x7b,0xc0]
vpbroadcastw %eax, %zmm24 {%k1}
// CHECK: vpbroadcastw %eax, %zmm24 {%k1} {z}
// CHECK: encoding: [0x62,0x62,0x7d,0xc9,0x7b,0xc0]
vpbroadcastw %eax, %zmm24 {%k1} {z}
// CHECK: vpcmpeqb %zmm26, %zmm26, %k4
// CHECK: encoding: [0x62,0x91,0x2d,0x40,0x74,0xe2]
vpcmpeqb %zmm26, %zmm26, %k4
@ -852,6 +875,7 @@
// CHECK: encoding: [0x62,0x61,0xff,0x48,0x7f,0xa2,0xc0,0xdf,0xff,0xff]
vmovdqu16 %zmm28, -8256(%rdx)
// CHECK: vpcmpb $171, %zmm25, %zmm26, %k3
// CHECK: encoding: [0x62,0x93,0x2d,0x40,0x3f,0xd9,0xab]
vpcmpb $171, %zmm25, %zmm26, %k3

View File

@ -144,6 +144,54 @@
// CHECK: encoding: [0x62,0xe1,0x55,0x20,0xfd,0xba,0xe0,0xef,0xff,0xff]
vpaddw -4128(%rdx), %ymm21, %ymm23
// CHECK: vpbroadcastb %eax, %xmm22
// CHECK: encoding: [0x62,0xe2,0x7d,0x08,0x7a,0xf0]
vpbroadcastb %eax, %xmm22
// CHECK: vpbroadcastb %eax, %xmm22 {%k3}
// CHECK: encoding: [0x62,0xe2,0x7d,0x0b,0x7a,0xf0]
vpbroadcastb %eax, %xmm22 {%k3}
// CHECK: vpbroadcastb %eax, %xmm22 {%k3} {z}
// CHECK: encoding: [0x62,0xe2,0x7d,0x8b,0x7a,0xf0]
vpbroadcastb %eax, %xmm22 {%k3} {z}
// CHECK: vpbroadcastb %eax, %ymm17
// CHECK: encoding: [0x62,0xe2,0x7d,0x28,0x7a,0xc8]
vpbroadcastb %eax, %ymm17
// CHECK: vpbroadcastb %eax, %ymm17 {%k1}
// CHECK: encoding: [0x62,0xe2,0x7d,0x29,0x7a,0xc8]
vpbroadcastb %eax, %ymm17 {%k1}
// CHECK: vpbroadcastb %eax, %ymm17 {%k1} {z}
// CHECK: encoding: [0x62,0xe2,0x7d,0xa9,0x7a,0xc8]
vpbroadcastb %eax, %ymm17 {%k1} {z}
// CHECK: vpbroadcastw %eax, %xmm29
// CHECK: encoding: [0x62,0x62,0x7d,0x08,0x7b,0xe8]
vpbroadcastw %eax, %xmm29
// CHECK: vpbroadcastw %eax, %xmm29 {%k1}
// CHECK: encoding: [0x62,0x62,0x7d,0x09,0x7b,0xe8]
vpbroadcastw %eax, %xmm29 {%k1}
// CHECK: vpbroadcastw %eax, %xmm29 {%k1} {z}
// CHECK: encoding: [0x62,0x62,0x7d,0x89,0x7b,0xe8]
vpbroadcastw %eax, %xmm29 {%k1} {z}
// CHECK: vpbroadcastw %eax, %ymm28
// CHECK: encoding: [0x62,0x62,0x7d,0x28,0x7b,0xe0]
vpbroadcastw %eax, %ymm28
// CHECK: vpbroadcastw %eax, %ymm28 {%k4}
// CHECK: encoding: [0x62,0x62,0x7d,0x2c,0x7b,0xe0]
vpbroadcastw %eax, %ymm28 {%k4}
// CHECK: vpbroadcastw %eax, %ymm28 {%k4} {z}
// CHECK: encoding: [0x62,0x62,0x7d,0xac,0x7b,0xe0]
vpbroadcastw %eax, %ymm28 {%k4} {z}
// CHECK: vpcmpeqb %xmm21, %xmm21, %k4
// CHECK: encoding: [0x62,0xb1,0x55,0x00,0x74,0xe5]
vpcmpeqb %xmm21, %xmm21, %k4

View File

@ -2692,6 +2692,78 @@
// CHECK: encoding: [0x62,0x61,0xad,0x30,0xdb,0x8a,0xf8,0xfb,0xff,0xff]
vpandq -1032(%rdx){1to4}, %ymm26, %ymm25
// CHECK: vpbroadcastd %eax, %xmm22
// CHECK: encoding: [0x62,0xe2,0x7d,0x08,0x7c,0xf0]
vpbroadcastd %eax, %xmm22
// CHECK: vpbroadcastd %eax, %xmm22 {%k5}
// CHECK: encoding: [0x62,0xe2,0x7d,0x0d,0x7c,0xf0]
vpbroadcastd %eax, %xmm22 {%k5}
// CHECK: vpbroadcastd %eax, %xmm22 {%k5} {z}
// CHECK: encoding: [0x62,0xe2,0x7d,0x8d,0x7c,0xf0]
vpbroadcastd %eax, %xmm22 {%k5} {z}
// CHECK: vpbroadcastd %ebp, %xmm22
// CHECK: encoding: [0x62,0xe2,0x7d,0x08,0x7c,0xf5]
vpbroadcastd %ebp, %xmm22
// CHECK: vpbroadcastd %r13d, %xmm22
// CHECK: encoding: [0x62,0xc2,0x7d,0x08,0x7c,0xf5]
vpbroadcastd %r13d, %xmm22
// CHECK: vpbroadcastd %eax, %ymm25
// CHECK: encoding: [0x62,0x62,0x7d,0x28,0x7c,0xc8]
vpbroadcastd %eax, %ymm25
// CHECK: vpbroadcastd %eax, %ymm25 {%k5}
// CHECK: encoding: [0x62,0x62,0x7d,0x2d,0x7c,0xc8]
vpbroadcastd %eax, %ymm25 {%k5}
// CHECK: vpbroadcastd %eax, %ymm25 {%k5} {z}
// CHECK: encoding: [0x62,0x62,0x7d,0xad,0x7c,0xc8]
vpbroadcastd %eax, %ymm25 {%k5} {z}
// CHECK: vpbroadcastd %ebp, %ymm25
// CHECK: encoding: [0x62,0x62,0x7d,0x28,0x7c,0xcd]
vpbroadcastd %ebp, %ymm25
// CHECK: vpbroadcastd %r13d, %ymm25
// CHECK: encoding: [0x62,0x42,0x7d,0x28,0x7c,0xcd]
vpbroadcastd %r13d, %ymm25
// CHECK: vpbroadcastq %rax, %xmm22
// CHECK: encoding: [0x62,0xe2,0xfd,0x08,0x7c,0xf0]
vpbroadcastq %rax, %xmm22
// CHECK: vpbroadcastq %rax, %xmm22 {%k2}
// CHECK: encoding: [0x62,0xe2,0xfd,0x0a,0x7c,0xf0]
vpbroadcastq %rax, %xmm22 {%k2}
// CHECK: vpbroadcastq %rax, %xmm22 {%k2} {z}
// CHECK: encoding: [0x62,0xe2,0xfd,0x8a,0x7c,0xf0]
vpbroadcastq %rax, %xmm22 {%k2} {z}
// CHECK: vpbroadcastq %r8, %xmm22
// CHECK: encoding: [0x62,0xc2,0xfd,0x08,0x7c,0xf0]
vpbroadcastq %r8, %xmm22
// CHECK: vpbroadcastq %rax, %ymm19
// CHECK: encoding: [0x62,0xe2,0xfd,0x28,0x7c,0xd8]
vpbroadcastq %rax, %ymm19
// CHECK: vpbroadcastq %rax, %ymm19 {%k5}
// CHECK: encoding: [0x62,0xe2,0xfd,0x2d,0x7c,0xd8]
vpbroadcastq %rax, %ymm19 {%k5}
// CHECK: vpbroadcastq %rax, %ymm19 {%k5} {z}
// CHECK: encoding: [0x62,0xe2,0xfd,0xad,0x7c,0xd8]
vpbroadcastq %rax, %ymm19 {%k5} {z}
// CHECK: vpbroadcastq %r8, %ymm19
// CHECK: encoding: [0x62,0xc2,0xfd,0x28,0x7c,0xd8]
vpbroadcastq %r8, %ymm19
// CHECK: vpcmpd $171, %xmm20, %xmm23, %k4
// CHECK: encoding: [0x62,0xb3,0x45,0x00,0x1f,0xe4,0xab]
vpcmpd $171, %xmm20, %xmm23, %k4