2015-11-30 18:40:52 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2015-12-06 19:35:18 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512BW
|
|
|
|
; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mcpu=knl -mattr=+avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512F-32
|
2014-09-30 19:32:22 +08:00
|
|
|
|
2015-05-04 17:14:02 +08:00
|
|
|
define <32 x i16> @test_mask_packs_epi32_rr_512(<16 x i32> %a, <16 x i32> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackssdw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpackssdw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
ret <32 x i16> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rrk_512(<16 x i32> %a, <16 x i32> %b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackssdw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackssdw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> %passThru
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rrkz_512(<16 x i32> %a, <16 x i32> %b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackssdw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackssdw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rm_512(<16 x i32> %a, <16 x i32>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackssdw (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpackssdw (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <16 x i32>, <16 x i32>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
ret <32 x i16> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rmk_512(<16 x i32> %a, <16 x i32>* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackssdw (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackssdw (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <16 x i32>, <16 x i32>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> %passThru
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rmkz_512(<16 x i32> %a, <16 x i32>* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackssdw (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackssdw (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <16 x i32>, <16 x i32>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rmb_512(<16 x i32> %a, i32* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rmb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackssdw (%rdi){1to16}, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rmb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpackssdw (%eax){1to16}, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%q = load i32, i32* %ptr_b
|
|
|
|
%vecinit.i = insertelement <16 x i32> undef, i32 %q, i32 0
|
|
|
|
%b = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
ret <32 x i16> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rmbk_512(<16 x i32> %a, i32* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rmbk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackssdw (%rdi){1to16}, %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rmbk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackssdw (%eax){1to16}, %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%q = load i32, i32* %ptr_b
|
|
|
|
%vecinit.i = insertelement <16 x i32> undef, i32 %q, i32 0
|
|
|
|
%b = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> %passThru
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packs_epi32_rmbkz_512(<16 x i32> %a, i32* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi32_rmbkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackssdw (%rdi){1to16}, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi32_rmbkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackssdw (%eax){1to16}, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%q = load i32, i32* %ptr_b
|
|
|
|
%vecinit.i = insertelement <16 x i32> undef, i32 %q, i32 0
|
|
|
|
%b = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
2017-02-16 14:31:54 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.packssdw.512(<16 x i32>, <16 x i32>)
|
2015-05-04 17:14:02 +08:00
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packs_epi16_rr_512(<32 x i16> %a, <32 x i16> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpacksswb %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpacksswb %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packsswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
ret <64 x i8> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packs_epi16_rrk_512(<32 x i16> %a, <32 x i16> %b, <64 x i8> %passThru, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rdi, %k1
|
|
|
|
; AVX512BW-NEXT: vpacksswb %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpacksswb %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packsswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> %passThru
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packs_epi16_rrkz_512(<32 x i16> %a, <32 x i16> %b, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rdi, %k1
|
|
|
|
; AVX512BW-NEXT: vpacksswb %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpacksswb %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packsswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> zeroinitializer
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packs_epi16_rm_512(<32 x i16> %a, <32 x i16>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpacksswb (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpacksswb (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packsswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
ret <64 x i8> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packs_epi16_rmk_512(<32 x i16> %a, <32 x i16>* %ptr_b, <64 x i8> %passThru, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rsi, %k1
|
|
|
|
; AVX512BW-NEXT: vpacksswb (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpacksswb (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packsswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> %passThru
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packs_epi16_rmkz_512(<32 x i16> %a, <32 x i16>* %ptr_b, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packs_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rsi, %k1
|
|
|
|
; AVX512BW-NEXT: vpacksswb (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packs_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpacksswb (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packsswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> zeroinitializer
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
2017-02-16 14:31:54 +08:00
|
|
|
declare <64 x i8> @llvm.x86.avx512.packsswb.512(<32 x i16>, <32 x i16>)
|
2015-05-04 17:14:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rr_512(<16 x i32> %a, <16 x i32> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackusdw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpackusdw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
ret <32 x i16> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rrk_512(<16 x i32> %a, <16 x i32> %b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackusdw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackusdw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> %passThru
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rrkz_512(<16 x i32> %a, <16 x i32> %b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackusdw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackusdw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rm_512(<16 x i32> %a, <16 x i32>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackusdw (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpackusdw (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <16 x i32>, <16 x i32>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
ret <32 x i16> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rmk_512(<16 x i32> %a, <16 x i32>* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackusdw (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackusdw (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <16 x i32>, <16 x i32>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> %passThru
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rmkz_512(<16 x i32> %a, <16 x i32>* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackusdw (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackusdw (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <16 x i32>, <16 x i32>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rmb_512(<16 x i32> %a, i32* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rmb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackusdw (%rdi){1to16}, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rmb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpackusdw (%eax){1to16}, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%q = load i32, i32* %ptr_b
|
|
|
|
%vecinit.i = insertelement <16 x i32> undef, i32 %q, i32 0
|
|
|
|
%b = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
ret <32 x i16> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rmbk_512(<16 x i32> %a, i32* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rmbk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackusdw (%rdi){1to16}, %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rmbk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackusdw (%eax){1to16}, %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%q = load i32, i32* %ptr_b
|
|
|
|
%vecinit.i = insertelement <16 x i32> undef, i32 %q, i32 0
|
|
|
|
%b = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> %passThru
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_packus_epi32_rmbkz_512(<16 x i32> %a, i32* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi32_rmbkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackusdw (%rdi){1to16}, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi32_rmbkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpackusdw (%eax){1to16}, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%q = load i32, i32* %ptr_b
|
|
|
|
%vecinit.i = insertelement <16 x i32> undef, i32 %q, i32 0
|
|
|
|
%b = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32> %a, <16 x i32> %b)
|
|
|
|
%2 = bitcast i32 %mask to <32 x i1>
|
|
|
|
%3 = select <32 x i1> %2, <32 x i16> %1, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
2017-02-16 14:31:54 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.packusdw.512(<16 x i32>, <16 x i32>)
|
2015-05-04 17:14:02 +08:00
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packus_epi16_rr_512(<32 x i16> %a, <32 x i16> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackuswb %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpackuswb %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packuswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
ret <64 x i8> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packus_epi16_rrk_512(<32 x i16> %a, <32 x i16> %b, <64 x i8> %passThru, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rdi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackuswb %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpackuswb %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packuswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> %passThru
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packus_epi16_rrkz_512(<32 x i16> %a, <32 x i16> %b, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rdi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackuswb %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpackuswb %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packuswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> zeroinitializer
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packus_epi16_rm_512(<32 x i16> %a, <32 x i16>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpackuswb (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpackuswb (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packuswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
ret <64 x i8> %1
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packus_epi16_rmk_512(<32 x i16> %a, <32 x i16>* %ptr_b, <64 x i8> %passThru, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rsi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackuswb (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpackuswb (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packuswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> %passThru
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test_mask_packus_epi16_rmkz_512(<32 x i16> %a, <32 x i16>* %ptr_b, i64 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_packus_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rsi, %k1
|
|
|
|
; AVX512BW-NEXT: vpackuswb (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_packus_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2017-02-16 14:31:54 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpackuswb (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 17:14:02 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
2017-02-16 14:31:54 +08:00
|
|
|
%1 = call <64 x i8> @llvm.x86.avx512.packuswb.512(<32 x i16> %a, <32 x i16> %b)
|
|
|
|
%2 = bitcast i64 %mask to <64 x i1>
|
|
|
|
%3 = select <64 x i1> %2, <64 x i8> %1, <64 x i8> zeroinitializer
|
|
|
|
ret <64 x i8> %3
|
2015-05-04 17:14:02 +08:00
|
|
|
}
|
|
|
|
|
2017-02-16 14:31:54 +08:00
|
|
|
declare <64 x i8> @llvm.x86.avx512.packuswb.512(<32 x i16>, <32 x i16>)
|
2015-05-04 20:35:55 +08:00
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epi16_rr_512(<32 x i16> %a, <32 x i16> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpaddsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpaddsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.padds.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epi16_rrk_512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddsw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddsw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.padds.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epi16_rrkz_512(<32 x i16> %a, <32 x i16> %b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddsw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddsw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.padds.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epi16_rm_512(<32 x i16> %a, <32 x i16>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpaddsw (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpaddsw (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.padds.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epi16_rmk_512(<32 x i16> %a, <32 x i16>* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddsw (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddsw (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.padds.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epi16_rmkz_512(<32 x i16> %a, <32 x i16>* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddsw (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddsw (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.padds.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.padds.w.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epi16_rr_512(<32 x i16> %a, <32 x i16> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpsubsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epi16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpsubsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubs.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epi16_rrk_512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubsw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epi16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubsw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubs.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epi16_rrkz_512(<32 x i16> %a, <32 x i16> %b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubsw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epi16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubsw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubs.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epi16_rm_512(<32 x i16> %a, <32 x i16>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpsubsw (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epi16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpsubsw (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubs.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epi16_rmk_512(<32 x i16> %a, <32 x i16>* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubsw (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epi16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubsw (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubs.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epi16_rmkz_512(<32 x i16> %a, <32 x i16>* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubsw (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epi16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubsw (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubs.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.psubs.w.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epu16_rr_512(<32 x i16> %a, <32 x i16> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epu16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpaddusw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epu16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpaddusw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.paddus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epu16_rrk_512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epu16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddusw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epu16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddusw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.paddus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epu16_rrkz_512(<32 x i16> %a, <32 x i16> %b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epu16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddusw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epu16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddusw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.paddus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epu16_rm_512(<32 x i16> %a, <32 x i16>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epu16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpaddusw (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epu16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpaddusw (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.paddus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epu16_rmk_512(<32 x i16> %a, <32 x i16>* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epu16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddusw (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epu16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddusw (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.paddus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_adds_epu16_rmkz_512(<32 x i16> %a, <32 x i16>* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_adds_epu16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpaddusw (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_adds_epu16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpaddusw (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.paddus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.paddus.w.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epu16_rr_512(<32 x i16> %a, <32 x i16> %b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epu16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpsubusw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epu16_rr_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpsubusw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epu16_rrk_512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epu16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubusw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epu16_rrk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubusw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epu16_rrkz_512(<32 x i16> %a, <32 x i16> %b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epu16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubusw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epu16_rrkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubusw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epu16_rm_512(<32 x i16> %a, <32 x i16>* %ptr_b) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epu16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpsubusw (%rdi), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epu16_rm_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpsubusw (%eax), %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epu16_rmk_512(<32 x i16> %a, <32 x i16>* %ptr_b, <32 x i16> %passThru, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epu16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubusw (%rdi), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epu16_rmk_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubusw (%eax), %zmm0, %zmm1 {%k1}
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> %passThru, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test_mask_subs_epu16_rmkz_512(<32 x i16> %a, <32 x i16>* %ptr_b, i32 %mask) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_mask_subs_epu16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsubusw (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_mask_subs_epu16_rmkz_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsubusw (%eax), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-05-04 20:35:55 +08:00
|
|
|
%b = load <32 x i16>, <32 x i16>* %ptr_b
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psubus.w.512(<32 x i16> %a, <32 x i16> %b, <32 x i16> zeroinitializer, i32 %mask)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.psubus.w.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
2015-06-16 16:39:27 +08:00
|
|
|
|
2015-06-22 14:45:48 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.vpermt2var.hi.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_vpermt2var_hi_512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_vpermt2var_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm3
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpermt2w %zmm2, %zmm0, %zmm3 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpermt2w %zmm2, %zmm0, %zmm1
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm1, %zmm3, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_vpermt2var_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm3
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpermt2w %zmm2, %zmm0, %zmm3 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpermt2w %zmm2, %zmm0, %zmm1
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm1, %zmm3, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-06-22 14:45:48 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.vpermt2var.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.vpermt2var.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res2 = add <32 x i16> %res, %res1
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_maskz_vpermt2var_hi_512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_maskz_vpermt2var_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm3
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpermt2w %zmm2, %zmm0, %zmm3 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: vpermt2w %zmm2, %zmm0, %zmm1
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm1, %zmm3, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_maskz_vpermt2var_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm3
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpermt2w %zmm2, %zmm0, %zmm3 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: vpermt2w %zmm2, %zmm0, %zmm1
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm1, %zmm3, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-06-22 14:45:48 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res2 = add <32 x i16> %res, %res1
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_vpermi2var_hi_512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_vpermi2var_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm3
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpermi2w %zmm2, %zmm0, %zmm3 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpermi2w %zmm2, %zmm0, %zmm1
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm1, %zmm3, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_vpermi2var_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
2016-07-22 13:00:52 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm3
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpermi2w %zmm2, %zmm0, %zmm3 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpermi2w %zmm2, %zmm0, %zmm1
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm1, %zmm3, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-06-22 14:45:48 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res2 = add <32 x i16> %res, %res1
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
|
2016-12-11 07:09:43 +08:00
|
|
|
declare <64 x i8> @llvm.x86.avx512.pshuf.b.512(<64 x i8>, <64 x i8>)
|
2015-06-22 21:00:42 +08:00
|
|
|
|
2016-12-11 07:09:43 +08:00
|
|
|
define <64 x i8>@test_int_x86_avx512_pshuf_b_512(<64 x i8> %x0, <64 x i8> %x1) {
|
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_pshuf_b_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512BW-NEXT: vpshufb %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_pshuf_b_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512F-32-NEXT: vpshufb %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <64 x i8> @llvm.x86.avx512.pshuf.b.512(<64 x i8> %x0, <64 x i8> %x1)
|
|
|
|
ret <64 x i8> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8>@test_int_x86_avx512_pshuf_b_512_mask(<64 x i8> %x0, <64 x i8> %x1, <64 x i8> %x2, i64 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_pshuf_b_512_mask:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rdi, %k1
|
|
|
|
; AVX512BW-NEXT: vpshufb %zmm1, %zmm0, %zmm2 {%k1}
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_pshuf_b_512_mask:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpshufb %zmm1, %zmm0, %zmm2 {%k1}
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2016-12-11 07:09:43 +08:00
|
|
|
%res = call <64 x i8> @llvm.x86.avx512.pshuf.b.512(<64 x i8> %x0, <64 x i8> %x1)
|
|
|
|
%mask.cast = bitcast i64 %mask to <64 x i1>
|
|
|
|
%res2 = select <64 x i1> %mask.cast, <64 x i8> %res, <64 x i8> %x2
|
|
|
|
ret <64 x i8> %res2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8>@test_int_x86_avx512_pshuf_b_512_maskz(<64 x i8> %x0, <64 x i8> %x1, i64 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_pshuf_b_512_maskz:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512BW-NEXT: kmovq %rdi, %k1
|
|
|
|
; AVX512BW-NEXT: vpshufb %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_pshuf_b_512_maskz:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-12-11 07:09:43 +08:00
|
|
|
; AVX512F-32-NEXT: kmovq {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpshufb %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <64 x i8> @llvm.x86.avx512.pshuf.b.512(<64 x i8> %x0, <64 x i8> %x1)
|
|
|
|
%mask.cast = bitcast i64 %mask to <64 x i1>
|
|
|
|
%res2 = select <64 x i1> %mask.cast, <64 x i8> %res, <64 x i8> zeroinitializer
|
2015-06-22 21:00:42 +08:00
|
|
|
ret <64 x i8> %res2
|
2015-06-23 16:19:46 +08:00
|
|
|
}
|
|
|
|
|
2015-07-05 20:23:20 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.pmulhu.w.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_pmulhu_w_512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmulhu_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmulhuw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmulhuw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmulhu_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmulhuw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmulhuw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-05 20:23:20 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.pmulhu.w.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.pmulhu.w.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res2 = add <32 x i16> %res, %res1
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.pmulh.w.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_pmulh_w_512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmulh_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmulhw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmulhw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmulh_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmulhw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmulhw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-05 20:23:20 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.pmulh.w.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.pmulh.w.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res2 = add <32 x i16> %res, %res1
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
2015-07-06 22:03:40 +08:00
|
|
|
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.pmul.hr.sw.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_pmulhr_sw_512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmulhr_sw_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmulhrsw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmulhrsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmulhr_sw_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmulhrsw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmulhrsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-06 22:03:40 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.pmul.hr.sw.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.pmul.hr.sw.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res2 = add <32 x i16> %res, %res1
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
2015-07-21 15:11:28 +08:00
|
|
|
|
2015-07-25 01:24:15 +08:00
|
|
|
declare <32 x i8> @llvm.x86.avx512.mask.pmov.wb.512(<32 x i16>, <32 x i8>, i32)
|
|
|
|
|
|
|
|
define <32 x i8>@test_int_x86_avx512_mask_pmov_wb_512(<32 x i16> %x0, <32 x i8> %x1, i32 %x2) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmov_wb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmovwb %zmm0, %ymm1 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmovwb %zmm0, %ymm2 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: vpmovwb %zmm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: vpaddb %ymm1, %ymm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: vpaddb %ymm2, %ymm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmov_wb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmovwb %zmm0, %ymm1 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmovwb %zmm0, %ymm2 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: vpmovwb %zmm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: vpaddb %ymm1, %ymm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: vpaddb %ymm2, %ymm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-25 01:24:15 +08:00
|
|
|
%res0 = call <32 x i8> @llvm.x86.avx512.mask.pmov.wb.512(<32 x i16> %x0, <32 x i8> %x1, i32 -1)
|
|
|
|
%res1 = call <32 x i8> @llvm.x86.avx512.mask.pmov.wb.512(<32 x i16> %x0, <32 x i8> %x1, i32 %x2)
|
|
|
|
%res2 = call <32 x i8> @llvm.x86.avx512.mask.pmov.wb.512(<32 x i16> %x0, <32 x i8> zeroinitializer, i32 %x2)
|
|
|
|
%res3 = add <32 x i8> %res0, %res1
|
|
|
|
%res4 = add <32 x i8> %res3, %res2
|
|
|
|
ret <32 x i8> %res4
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.x86.avx512.mask.pmov.wb.mem.512(i8* %ptr, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define void @test_int_x86_avx512_mask_pmov_wb_mem_512(i8* %ptr, <32 x i16> %x1, i32 %x2) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmov_wb_mem_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmovwb %zmm0, (%rdi)
|
|
|
|
; AVX512BW-NEXT: vpmovwb %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmov_wb_mem_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; AVX512F-32-NEXT: vpmovwb %zmm0, (%eax)
|
|
|
|
; AVX512F-32-NEXT: vpmovwb %zmm0, (%eax) {%k1}
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-25 01:24:15 +08:00
|
|
|
call void @llvm.x86.avx512.mask.pmov.wb.mem.512(i8* %ptr, <32 x i16> %x1, i32 -1)
|
|
|
|
call void @llvm.x86.avx512.mask.pmov.wb.mem.512(i8* %ptr, <32 x i16> %x1, i32 %x2)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i8> @llvm.x86.avx512.mask.pmovs.wb.512(<32 x i16>, <32 x i8>, i32)
|
|
|
|
|
|
|
|
define <32 x i8>@test_int_x86_avx512_mask_pmovs_wb_512(<32 x i16> %x0, <32 x i8> %x1, i32 %x2) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmovs_wb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmovswb %zmm0, %ymm1 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmovswb %zmm0, %ymm2 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: vpmovswb %zmm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: vpaddb %ymm1, %ymm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: vpaddb %ymm2, %ymm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmovs_wb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmovswb %zmm0, %ymm1 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmovswb %zmm0, %ymm2 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: vpmovswb %zmm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: vpaddb %ymm1, %ymm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: vpaddb %ymm2, %ymm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-25 01:24:15 +08:00
|
|
|
%res0 = call <32 x i8> @llvm.x86.avx512.mask.pmovs.wb.512(<32 x i16> %x0, <32 x i8> %x1, i32 -1)
|
|
|
|
%res1 = call <32 x i8> @llvm.x86.avx512.mask.pmovs.wb.512(<32 x i16> %x0, <32 x i8> %x1, i32 %x2)
|
|
|
|
%res2 = call <32 x i8> @llvm.x86.avx512.mask.pmovs.wb.512(<32 x i16> %x0, <32 x i8> zeroinitializer, i32 %x2)
|
|
|
|
%res3 = add <32 x i8> %res0, %res1
|
|
|
|
%res4 = add <32 x i8> %res3, %res2
|
|
|
|
ret <32 x i8> %res4
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.x86.avx512.mask.pmovs.wb.mem.512(i8* %ptr, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define void @test_int_x86_avx512_mask_pmovs_wb_mem_512(i8* %ptr, <32 x i16> %x1, i32 %x2) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmovs_wb_mem_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
2016-12-21 18:43:36 +08:00
|
|
|
; AVX512BW-NEXT: vpmovswb %zmm0, (%rdi)
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpmovswb %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmovs_wb_mem_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-12-21 18:43:36 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2016-12-21 18:43:36 +08:00
|
|
|
; AVX512F-32-NEXT: vpmovswb %zmm0, (%eax)
|
|
|
|
; AVX512F-32-NEXT: vpmovswb %zmm0, (%eax) {%k1}
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-25 01:24:15 +08:00
|
|
|
call void @llvm.x86.avx512.mask.pmovs.wb.mem.512(i8* %ptr, <32 x i16> %x1, i32 -1)
|
|
|
|
call void @llvm.x86.avx512.mask.pmovs.wb.mem.512(i8* %ptr, <32 x i16> %x1, i32 %x2)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <32 x i8> @llvm.x86.avx512.mask.pmovus.wb.512(<32 x i16>, <32 x i8>, i32)
|
|
|
|
|
|
|
|
define <32 x i8>@test_int_x86_avx512_mask_pmovus_wb_512(<32 x i16> %x0, <32 x i8> %x1, i32 %x2) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmovus_wb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmovuswb %zmm0, %ymm1 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmovuswb %zmm0, %ymm2 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: vpmovuswb %zmm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: vpaddb %ymm1, %ymm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: vpaddb %ymm2, %ymm0, %ymm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmovus_wb_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmovuswb %zmm0, %ymm1 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmovuswb %zmm0, %ymm2 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: vpmovuswb %zmm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: vpaddb %ymm1, %ymm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: vpaddb %ymm2, %ymm0, %ymm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-25 01:24:15 +08:00
|
|
|
%res0 = call <32 x i8> @llvm.x86.avx512.mask.pmovus.wb.512(<32 x i16> %x0, <32 x i8> %x1, i32 -1)
|
|
|
|
%res1 = call <32 x i8> @llvm.x86.avx512.mask.pmovus.wb.512(<32 x i16> %x0, <32 x i8> %x1, i32 %x2)
|
|
|
|
%res2 = call <32 x i8> @llvm.x86.avx512.mask.pmovus.wb.512(<32 x i16> %x0, <32 x i8> zeroinitializer, i32 %x2)
|
|
|
|
%res3 = add <32 x i8> %res0, %res1
|
|
|
|
%res4 = add <32 x i8> %res3, %res2
|
|
|
|
ret <32 x i8> %res4
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.x86.avx512.mask.pmovus.wb.mem.512(i8* %ptr, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define void @test_int_x86_avx512_mask_pmovus_wb_mem_512(i8* %ptr, <32 x i16> %x1, i32 %x2) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmovus_wb_mem_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %esi, %k1
|
2016-12-21 18:43:36 +08:00
|
|
|
; AVX512BW-NEXT: vpmovuswb %zmm0, (%rdi)
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpmovuswb %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmovus_wb_mem_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-12-21 18:43:36 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2016-12-21 18:43:36 +08:00
|
|
|
; AVX512F-32-NEXT: vpmovuswb %zmm0, (%eax)
|
|
|
|
; AVX512F-32-NEXT: vpmovuswb %zmm0, (%eax) {%k1}
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-25 01:24:15 +08:00
|
|
|
call void @llvm.x86.avx512.mask.pmovus.wb.mem.512(i8* %ptr, <32 x i16> %x1, i32 -1)
|
|
|
|
call void @llvm.x86.avx512.mask.pmovus.wb.mem.512(i8* %ptr, <32 x i16> %x1, i32 %x2)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-21 15:11:28 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.pmaddubs.w.512(<64 x i8>, <64 x i8>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_pmaddubs_w_512(<64 x i8> %x0, <64 x i8> %x1, <32 x i16> %x2, i32 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmaddubs_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpmaddubsw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmaddubsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmaddubs_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmaddubsw %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmaddubsw %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-21 15:11:28 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.pmaddubs.w.512(<64 x i8> %x0, <64 x i8> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.pmaddubs.w.512(<64 x i8> %x0, <64 x i8> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res2 = add <32 x i16> %res, %res1
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <16 x i32> @llvm.x86.avx512.mask.pmaddw.d.512(<32 x i16>, <32 x i16>, <16 x i32>, i16)
|
|
|
|
|
|
|
|
define <16 x i32>@test_int_x86_avx512_mask_pmaddw_d_512(<32 x i16> %x0, <32 x i16> %x1, <16 x i32> %x2, i16 %x3) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_pmaddw_d_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2017-03-29 00:35:29 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpmaddwd %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpmaddwd %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddd %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_pmaddw_d_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovw {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpmaddwd %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpmaddwd %zmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddd %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-07-21 15:11:28 +08:00
|
|
|
%res = call <16 x i32> @llvm.x86.avx512.mask.pmaddw.d.512(<32 x i16> %x0, <32 x i16> %x1, <16 x i32> %x2, i16 %x3)
|
|
|
|
%res1 = call <16 x i32> @llvm.x86.avx512.mask.pmaddw.d.512(<32 x i16> %x0, <32 x i16> %x1, <16 x i32> %x2, i16 -1)
|
|
|
|
%res2 = add <16 x i32> %res, %res1
|
|
|
|
ret <16 x i32> %res2
|
|
|
|
}
|
|
|
|
|
2015-08-31 21:09:30 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.dbpsadbw.512(<64 x i8>, <64 x i8>, i32, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_dbpsadbw_512(<64 x i8> %x0, <64 x i8> %x1, <32 x i16> %x3, i32 %x4) {
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_dbpsadbw_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vdbpsadbw $2, %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vdbpsadbw $2, %zmm1, %zmm0, %zmm3 {%k1} {z}
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512BW-NEXT: vpaddw %zmm3, %zmm2, %zmm2
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vdbpsadbw $2, %zmm1, %zmm0, %zmm0
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_dbpsadbw_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vdbpsadbw $2, %zmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vdbpsadbw $2, %zmm1, %zmm0, %zmm3 {%k1} {z}
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm3, %zmm2, %zmm2
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vdbpsadbw $2, %zmm1, %zmm0, %zmm0
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2015-08-31 21:09:30 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.dbpsadbw.512(<64 x i8> %x0, <64 x i8> %x1, i32 2, <32 x i16> %x3, i32 %x4)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.dbpsadbw.512(<64 x i8> %x0, <64 x i8> %x1, i32 2, <32 x i16> zeroinitializer, i32 %x4)
|
|
|
|
%res2 = call <32 x i16> @llvm.x86.avx512.mask.dbpsadbw.512(<64 x i8> %x0, <64 x i8> %x1, i32 2, <32 x i16> %x3, i32 -1)
|
|
|
|
%res3 = add <32 x i16> %res, %res1
|
|
|
|
%res4 = add <32 x i16> %res3, %res2
|
|
|
|
ret <32 x i16> %res4
|
|
|
|
}
|
2015-09-02 22:21:54 +08:00
|
|
|
|
2015-11-25 03:51:26 +08:00
|
|
|
declare <8 x i64> @llvm.x86.avx512.psad.bw.512(<64 x i8>, <64 x i8>)
|
2015-09-02 22:21:54 +08:00
|
|
|
|
2015-11-25 03:51:26 +08:00
|
|
|
define <8 x i64>@test_int_x86_avx512_mask_psadb_w_512(<64 x i8> %x0, <64 x i8> %x1, <64 x i8> %x2){
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_psadb_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2015-11-30 18:40:52 +08:00
|
|
|
; AVX512BW-NEXT: vpsadbw %zmm1, %zmm0, %zmm1
|
|
|
|
; AVX512BW-NEXT: vpsadbw %zmm2, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddq %zmm0, %zmm1, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
2015-12-06 19:35:18 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_psadb_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2015-12-06 19:35:18 +08:00
|
|
|
; AVX512F-32-NEXT: vpsadbw %zmm1, %zmm0, %zmm1
|
|
|
|
; AVX512F-32-NEXT: vpsadbw %zmm2, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddq %zmm0, %zmm1, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
2015-11-25 03:51:26 +08:00
|
|
|
%res = call <8 x i64> @llvm.x86.avx512.psad.bw.512(<64 x i8> %x0, <64 x i8> %x1)
|
|
|
|
%res1 = call <8 x i64> @llvm.x86.avx512.psad.bw.512(<64 x i8> %x0, <64 x i8> %x2)
|
|
|
|
%res2 = add <8 x i64> %res, %res1
|
|
|
|
ret <8 x i64> %res2
|
2015-09-02 22:21:54 +08:00
|
|
|
}
|
2015-12-07 21:25:18 +08:00
|
|
|
|
2016-01-04 19:39:06 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.psrlv32hi(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_psrlv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2016-01-08 00:25:42 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_psrlv32hi:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm3
|
2016-01-08 00:25:42 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm3, %zmm0, %zmm0
|
2016-01-08 00:25:42 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2016-01-24 18:41:28 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_psrlv32hi:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512F-32-NEXT: vpsrlvw %zmm1, %zmm0, %zmm3
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsrlvw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512F-32-NEXT: vpsrlvw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm3, %zmm0, %zmm0
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2016-01-04 19:39:06 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psrlv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.psrlv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> zeroinitializer, i32 %x3)
|
|
|
|
%res2 = call <32 x i16> @llvm.x86.avx512.mask.psrlv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res3 = add <32 x i16> %res, %res1
|
|
|
|
%res4 = add <32 x i16> %res3, %res2
|
|
|
|
ret <32 x i16> %res4
|
|
|
|
}
|
2016-01-04 20:50:36 +08:00
|
|
|
|
2016-01-08 00:25:42 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.psrav32.hi(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
2016-01-07 22:42:20 +08:00
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_psrav32_hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
2016-01-08 00:25:42 +08:00
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_psrav32_hi:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512BW-NEXT: vpsravw %zmm1, %zmm0, %zmm3
|
2016-01-08 00:25:42 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsravw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512BW-NEXT: vpsravw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm3, %zmm0, %zmm0
|
2016-01-08 00:25:42 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2016-01-24 18:41:28 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_psrav32_hi:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512F-32-NEXT: vpsravw %zmm1, %zmm0, %zmm3
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsravw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512F-32-NEXT: vpsravw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm3, %zmm0, %zmm0
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2016-01-08 00:25:42 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psrav32.hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.psrav32.hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> zeroinitializer, i32 %x3)
|
|
|
|
%res2 = call <32 x i16> @llvm.x86.avx512.mask.psrav32.hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
2016-01-07 22:42:20 +08:00
|
|
|
%res3 = add <32 x i16> %res, %res1
|
|
|
|
%res4 = add <32 x i16> %res3, %res2
|
|
|
|
ret <32 x i16> %res4
|
|
|
|
}
|
2016-01-08 00:02:51 +08:00
|
|
|
|
2016-06-20 15:05:43 +08:00
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_psrav32_hi_const(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_psrav32_hi_const:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2017-08-01 01:35:44 +08:00
|
|
|
; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm0 = [2,9,65524,23,65510,37,65496,51,2,9,65524,23,65510,37,65496,51,2,9,65524,23,65510,37,65496,51,2,9,65524,23,65510,37,65496,51]
|
2016-06-20 15:05:43 +08:00
|
|
|
; AVX512BW-NEXT: vpsravw {{.*}}(%rip), %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_psrav32_hi_const:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2017-08-01 01:35:44 +08:00
|
|
|
; AVX512F-32-NEXT: vmovdqa64 {{.*#+}} zmm0 = [2,9,65524,23,65510,37,65496,51,2,9,65524,23,65510,37,65496,51,2,9,65524,23,65510,37,65496,51,2,9,65524,23,65510,37,65496,51]
|
2016-06-20 15:05:43 +08:00
|
|
|
; AVX512F-32-NEXT: vpsravw {{\.LCPI.*}}, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psrav32.hi(<32 x i16> <i16 2, i16 9, i16 -12, i16 23, i16 -26, i16 37, i16 -40, i16 51, i16 2, i16 9, i16 -12, i16 23, i16 -26, i16 37, i16 -40, i16 51, i16 2, i16 9, i16 -12, i16 23, i16 -26, i16 37, i16 -40, i16 51, i16 2, i16 9, i16 -12, i16 23, i16 -26, i16 37, i16 -40, i16 51>,
|
|
|
|
<32 x i16> <i16 1, i16 10, i16 35, i16 52, i16 69, i16 9, i16 16, i16 49, i16 1, i16 10, i16 35, i16 52, i16 69, i16 9, i16 16, i16 49, i16 1, i16 10, i16 35, i16 52, i16 69, i16 9, i16 16, i16 49, i16 1, i16 10, i16 35, i16 52, i16 69, i16 9, i16 16, i16 49>,
|
|
|
|
<32 x i16> zeroinitializer, i32 -1)
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
|
2016-01-08 00:02:51 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.psllv32hi(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_psllv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_psllv32hi:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512BW-NEXT: vpsllvw %zmm1, %zmm0, %zmm3
|
2016-01-08 00:02:51 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsllvw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512BW-NEXT: vpsllvw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: vpaddw %zmm3, %zmm0, %zmm0
|
2016-01-08 00:02:51 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
2016-01-24 18:41:28 +08:00
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_psllv32hi:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512F-32-NEXT: vpsllvw %zmm1, %zmm0, %zmm3
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsllvw %zmm1, %zmm0, %zmm2 {%k1}
|
2016-11-18 13:04:44 +08:00
|
|
|
; AVX512F-32-NEXT: vpsllvw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm3, %zmm0, %zmm0
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2016-01-08 00:02:51 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.psllv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.psllv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> zeroinitializer, i32 %x3)
|
|
|
|
%res2 = call <32 x i16> @llvm.x86.avx512.mask.psllv32hi(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res3 = add <32 x i16> %res, %res1
|
|
|
|
%res4 = add <32 x i16> %res3, %res2
|
|
|
|
ret <32 x i16> %res4
|
|
|
|
}
|
2016-01-13 22:25:21 +08:00
|
|
|
|
2016-01-17 19:33:29 +08:00
|
|
|
declare <32 x i16> @llvm.x86.avx512.mask.permvar.hi.512(<32 x i16>, <32 x i16>, <32 x i16>, i32)
|
|
|
|
|
|
|
|
define <32 x i16>@test_int_x86_avx512_mask_permvar_hi_512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3) {
|
|
|
|
; AVX512BW-LABEL: test_int_x86_avx512_mask_permvar_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
2016-05-24 19:06:22 +08:00
|
|
|
; AVX512BW-NEXT: vpermw %zmm0, %zmm1, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vpermw %zmm0, %zmm1, %zmm3 {%k1} {z}
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512BW-NEXT: vpaddw %zmm3, %zmm2, %zmm2
|
2016-05-24 19:06:22 +08:00
|
|
|
; AVX512BW-NEXT: vpermw %zmm0, %zmm1, %zmm0
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512BW-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_int_x86_avx512_mask_permvar_hi_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
2016-05-24 19:06:22 +08:00
|
|
|
; AVX512F-32-NEXT: vpermw %zmm0, %zmm1, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vpermw %zmm0, %zmm1, %zmm3 {%k1} {z}
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm3, %zmm2, %zmm2
|
2016-05-24 19:06:22 +08:00
|
|
|
; AVX512F-32-NEXT: vpermw %zmm0, %zmm1, %zmm0
|
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.
Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb
Reviewed By: MatzeB, andreadb
Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32563
llvm-svn: 304371
2017-06-01 07:25:25 +08:00
|
|
|
; AVX512F-32-NEXT: vpaddw %zmm0, %zmm2, %zmm0
|
2016-01-24 18:41:28 +08:00
|
|
|
; AVX512F-32-NEXT: retl
|
2016-01-17 19:33:29 +08:00
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.mask.permvar.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 %x3)
|
|
|
|
%res1 = call <32 x i16> @llvm.x86.avx512.mask.permvar.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> zeroinitializer, i32 %x3)
|
|
|
|
%res2 = call <32 x i16> @llvm.x86.avx512.mask.permvar.hi.512(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %x2, i32 -1)
|
|
|
|
%res3 = add <32 x i16> %res, %res1
|
|
|
|
%res4 = add <32 x i16> %res3, %res2
|
|
|
|
ret <32 x i16> %res4
|
|
|
|
}
|
2016-01-18 21:52:57 +08:00
|
|
|
|
2016-11-12 13:28:24 +08:00
|
|
|
define <32 x i16> @test_x86_avx512_psll_w_512(<32 x i16> %a0, <8 x i16> %a1) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_psll_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: vpsllw %xmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_psll_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: vpsllw %xmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psll.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_mask_psll_w_512(<32 x i16> %a0, <8 x i16> %a1, <32 x i16> %passthru, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_mask_psll_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsllw %xmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_mask_psll_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsllw %xmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psll.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> %passthru
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_maskz_psll_w_512(<32 x i16> %a0, <8 x i16> %a1, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_maskz_psll_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsllw %xmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_maskz_psll_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsllw %xmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psll.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.psll.w.512(<32 x i16>, <8 x i16>) nounwind readnone
|
|
|
|
|
|
|
|
|
|
|
|
define <32 x i16> @test_x86_avx512_pslli_w_512(<32 x i16> %a0) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_pslli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: vpsllw $7, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_pslli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: vpsllw $7, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.pslli.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_mask_pslli_w_512(<32 x i16> %a0, <32 x i16> %passthru, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_mask_pslli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsllw $7, %zmm0, %zmm1 {%k1}
|
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_mask_pslli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsllw $7, %zmm0, %zmm1 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.pslli.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> %passthru
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_maskz_pslli_w_512(<32 x i16> %a0, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_maskz_pslli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsllw $7, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_maskz_pslli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsllw $7, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.pslli.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.pslli.w.512(<32 x i16>, i32) nounwind readnone
|
|
|
|
|
|
|
|
|
|
|
|
define <32 x i16> @test_x86_avx512_psra_w_512(<32 x i16> %a0, <8 x i16> %a1) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_psra_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: vpsraw %xmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_psra_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: vpsraw %xmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psra.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_mask_psra_w_512(<32 x i16> %a0, <8 x i16> %a1, <32 x i16> %passthru, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_mask_psra_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsraw %xmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_mask_psra_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsraw %xmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psra.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> %passthru
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_maskz_psra_w_512(<32 x i16> %a0, <8 x i16> %a1, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_maskz_psra_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsraw %xmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_maskz_psra_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsraw %xmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psra.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.psra.w.512(<32 x i16>, <8 x i16>) nounwind readnone
|
|
|
|
|
|
|
|
|
|
|
|
define <32 x i16> @test_x86_avx512_psrai_w_512(<32 x i16> %a0) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_psrai_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: vpsraw $7, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_psrai_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: vpsraw $7, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrai.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_mask_psrai_w_512(<32 x i16> %a0, <32 x i16> %passthru, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_mask_psrai_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsraw $7, %zmm0, %zmm1 {%k1}
|
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_mask_psrai_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsraw $7, %zmm0, %zmm1 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrai.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> %passthru
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_maskz_psrai_w_512(<32 x i16> %a0, <32 x i16> %passthru, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_maskz_psrai_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsraw $7, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_maskz_psrai_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsraw $7, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrai.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.psrai.w.512(<32 x i16>, i32) nounwind readnone
|
|
|
|
|
|
|
|
|
|
|
|
define <32 x i16> @test_x86_avx512_psrl_w_512(<32 x i16> %a0, <8 x i16> %a1) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_psrl_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: vpsrlw %xmm1, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_psrl_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: vpsrlw %xmm1, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrl.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_mask_psrl_w_512(<32 x i16> %a0, <8 x i16> %a1, <32 x i16> %passthru, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_mask_psrl_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsrlw %xmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm2, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_mask_psrl_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsrlw %xmm1, %zmm0, %zmm2 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm2, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrl.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> %passthru
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_maskz_psrl_w_512(<32 x i16> %a0, <8 x i16> %a1, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_maskz_psrl_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsrlw %xmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_maskz_psrl_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsrlw %xmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrl.w.512(<32 x i16> %a0, <8 x i16> %a1) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.psrl.w.512(<32 x i16>, <8 x i16>) nounwind readnone
|
|
|
|
|
|
|
|
|
|
|
|
define <32 x i16> @test_x86_avx512_psrli_w_512(<32 x i16> %a0) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_psrli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: vpsrlw $7, %zmm0, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_psrli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: vpsrlw $7, %zmm0, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrli.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
ret <32 x i16> %res
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_mask_psrli_w_512(<32 x i16> %a0, <32 x i16> %passthru, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_mask_psrli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsrlw $7, %zmm0, %zmm1 {%k1}
|
|
|
|
; AVX512BW-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_mask_psrli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsrlw $7, %zmm0, %zmm1 {%k1}
|
|
|
|
; AVX512F-32-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrli.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> %passthru
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
define <32 x i16> @test_x86_avx512_maskz_psrli_w_512(<32 x i16> %a0, i32 %mask) {
|
|
|
|
; AVX512BW-LABEL: test_x86_avx512_maskz_psrli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512BW: ## %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512BW-NEXT: kmovd %edi, %k1
|
|
|
|
; AVX512BW-NEXT: vpsrlw $7, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512BW-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-32-LABEL: test_x86_avx512_maskz_psrli_w_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX512F-32: # %bb.0:
|
2016-11-12 13:28:24 +08:00
|
|
|
; AVX512F-32-NEXT: kmovd {{[0-9]+}}(%esp), %k1
|
|
|
|
; AVX512F-32-NEXT: vpsrlw $7, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; AVX512F-32-NEXT: retl
|
|
|
|
%res = call <32 x i16> @llvm.x86.avx512.psrli.w.512(<32 x i16> %a0, i32 7) ; <<32 x i16>> [#uses=1]
|
|
|
|
%mask.cast = bitcast i32 %mask to <32 x i1>
|
|
|
|
%res2 = select <32 x i1> %mask.cast, <32 x i16> %res, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %res2
|
|
|
|
}
|
|
|
|
declare <32 x i16> @llvm.x86.avx512.psrli.w.512(<32 x i16>, i32) nounwind readnone
|