1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown --mattr=+avx,+no-bypass-delay-shuffle | FileCheck %s --check-prefixes=CHECK,CHECK-AVX1
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown --mattr=+avx | FileCheck %s --check-prefixes=CHECK,CHECK-AVX1-DELAY
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown --mattr=+avx2,+no-bypass-delay-shuffle | FileCheck %s --check-prefixes=CHECK,CHECK-AVX2
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown --mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,CHECK-AVX2-DELAY
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=icelake-server | FileCheck %s --check-prefixes=CHECK,CHECK-ICX,CHECK-ICX-NO-BYPASS-DELAY
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=icelake-server -mattr=-no-bypass-delay-shuffle | FileCheck %s --check-prefixes=CHECK,CHECK-ICX,CHECK-ICX-BYPASS-DELAY
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=sandybridge -mattr=+no-bypass-delay-shuffle | FileCheck %s --check-prefixes=CHECK,CHECK-SNB,CHECK-SNB-NO-BYPASS-DELAY
9 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=sandybridge -mattr=-no-bypass-delay-shuffle | FileCheck %s --check-prefixes=CHECK,CHECK-SNB,CHECK-SNB-BYPASS-DELAY
11 define <8 x float> @transform_VPERMILPSYrr(<8 x float> %a) nounwind {
12 ; CHECK-LABEL: transform_VPERMILPSYrr:
14 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
16 %shufp = shufflevector <8 x float> %a, <8 x float> poison, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
17 ret <8 x float> %shufp
20 define <4 x float> @transform_VPERMILPSrr(<4 x float> %a) nounwind {
21 ; CHECK-LABEL: transform_VPERMILPSrr:
23 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 = xmm0[3,2,1,0]
25 %shufp = shufflevector <4 x float> %a, <4 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
26 ret <4 x float> %shufp
29 define <8 x float> @transform_VPERMILPSYrm(ptr %ap) nounwind {
30 ; CHECK-AVX1-LABEL: transform_VPERMILPSYrm:
31 ; CHECK-AVX1: # %bb.0:
32 ; CHECK-AVX1-NEXT: vpermilps {{.*#+}} ymm0 = mem[3,2,1,0,7,6,5,4]
33 ; CHECK-AVX1-NEXT: retq
35 ; CHECK-AVX1-DELAY-LABEL: transform_VPERMILPSYrm:
36 ; CHECK-AVX1-DELAY: # %bb.0:
37 ; CHECK-AVX1-DELAY-NEXT: vpermilps {{.*#+}} ymm0 = mem[3,2,1,0,7,6,5,4]
38 ; CHECK-AVX1-DELAY-NEXT: retq
40 ; CHECK-AVX2-LABEL: transform_VPERMILPSYrm:
41 ; CHECK-AVX2: # %bb.0:
42 ; CHECK-AVX2-NEXT: vpermilps {{.*#+}} ymm0 = mem[3,2,1,0,7,6,5,4]
43 ; CHECK-AVX2-NEXT: retq
45 ; CHECK-AVX2-DELAY-LABEL: transform_VPERMILPSYrm:
46 ; CHECK-AVX2-DELAY: # %bb.0:
47 ; CHECK-AVX2-DELAY-NEXT: vpermilps {{.*#+}} ymm0 = mem[3,2,1,0,7,6,5,4]
48 ; CHECK-AVX2-DELAY-NEXT: retq
50 ; CHECK-ICX-NO-BYPASS-DELAY-LABEL: transform_VPERMILPSYrm:
51 ; CHECK-ICX-NO-BYPASS-DELAY: # %bb.0:
52 ; CHECK-ICX-NO-BYPASS-DELAY-NEXT: vpshufd {{.*#+}} ymm0 = mem[3,2,1,0,7,6,5,4]
53 ; CHECK-ICX-NO-BYPASS-DELAY-NEXT: retq
55 ; CHECK-ICX-BYPASS-DELAY-LABEL: transform_VPERMILPSYrm:
56 ; CHECK-ICX-BYPASS-DELAY: # %bb.0:
57 ; CHECK-ICX-BYPASS-DELAY-NEXT: vpermilps {{.*#+}} ymm0 = mem[3,2,1,0,7,6,5,4]
58 ; CHECK-ICX-BYPASS-DELAY-NEXT: retq
60 ; CHECK-SNB-LABEL: transform_VPERMILPSYrm:
62 ; CHECK-SNB-NEXT: vpermilps {{.*#+}} ymm0 = mem[3,2,1,0,7,6,5,4]
63 ; CHECK-SNB-NEXT: retq
64 %a = load <8 x float>, ptr %ap
65 %shufp = shufflevector <8 x float> %a, <8 x float> poison, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
66 ret <8 x float> %shufp
69 define <4 x float> @transform_VPERMILPSrm(ptr %ap) nounwind {
70 ; CHECK-AVX1-LABEL: transform_VPERMILPSrm:
71 ; CHECK-AVX1: # %bb.0:
72 ; CHECK-AVX1-NEXT: vpermilps {{.*#+}} xmm0 = mem[3,2,1,0]
73 ; CHECK-AVX1-NEXT: retq
75 ; CHECK-AVX1-DELAY-LABEL: transform_VPERMILPSrm:
76 ; CHECK-AVX1-DELAY: # %bb.0:
77 ; CHECK-AVX1-DELAY-NEXT: vpermilps {{.*#+}} xmm0 = mem[3,2,1,0]
78 ; CHECK-AVX1-DELAY-NEXT: retq
80 ; CHECK-AVX2-LABEL: transform_VPERMILPSrm:
81 ; CHECK-AVX2: # %bb.0:
82 ; CHECK-AVX2-NEXT: vpermilps {{.*#+}} xmm0 = mem[3,2,1,0]
83 ; CHECK-AVX2-NEXT: retq
85 ; CHECK-AVX2-DELAY-LABEL: transform_VPERMILPSrm:
86 ; CHECK-AVX2-DELAY: # %bb.0:
87 ; CHECK-AVX2-DELAY-NEXT: vpermilps {{.*#+}} xmm0 = mem[3,2,1,0]
88 ; CHECK-AVX2-DELAY-NEXT: retq
90 ; CHECK-ICX-NO-BYPASS-DELAY-LABEL: transform_VPERMILPSrm:
91 ; CHECK-ICX-NO-BYPASS-DELAY: # %bb.0:
92 ; CHECK-ICX-NO-BYPASS-DELAY-NEXT: vpshufd {{.*#+}} xmm0 = mem[3,2,1,0]
93 ; CHECK-ICX-NO-BYPASS-DELAY-NEXT: retq
95 ; CHECK-ICX-BYPASS-DELAY-LABEL: transform_VPERMILPSrm:
96 ; CHECK-ICX-BYPASS-DELAY: # %bb.0:
97 ; CHECK-ICX-BYPASS-DELAY-NEXT: vpermilps {{.*#+}} xmm0 = mem[3,2,1,0]
98 ; CHECK-ICX-BYPASS-DELAY-NEXT: retq
100 ; CHECK-SNB-NO-BYPASS-DELAY-LABEL: transform_VPERMILPSrm:
101 ; CHECK-SNB-NO-BYPASS-DELAY: # %bb.0:
102 ; CHECK-SNB-NO-BYPASS-DELAY-NEXT: vpshufd {{.*#+}} xmm0 = mem[3,2,1,0]
103 ; CHECK-SNB-NO-BYPASS-DELAY-NEXT: retq
105 ; CHECK-SNB-BYPASS-DELAY-LABEL: transform_VPERMILPSrm:
106 ; CHECK-SNB-BYPASS-DELAY: # %bb.0:
107 ; CHECK-SNB-BYPASS-DELAY-NEXT: vpermilps {{.*#+}} xmm0 = mem[3,2,1,0]
108 ; CHECK-SNB-BYPASS-DELAY-NEXT: retq
109 %a = load <4 x float>, ptr %ap
110 %shufp = shufflevector <4 x float> %a, <4 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
111 ret <4 x float> %shufp
113 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: