2016-06-14 15:05:10 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512bw -mattr=+avx512vl --show-mc-encoding| FileCheck %s
|
2014-09-26 17:48:50 +08:00
|
|
|
|
|
|
|
define <32 x i8> @test_256_1(i8 * %addr) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 01:35:44 +08:00
|
|
|
; CHECK-NEXT: vmovups (%rdi), %ymm0 ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x10,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <32 x i8>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%res = load <32 x i8>, <32 x i8>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
ret <32 x i8>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_256_2(i8 * %addr, <32 x i8> %data) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 23:31:24 +08:00
|
|
|
; CHECK-NEXT: vmovups %ymm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x11,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <32 x i8>*
|
|
|
|
store <32 x i8>%data, <32 x i8>* %vaddr, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i8> @test_256_3(i8 * %addr, <32 x i8> %old, <32 x i8> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmb %ymm1, %ymm1, %k1 ## encoding: [0x62,0xf2,0x75,0x28,0x26,0xc9]
|
2017-01-08 06:20:34 +08:00
|
|
|
; CHECK-NEXT: vmovdqu8 (%rdi), %ymm0 {%k1} ## encoding: [0x62,0xf1,0x7f,0x29,0x6f,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <32 x i8> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <32 x i8>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <32 x i8>, <32 x i8>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <32 x i1> %mask, <32 x i8> %r, <32 x i8> %old
|
|
|
|
ret <32 x i8>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i8> @test_256_4(i8 * %addr, <32 x i8> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmb %ymm0, %ymm0, %k1 ## encoding: [0x62,0xf2,0x7d,0x28,0x26,0xc8]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vmovdqu8 (%rdi), %ymm0 {%k1} {z} ## encoding: [0x62,0xf1,0x7f,0xa9,0x6f,0x07]
|
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <32 x i8> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <32 x i8>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <32 x i8>, <32 x i8>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <32 x i1> %mask, <32 x i8> %r, <32 x i8> zeroinitializer
|
|
|
|
ret <32 x i8>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i16> @test_256_5(i8 * %addr) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 01:35:44 +08:00
|
|
|
; CHECK-NEXT: vmovups (%rdi), %ymm0 ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x10,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <16 x i16>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%res = load <16 x i16>, <16 x i16>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
ret <16 x i16>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_256_6(i8 * %addr, <16 x i16> %data) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 23:31:24 +08:00
|
|
|
; CHECK-NEXT: vmovups %ymm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x11,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <16 x i16>*
|
|
|
|
store <16 x i16>%data, <16 x i16>* %vaddr, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i16> @test_256_7(i8 * %addr, <16 x i16> %old, <16 x i16> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmw %ymm1, %ymm1, %k1 ## encoding: [0x62,0xf2,0xf5,0x28,0x26,0xc9]
|
2017-01-08 06:20:34 +08:00
|
|
|
; CHECK-NEXT: vmovdqu16 (%rdi), %ymm0 {%k1} ## encoding: [0x62,0xf1,0xff,0x29,0x6f,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <16 x i16> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <16 x i16>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <16 x i16>, <16 x i16>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <16 x i1> %mask, <16 x i16> %r, <16 x i16> %old
|
|
|
|
ret <16 x i16>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i16> @test_256_8(i8 * %addr, <16 x i16> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_256_8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmw %ymm0, %ymm0, %k1 ## encoding: [0x62,0xf2,0xfd,0x28,0x26,0xc8]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vmovdqu16 (%rdi), %ymm0 {%k1} {z} ## encoding: [0x62,0xf1,0xff,0xa9,0x6f,0x07]
|
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <16 x i16> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <16 x i16>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <16 x i16>, <16 x i16>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <16 x i1> %mask, <16 x i16> %r, <16 x i16> zeroinitializer
|
|
|
|
ret <16 x i16>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i8> @test_128_1(i8 * %addr) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 01:35:44 +08:00
|
|
|
; CHECK-NEXT: vmovups (%rdi), %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x10,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <16 x i8>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%res = load <16 x i8>, <16 x i8>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
ret <16 x i8>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_128_2(i8 * %addr, <16 x i8> %data) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 23:31:24 +08:00
|
|
|
; CHECK-NEXT: vmovups %xmm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x11,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <16 x i8>*
|
|
|
|
store <16 x i8>%data, <16 x i8>* %vaddr, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i8> @test_128_3(i8 * %addr, <16 x i8> %old, <16 x i8> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmb %xmm1, %xmm1, %k1 ## encoding: [0x62,0xf2,0x75,0x08,0x26,0xc9]
|
2017-01-08 06:20:34 +08:00
|
|
|
; CHECK-NEXT: vmovdqu8 (%rdi), %xmm0 {%k1} ## encoding: [0x62,0xf1,0x7f,0x09,0x6f,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <16 x i8> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <16 x i8>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <16 x i8>, <16 x i8>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <16 x i1> %mask, <16 x i8> %r, <16 x i8> %old
|
|
|
|
ret <16 x i8>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i8> @test_128_4(i8 * %addr, <16 x i8> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmb %xmm0, %xmm0, %k1 ## encoding: [0x62,0xf2,0x7d,0x08,0x26,0xc8]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vmovdqu8 (%rdi), %xmm0 {%k1} {z} ## encoding: [0x62,0xf1,0x7f,0x89,0x6f,0x07]
|
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <16 x i8> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <16 x i8>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <16 x i8>, <16 x i8>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <16 x i1> %mask, <16 x i8> %r, <16 x i8> zeroinitializer
|
|
|
|
ret <16 x i8>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @test_128_5(i8 * %addr) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 01:35:44 +08:00
|
|
|
; CHECK-NEXT: vmovups (%rdi), %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x10,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <8 x i16>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%res = load <8 x i16>, <8 x i16>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
ret <8 x i16>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_128_6(i8 * %addr, <8 x i16> %data) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-08-01 23:31:24 +08:00
|
|
|
; CHECK-NEXT: vmovups %xmm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x11,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%vaddr = bitcast i8* %addr to <8 x i16>*
|
|
|
|
store <8 x i16>%data, <8 x i16>* %vaddr, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @test_128_7(i8 * %addr, <8 x i16> %old, <8 x i16> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmw %xmm1, %xmm1, %k1 ## encoding: [0x62,0xf2,0xf5,0x08,0x26,0xc9]
|
2017-01-08 06:20:34 +08:00
|
|
|
; CHECK-NEXT: vmovdqu16 (%rdi), %xmm0 {%k1} ## encoding: [0x62,0xf1,0xff,0x09,0x6f,0x07]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <8 x i16> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <8 x i16>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <8 x i16>, <8 x i16>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <8 x i1> %mask, <8 x i16> %r, <8 x i16> %old
|
|
|
|
ret <8 x i16>%res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @test_128_8(i8 * %addr, <8 x i16> %mask1) {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test_128_8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestmw %xmm0, %xmm0, %k1 ## encoding: [0x62,0xf2,0xfd,0x08,0x26,0xc8]
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vmovdqu16 (%rdi), %xmm0 {%k1} {z} ## encoding: [0x62,0xf1,0xff,0x89,0x6f,0x07]
|
|
|
|
; CHECK-NEXT: retq ## encoding: [0xc3]
|
2014-09-26 17:48:50 +08:00
|
|
|
%mask = icmp ne <8 x i16> %mask1, zeroinitializer
|
|
|
|
%vaddr = bitcast i8* %addr to <8 x i16>*
|
2015-02-28 05:17:42 +08:00
|
|
|
%r = load <8 x i16>, <8 x i16>* %vaddr, align 1
|
2014-09-26 17:48:50 +08:00
|
|
|
%res = select <8 x i1> %mask, <8 x i16> %r, <8 x i16> zeroinitializer
|
|
|
|
ret <8 x i16>%res
|
|
|
|
}
|
|
|
|
|