1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ;RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=knl | FileCheck %s --check-prefixes=CHECK,KNL
3 ;RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=skx | FileCheck %s --check-prefixes=CHECK,SKX
5 define <16 x i32> @ashr_16_i32(<16 x i32> %a) {
6 ; CHECK-LABEL: ashr_16_i32:
8 ; CHECK-NEXT: vpsrad $12, %zmm0, %zmm0
10 %b = ashr <16 x i32> %a, <i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12>
14 define <16 x i32> @lshr_16_i32(<16 x i32> %a) {
15 ; CHECK-LABEL: lshr_16_i32:
17 ; CHECK-NEXT: vpsrld $1, %zmm0, %zmm0
19 %b = lshr <16 x i32> %a, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
23 define <16 x i32> @shl_16_i32(<16 x i32> %a) {
24 ; CHECK-LABEL: shl_16_i32:
26 ; CHECK-NEXT: vpslld $12, %zmm0, %zmm0
28 %b = shl <16 x i32> %a, <i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12, i32 12>
32 define <8 x i64> @ashr_8_i64(<8 x i64> %a) {
33 ; CHECK-LABEL: ashr_8_i64:
35 ; CHECK-NEXT: vpsraq $12, %zmm0, %zmm0
37 %b = ashr <8 x i64> %a, <i64 12, i64 12, i64 12, i64 12, i64 12, i64 12, i64 12, i64 12>
41 define <8 x i64> @lshr_8_i64(<8 x i64> %a) {
42 ; CHECK-LABEL: lshr_8_i64:
44 ; CHECK-NEXT: vpsrlq $1, %zmm0, %zmm0
46 %b = lshr <8 x i64> %a, <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>
50 define <8 x i64> @shl_8_i64(<8 x i64> %a) {
51 ; CHECK-LABEL: shl_8_i64:
53 ; CHECK-NEXT: vpsllq $12, %zmm0, %zmm0
55 %b = shl <8 x i64> %a, <i64 12, i64 12, i64 12, i64 12, i64 12, i64 12, i64 12, i64 12>
59 define <4 x i64> @ashr_4_i64(<4 x i64> %a) {
60 ; KNL-LABEL: ashr_4_i64:
62 ; KNL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
63 ; KNL-NEXT: vpsraq $12, %zmm0, %zmm0
64 ; KNL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
67 ; SKX-LABEL: ashr_4_i64:
69 ; SKX-NEXT: vpsraq $12, %ymm0, %ymm0
71 %b = ashr <4 x i64> %a, <i64 12, i64 12, i64 12, i64 12>
75 define <4 x i64> @lshr_4_i64(<4 x i64> %a) {
76 ; CHECK-LABEL: lshr_4_i64:
78 ; CHECK-NEXT: vpsrlq $1, %ymm0, %ymm0
80 %b = lshr <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
84 define <4 x i64> @shl_4_i64(<4 x i64> %a) {
85 ; CHECK-LABEL: shl_4_i64:
87 ; CHECK-NEXT: vpsllq $12, %ymm0, %ymm0
89 %b = shl <4 x i64> %a, <i64 12, i64 12, i64 12, i64 12>
93 define <8 x i64> @variable_shl4(<8 x i64> %x, <8 x i64> %y) {
94 ; CHECK-LABEL: variable_shl4:
96 ; CHECK-NEXT: vpsllvq %zmm1, %zmm0, %zmm0
98 %k = shl <8 x i64> %x, %y
102 define <16 x i32> @variable_shl5(<16 x i32> %x, <16 x i32> %y) {
103 ; CHECK-LABEL: variable_shl5:
105 ; CHECK-NEXT: vpsllvd %zmm1, %zmm0, %zmm0
107 %k = shl <16 x i32> %x, %y
111 define <16 x i32> @variable_srl0(<16 x i32> %x, <16 x i32> %y) {
112 ; CHECK-LABEL: variable_srl0:
114 ; CHECK-NEXT: vpsrlvd %zmm1, %zmm0, %zmm0
116 %k = lshr <16 x i32> %x, %y
120 define <8 x i64> @variable_srl2(<8 x i64> %x, <8 x i64> %y) {
121 ; CHECK-LABEL: variable_srl2:
123 ; CHECK-NEXT: vpsrlvq %zmm1, %zmm0, %zmm0
125 %k = lshr <8 x i64> %x, %y
129 define <16 x i32> @variable_sra1(<16 x i32> %x, <16 x i32> %y) {
130 ; CHECK-LABEL: variable_sra1:
132 ; CHECK-NEXT: vpsravd %zmm1, %zmm0, %zmm0
134 %k = ashr <16 x i32> %x, %y
138 define <8 x i64> @variable_sra2(<8 x i64> %x, <8 x i64> %y) {
139 ; CHECK-LABEL: variable_sra2:
141 ; CHECK-NEXT: vpsravq %zmm1, %zmm0, %zmm0
143 %k = ashr <8 x i64> %x, %y
147 define <4 x i64> @variable_sra3(<4 x i64> %x, <4 x i64> %y) {
148 ; KNL-LABEL: variable_sra3:
150 ; KNL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
151 ; KNL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
152 ; KNL-NEXT: vpsravq %zmm1, %zmm0, %zmm0
153 ; KNL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
156 ; SKX-LABEL: variable_sra3:
158 ; SKX-NEXT: vpsravq %ymm1, %ymm0, %ymm0
160 %k = ashr <4 x i64> %x, %y
164 define <8 x i16> @variable_sra4(<8 x i16> %x, <8 x i16> %y) {
165 ; KNL-LABEL: variable_sra4:
167 ; KNL-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
168 ; KNL-NEXT: vpmovsxwd %xmm0, %ymm0
169 ; KNL-NEXT: vpsravd %ymm1, %ymm0, %ymm0
170 ; KNL-NEXT: vpmovdw %zmm0, %ymm0
171 ; KNL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
174 ; SKX-LABEL: variable_sra4:
176 ; SKX-NEXT: vpsravw %xmm1, %xmm0, %xmm0
178 %k = ashr <8 x i16> %x, %y
182 define <16 x i32> @variable_sra01_load(<16 x i32> %x, ptr %y) {
183 ; CHECK-LABEL: variable_sra01_load:
185 ; CHECK-NEXT: vpsravd (%rdi), %zmm0, %zmm0
187 %y1 = load <16 x i32>, ptr %y
188 %k = ashr <16 x i32> %x, %y1
192 define <16 x i32> @variable_shl1_load(<16 x i32> %x, ptr %y) {
193 ; CHECK-LABEL: variable_shl1_load:
195 ; CHECK-NEXT: vpsllvd (%rdi), %zmm0, %zmm0
197 %y1 = load <16 x i32>, ptr %y
198 %k = shl <16 x i32> %x, %y1
202 define <16 x i32> @variable_srl0_load(<16 x i32> %x, ptr %y) {
203 ; CHECK-LABEL: variable_srl0_load:
205 ; CHECK-NEXT: vpsrlvd (%rdi), %zmm0, %zmm0
207 %y1 = load <16 x i32>, ptr %y
208 %k = lshr <16 x i32> %x, %y1
212 define <8 x i64> @variable_srl3_load(<8 x i64> %x, ptr %y) {
213 ; CHECK-LABEL: variable_srl3_load:
215 ; CHECK-NEXT: vpsrlvq (%rdi), %zmm0, %zmm0
217 %y1 = load <8 x i64>, ptr %y
218 %k = lshr <8 x i64> %x, %y1