2016-10-22 03:40:29 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefix=X32
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefix=X64
|
|
|
|
|
|
|
|
declare <16 x i16> @llvm.x86.avx512.mask.permvar.hi.256(<16 x i16>, <16 x i16>, <16 x i16>, i16)
|
|
|
|
declare <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16>, <16 x i16>, <16 x i16>, i16)
|
|
|
|
declare <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16>, <16 x i16>, <16 x i16>, i16)
|
|
|
|
|
|
|
|
define <16 x i16> @combine_vpermt2var_16i16_identity(<16 x i16> %x0, <16 x i16> %x1) {
|
|
|
|
; X32-LABEL: combine_vpermt2var_16i16_identity:
|
|
|
|
; X32: # BB#0:
|
|
|
|
; X32-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: combine_vpermt2var_16i16_identity:
|
|
|
|
; X64: # BB#0:
|
|
|
|
; X64-NEXT: retq
|
|
|
|
%res0 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, <16 x i16> %x0, <16 x i16> %x1, i16 -1)
|
|
|
|
%res1 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 30, i16 13, i16 28, i16 11, i16 26, i16 9, i16 24, i16 7, i16 22, i16 5, i16 20, i16 3, i16 18, i16 1, i16 16>, <16 x i16> %res0, <16 x i16> %res0, i16 -1)
|
|
|
|
ret <16 x i16> %res1
|
|
|
|
}
|
|
|
|
define <16 x i16> @combine_vpermt2var_16i16_identity_mask(<16 x i16> %x0, <16 x i16> %x1, i16 %m) {
|
|
|
|
; X32-LABEL: combine_vpermt2var_16i16_identity_mask:
|
|
|
|
; X32: # BB#0:
|
|
|
|
; X32-NEXT: kmovw {{[0-9]+}}(%esp), %k1
|
|
|
|
; X32-NEXT: vmovdqu16 {{.*#+}} ymm2 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
|
2016-11-22 12:57:34 +08:00
|
|
|
; X32-NEXT: vpermi2w %ymm1, %ymm0, %ymm2 {%k1} {z}
|
|
|
|
; X32-NEXT: vmovdqu16 {{.*#+}} ymm0 = [15,30,13,28,11,26,9,24,7,22,5,20,3,18,1,16]
|
|
|
|
; X32-NEXT: vpermi2w %ymm2, %ymm2, %ymm0 {%k1} {z}
|
2016-10-22 03:40:29 +08:00
|
|
|
; X32-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: combine_vpermt2var_16i16_identity_mask:
|
|
|
|
; X64: # BB#0:
|
|
|
|
; X64-NEXT: kmovw %edi, %k1
|
|
|
|
; X64-NEXT: vmovdqu16 {{.*#+}} ymm2 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
|
2016-11-22 12:57:34 +08:00
|
|
|
; X64-NEXT: vpermi2w %ymm1, %ymm0, %ymm2 {%k1} {z}
|
|
|
|
; X64-NEXT: vmovdqu16 {{.*#+}} ymm0 = [15,30,13,28,11,26,9,24,7,22,5,20,3,18,1,16]
|
|
|
|
; X64-NEXT: vpermi2w %ymm2, %ymm2, %ymm0 {%k1} {z}
|
2016-10-22 03:40:29 +08:00
|
|
|
; X64-NEXT: retq
|
|
|
|
%res0 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, <16 x i16> %x0, <16 x i16> %x1, i16 %m)
|
|
|
|
%res1 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 30, i16 13, i16 28, i16 11, i16 26, i16 9, i16 24, i16 7, i16 22, i16 5, i16 20, i16 3, i16 18, i16 1, i16 16>, <16 x i16> %res0, <16 x i16> %res0, i16 %m)
|
|
|
|
ret <16 x i16> %res1
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i16> @combine_vpermi2var_16i16_as_permw(<16 x i16> %x0, <16 x i16> %x1) {
|
|
|
|
; X32-LABEL: combine_vpermi2var_16i16_as_permw:
|
|
|
|
; X32: # BB#0:
|
|
|
|
; X32-NEXT: vmovdqu16 {{.*#+}} ymm1 = [15,0,14,1,13,2,12,3,11,4,10,5,9,6,8,7]
|
|
|
|
; X32-NEXT: vpermw %ymm0, %ymm1, %ymm0
|
|
|
|
; X32-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: combine_vpermi2var_16i16_as_permw:
|
|
|
|
; X64: # BB#0:
|
|
|
|
; X64-NEXT: vmovdqu16 {{.*#+}} ymm1 = [15,0,14,1,13,2,12,3,11,4,10,5,9,6,8,7]
|
|
|
|
; X64-NEXT: vpermw %ymm0, %ymm1, %ymm0
|
|
|
|
; X64-NEXT: retq
|
|
|
|
%res0 = call <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16> %x0, <16 x i16> <i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, <16 x i16> %x1, i16 -1)
|
|
|
|
%res1 = call <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16> %res0, <16 x i16> <i16 0, i16 15, i16 1, i16 14, i16 2, i16 13, i16 3, i16 12, i16 4, i16 11, i16 5, i16 10, i16 6, i16 9, i16 7, i16 8>, <16 x i16> %res0, i16 -1)
|
|
|
|
ret <16 x i16> %res1
|
|
|
|
}
|
2016-10-23 03:53:59 +08:00
|
|
|
|
|
|
|
define <16 x i16> @combine_vpermt2var_vpermi2var_16i16_as_vperm2(<16 x i16> %x0, <16 x i16> %x1) {
|
|
|
|
; X32-LABEL: combine_vpermt2var_vpermi2var_16i16_as_vperm2:
|
|
|
|
; X32: # BB#0:
|
|
|
|
; X32-NEXT: vmovdqu16 {{.*#+}} ymm2 = [0,31,2,2,4,29,6,27,8,25,10,23,12,21,14,19]
|
|
|
|
; X32-NEXT: vpermt2w %ymm1, %ymm2, %ymm0
|
|
|
|
; X32-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: combine_vpermt2var_vpermi2var_16i16_as_vperm2:
|
|
|
|
; X64: # BB#0:
|
|
|
|
; X64-NEXT: vmovdqu16 {{.*#+}} ymm2 = [0,31,2,2,4,29,6,27,8,25,10,23,12,21,14,19]
|
|
|
|
; X64-NEXT: vpermt2w %ymm1, %ymm2, %ymm0
|
|
|
|
; X64-NEXT: retq
|
|
|
|
%res0 = call <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16> %x0, <16 x i16> <i16 0, i16 31, i16 2, i16 29, i16 4, i16 27, i16 6, i16 25, i16 8, i16 23, i16 10, i16 21, i16 12, i16 19, i16 14, i16 17>, <16 x i16> %x1, i16 -1)
|
|
|
|
%res1 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 0, i16 17, i16 2, i16 18, i16 4, i16 19, i16 6, i16 21, i16 8, i16 23, i16 10, i16 25, i16 12, i16 27, i16 14, i16 29>, <16 x i16> %res0, <16 x i16> %res0, i16 -1)
|
|
|
|
ret <16 x i16> %res1
|
|
|
|
}
|