1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=i686-apple-darwin -mattr=+avx2 | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mattr=+avx2 | FileCheck %s --check-prefix=X64
4 ; RUN: llc < %s -disable-peephole -mtriple=i686-apple-darwin -mattr=+avx512vl,avx512bw | FileCheck %s --check-prefix=X86
5 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mattr=+avx512vl,avx512bw | FileCheck %s --check-prefix=X64
7 define <16 x i16> @test_llvm_x86_avx2_pmovsxbw(ptr %a) {
8 ; X86-LABEL: test_llvm_x86_avx2_pmovsxbw:
10 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
11 ; X86-NEXT: vpmovsxbw (%eax), %ymm0
14 ; X64-LABEL: test_llvm_x86_avx2_pmovsxbw:
16 ; X64-NEXT: vpmovsxbw (%rdi), %ymm0
18 %1 = load <16 x i8>, ptr %a, align 1
19 %2 = sext <16 x i8> %1 to <16 x i16>
23 define <8 x i32> @test_llvm_x86_avx2_pmovsxbd(ptr %a) {
24 ; X86-LABEL: test_llvm_x86_avx2_pmovsxbd:
26 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
27 ; X86-NEXT: vpmovsxbd (%eax), %ymm0
30 ; X64-LABEL: test_llvm_x86_avx2_pmovsxbd:
32 ; X64-NEXT: vpmovsxbd (%rdi), %ymm0
34 %1 = load <16 x i8>, ptr %a, align 1
35 %2 = shufflevector <16 x i8> %1, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
36 %3 = sext <8 x i8> %2 to <8 x i32>
40 define <4 x i64> @test_llvm_x86_avx2_pmovsxbq(ptr %a) {
41 ; X86-LABEL: test_llvm_x86_avx2_pmovsxbq:
43 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
44 ; X86-NEXT: vpmovsxbq (%eax), %ymm0
47 ; X64-LABEL: test_llvm_x86_avx2_pmovsxbq:
49 ; X64-NEXT: vpmovsxbq (%rdi), %ymm0
51 %1 = load <16 x i8>, ptr %a, align 1
52 %2 = shufflevector <16 x i8> %1, <16 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
53 %3 = sext <4 x i8> %2 to <4 x i64>
57 define <8 x i32> @test_llvm_x86_avx2_pmovsxwd(ptr %a) {
58 ; X86-LABEL: test_llvm_x86_avx2_pmovsxwd:
60 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
61 ; X86-NEXT: vpmovsxwd (%eax), %ymm0
64 ; X64-LABEL: test_llvm_x86_avx2_pmovsxwd:
66 ; X64-NEXT: vpmovsxwd (%rdi), %ymm0
68 %1 = load <8 x i16>, ptr %a, align 1
69 %2 = sext <8 x i16> %1 to <8 x i32>
73 define <4 x i64> @test_llvm_x86_avx2_pmovsxwq(ptr %a) {
74 ; X86-LABEL: test_llvm_x86_avx2_pmovsxwq:
76 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
77 ; X86-NEXT: vpmovsxwq (%eax), %ymm0
80 ; X64-LABEL: test_llvm_x86_avx2_pmovsxwq:
82 ; X64-NEXT: vpmovsxwq (%rdi), %ymm0
84 %1 = load <8 x i16>, ptr %a, align 1
85 %2 = shufflevector <8 x i16> %1, <8 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
86 %3 = sext <4 x i16> %2 to <4 x i64>
90 define <4 x i64> @test_llvm_x86_avx2_pmovsxdq(ptr %a) {
91 ; X86-LABEL: test_llvm_x86_avx2_pmovsxdq:
93 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
94 ; X86-NEXT: vpmovsxdq (%eax), %ymm0
97 ; X64-LABEL: test_llvm_x86_avx2_pmovsxdq:
99 ; X64-NEXT: vpmovsxdq (%rdi), %ymm0
101 %1 = load <4 x i32>, ptr %a, align 1
102 %2 = sext <4 x i32> %1 to <4 x i64>
106 define <16 x i16> @test_llvm_x86_avx2_pmovzxbw(ptr %a) {
107 ; X86-LABEL: test_llvm_x86_avx2_pmovzxbw:
109 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
110 ; X86-NEXT: vpmovzxbw {{.*#+}} ymm0 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero,mem[4],zero,mem[5],zero,mem[6],zero,mem[7],zero,mem[8],zero,mem[9],zero,mem[10],zero,mem[11],zero,mem[12],zero,mem[13],zero,mem[14],zero,mem[15],zero
113 ; X64-LABEL: test_llvm_x86_avx2_pmovzxbw:
115 ; X64-NEXT: vpmovzxbw {{.*#+}} ymm0 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero,mem[4],zero,mem[5],zero,mem[6],zero,mem[7],zero,mem[8],zero,mem[9],zero,mem[10],zero,mem[11],zero,mem[12],zero,mem[13],zero,mem[14],zero,mem[15],zero
117 %1 = load <16 x i8>, ptr %a, align 1
118 %2 = zext <16 x i8> %1 to <16 x i16>
122 define <8 x i32> @test_llvm_x86_avx2_pmovzxbd(ptr %a) {
123 ; X86-LABEL: test_llvm_x86_avx2_pmovzxbd:
125 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
126 ; X86-NEXT: vpmovzxbd {{.*#+}} ymm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero,mem[4],zero,zero,zero,mem[5],zero,zero,zero,mem[6],zero,zero,zero,mem[7],zero,zero,zero
129 ; X64-LABEL: test_llvm_x86_avx2_pmovzxbd:
131 ; X64-NEXT: vpmovzxbd {{.*#+}} ymm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero,mem[4],zero,zero,zero,mem[5],zero,zero,zero,mem[6],zero,zero,zero,mem[7],zero,zero,zero
133 %1 = load <16 x i8>, ptr %a, align 1
134 %2 = shufflevector <16 x i8> %1, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
135 %3 = zext <8 x i8> %2 to <8 x i32>
139 define <4 x i64> @test_llvm_x86_avx2_pmovzxbq(ptr %a) {
140 ; X86-LABEL: test_llvm_x86_avx2_pmovzxbq:
142 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
143 ; X86-NEXT: vpmovzxbq {{.*#+}} ymm0 = mem[0],zero,zero,zero,zero,zero,zero,zero,mem[1],zero,zero,zero,zero,zero,zero,zero,mem[2],zero,zero,zero,zero,zero,zero,zero,mem[3],zero,zero,zero,zero,zero,zero,zero
146 ; X64-LABEL: test_llvm_x86_avx2_pmovzxbq:
148 ; X64-NEXT: vpmovzxbq {{.*#+}} ymm0 = mem[0],zero,zero,zero,zero,zero,zero,zero,mem[1],zero,zero,zero,zero,zero,zero,zero,mem[2],zero,zero,zero,zero,zero,zero,zero,mem[3],zero,zero,zero,zero,zero,zero,zero
150 %1 = load <16 x i8>, ptr %a, align 1
151 %2 = shufflevector <16 x i8> %1, <16 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
152 %3 = zext <4 x i8> %2 to <4 x i64>
156 define <8 x i32> @test_llvm_x86_avx2_pmovzxwd(ptr %a) {
157 ; X86-LABEL: test_llvm_x86_avx2_pmovzxwd:
159 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
160 ; X86-NEXT: vpmovzxwd {{.*#+}} ymm0 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero,mem[4],zero,mem[5],zero,mem[6],zero,mem[7],zero
163 ; X64-LABEL: test_llvm_x86_avx2_pmovzxwd:
165 ; X64-NEXT: vpmovzxwd {{.*#+}} ymm0 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero,mem[4],zero,mem[5],zero,mem[6],zero,mem[7],zero
167 %1 = load <8 x i16>, ptr %a, align 1
168 %2 = zext <8 x i16> %1 to <8 x i32>
172 define <4 x i64> @test_llvm_x86_avx2_pmovzxwq(ptr %a) {
173 ; X86-LABEL: test_llvm_x86_avx2_pmovzxwq:
175 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
176 ; X86-NEXT: vpmovzxwq {{.*#+}} ymm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero
179 ; X64-LABEL: test_llvm_x86_avx2_pmovzxwq:
181 ; X64-NEXT: vpmovzxwq {{.*#+}} ymm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero
183 %1 = load <8 x i16>, ptr %a, align 1
184 %2 = shufflevector <8 x i16> %1, <8 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
185 %3 = zext <4 x i16> %2 to <4 x i64>
189 define <4 x i64> @test_llvm_x86_avx2_pmovzxdq(ptr %a) {
190 ; X86-LABEL: test_llvm_x86_avx2_pmovzxdq:
192 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
193 ; X86-NEXT: vpmovzxdq {{.*#+}} ymm0 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero
196 ; X64-LABEL: test_llvm_x86_avx2_pmovzxdq:
198 ; X64-NEXT: vpmovzxdq {{.*#+}} ymm0 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero
200 %1 = load <4 x i32>, ptr %a, align 1
201 %2 = zext <4 x i32> %1 to <4 x i64>