1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512bw -mattr=+avx512vl --show-mc-encoding| FileCheck %s
4 define <32 x i8> @test_256_1(ptr %addr) {
5 ; CHECK-LABEL: test_256_1:
7 ; CHECK-NEXT: vmovups (%rdi), %ymm0 ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x10,0x07]
8 ; CHECK-NEXT: retq ## encoding: [0xc3]
9 %res = load <32 x i8>, ptr %addr, align 1
13 define void @test_256_2(ptr %addr, <32 x i8> %data) {
14 ; CHECK-LABEL: test_256_2:
16 ; CHECK-NEXT: vmovups %ymm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x11,0x07]
17 ; CHECK-NEXT: retq ## encoding: [0xc3]
18 store <32 x i8>%data, ptr %addr, align 1
22 define <32 x i8> @test_256_3(ptr %addr, <32 x i8> %old, <32 x i8> %mask1) {
23 ; CHECK-LABEL: test_256_3:
25 ; CHECK-NEXT: vptestmb %ymm1, %ymm1, %k1 ## encoding: [0x62,0xf2,0x75,0x28,0x26,0xc9]
26 ; CHECK-NEXT: vmovdqu8 (%rdi), %ymm0 {%k1} ## encoding: [0x62,0xf1,0x7f,0x29,0x6f,0x07]
27 ; CHECK-NEXT: retq ## encoding: [0xc3]
28 %mask = icmp ne <32 x i8> %mask1, zeroinitializer
29 %r = load <32 x i8>, ptr %addr, align 1
30 %res = select <32 x i1> %mask, <32 x i8> %r, <32 x i8> %old
34 define <32 x i8> @test_256_4(ptr %addr, <32 x i8> %mask1) {
35 ; CHECK-LABEL: test_256_4:
37 ; CHECK-NEXT: vptestmb %ymm0, %ymm0, %k1 ## encoding: [0x62,0xf2,0x7d,0x28,0x26,0xc8]
38 ; CHECK-NEXT: vmovdqu8 (%rdi), %ymm0 {%k1} {z} ## encoding: [0x62,0xf1,0x7f,0xa9,0x6f,0x07]
39 ; CHECK-NEXT: retq ## encoding: [0xc3]
40 %mask = icmp ne <32 x i8> %mask1, zeroinitializer
41 %r = load <32 x i8>, ptr %addr, align 1
42 %res = select <32 x i1> %mask, <32 x i8> %r, <32 x i8> zeroinitializer
46 define <16 x i16> @test_256_5(ptr %addr) {
47 ; CHECK-LABEL: test_256_5:
49 ; CHECK-NEXT: vmovups (%rdi), %ymm0 ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x10,0x07]
50 ; CHECK-NEXT: retq ## encoding: [0xc3]
51 %res = load <16 x i16>, ptr %addr, align 1
55 define void @test_256_6(ptr %addr, <16 x i16> %data) {
56 ; CHECK-LABEL: test_256_6:
58 ; CHECK-NEXT: vmovups %ymm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xfc,0x11,0x07]
59 ; CHECK-NEXT: retq ## encoding: [0xc3]
60 store <16 x i16>%data, ptr %addr, align 1
64 define <16 x i16> @test_256_7(ptr %addr, <16 x i16> %old, <16 x i16> %mask1) {
65 ; CHECK-LABEL: test_256_7:
67 ; CHECK-NEXT: vptestmw %ymm1, %ymm1, %k1 ## encoding: [0x62,0xf2,0xf5,0x28,0x26,0xc9]
68 ; CHECK-NEXT: vmovdqu16 (%rdi), %ymm0 {%k1} ## encoding: [0x62,0xf1,0xff,0x29,0x6f,0x07]
69 ; CHECK-NEXT: retq ## encoding: [0xc3]
70 %mask = icmp ne <16 x i16> %mask1, zeroinitializer
71 %r = load <16 x i16>, ptr %addr, align 1
72 %res = select <16 x i1> %mask, <16 x i16> %r, <16 x i16> %old
76 define <16 x i16> @test_256_8(ptr %addr, <16 x i16> %mask1) {
77 ; CHECK-LABEL: test_256_8:
79 ; CHECK-NEXT: vptestmw %ymm0, %ymm0, %k1 ## encoding: [0x62,0xf2,0xfd,0x28,0x26,0xc8]
80 ; CHECK-NEXT: vmovdqu16 (%rdi), %ymm0 {%k1} {z} ## encoding: [0x62,0xf1,0xff,0xa9,0x6f,0x07]
81 ; CHECK-NEXT: retq ## encoding: [0xc3]
82 %mask = icmp ne <16 x i16> %mask1, zeroinitializer
83 %r = load <16 x i16>, ptr %addr, align 1
84 %res = select <16 x i1> %mask, <16 x i16> %r, <16 x i16> zeroinitializer
88 define <16 x i8> @test_128_1(ptr %addr) {
89 ; CHECK-LABEL: test_128_1:
91 ; CHECK-NEXT: vmovups (%rdi), %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x10,0x07]
92 ; CHECK-NEXT: retq ## encoding: [0xc3]
93 %res = load <16 x i8>, ptr %addr, align 1
97 define void @test_128_2(ptr %addr, <16 x i8> %data) {
98 ; CHECK-LABEL: test_128_2:
100 ; CHECK-NEXT: vmovups %xmm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x11,0x07]
101 ; CHECK-NEXT: retq ## encoding: [0xc3]
102 store <16 x i8>%data, ptr %addr, align 1
106 define <16 x i8> @test_128_3(ptr %addr, <16 x i8> %old, <16 x i8> %mask1) {
107 ; CHECK-LABEL: test_128_3:
109 ; CHECK-NEXT: vptestmb %xmm1, %xmm1, %k1 ## encoding: [0x62,0xf2,0x75,0x08,0x26,0xc9]
110 ; CHECK-NEXT: vmovdqu8 (%rdi), %xmm0 {%k1} ## encoding: [0x62,0xf1,0x7f,0x09,0x6f,0x07]
111 ; CHECK-NEXT: retq ## encoding: [0xc3]
112 %mask = icmp ne <16 x i8> %mask1, zeroinitializer
113 %r = load <16 x i8>, ptr %addr, align 1
114 %res = select <16 x i1> %mask, <16 x i8> %r, <16 x i8> %old
118 define <16 x i8> @test_128_4(ptr %addr, <16 x i8> %mask1) {
119 ; CHECK-LABEL: test_128_4:
121 ; CHECK-NEXT: vptestmb %xmm0, %xmm0, %k1 ## encoding: [0x62,0xf2,0x7d,0x08,0x26,0xc8]
122 ; CHECK-NEXT: vmovdqu8 (%rdi), %xmm0 {%k1} {z} ## encoding: [0x62,0xf1,0x7f,0x89,0x6f,0x07]
123 ; CHECK-NEXT: retq ## encoding: [0xc3]
124 %mask = icmp ne <16 x i8> %mask1, zeroinitializer
125 %r = load <16 x i8>, ptr %addr, align 1
126 %res = select <16 x i1> %mask, <16 x i8> %r, <16 x i8> zeroinitializer
130 define <8 x i16> @test_128_5(ptr %addr) {
131 ; CHECK-LABEL: test_128_5:
133 ; CHECK-NEXT: vmovups (%rdi), %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x10,0x07]
134 ; CHECK-NEXT: retq ## encoding: [0xc3]
135 %res = load <8 x i16>, ptr %addr, align 1
139 define void @test_128_6(ptr %addr, <8 x i16> %data) {
140 ; CHECK-LABEL: test_128_6:
142 ; CHECK-NEXT: vmovups %xmm0, (%rdi) ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x11,0x07]
143 ; CHECK-NEXT: retq ## encoding: [0xc3]
144 store <8 x i16>%data, ptr %addr, align 1
148 define <8 x i16> @test_128_7(ptr %addr, <8 x i16> %old, <8 x i16> %mask1) {
149 ; CHECK-LABEL: test_128_7:
151 ; CHECK-NEXT: vptestmw %xmm1, %xmm1, %k1 ## encoding: [0x62,0xf2,0xf5,0x08,0x26,0xc9]
152 ; CHECK-NEXT: vmovdqu16 (%rdi), %xmm0 {%k1} ## encoding: [0x62,0xf1,0xff,0x09,0x6f,0x07]
153 ; CHECK-NEXT: retq ## encoding: [0xc3]
154 %mask = icmp ne <8 x i16> %mask1, zeroinitializer
155 %r = load <8 x i16>, ptr %addr, align 1
156 %res = select <8 x i1> %mask, <8 x i16> %r, <8 x i16> %old
160 define <8 x i16> @test_128_8(ptr %addr, <8 x i16> %mask1) {
161 ; CHECK-LABEL: test_128_8:
163 ; CHECK-NEXT: vptestmw %xmm0, %xmm0, %k1 ## encoding: [0x62,0xf2,0xfd,0x08,0x26,0xc8]
164 ; CHECK-NEXT: vmovdqu16 (%rdi), %xmm0 {%k1} {z} ## encoding: [0x62,0xf1,0xff,0x89,0x6f,0x07]
165 ; CHECK-NEXT: retq ## encoding: [0xc3]
166 %mask = icmp ne <8 x i16> %mask1, zeroinitializer
167 %r = load <8 x i16>, ptr %addr, align 1
168 %res = select <8 x i1> %mask, <8 x i16> %r, <8 x i16> zeroinitializer