1 ; RUN: llc < %s -march=x86-64 -mcpu=penryn | FileCheck -check-prefix=SSE41 %s
2 ; RUN: llc < %s -march=x86-64 -mcpu=corei7-avx | FileCheck -check-prefix=AVX1 %s
3 ; RUN: llc < %s -march=x86-64 -mcpu=core-avx2 | FileCheck -check-prefix=AVX2 %s
6 ; These tests inject a store into the chain to test the inreg versions of pmovsx
8 define void @test1(<2 x i8>* %in, <2 x i64>* %out) nounwind {
9 %wide.load35 = load <2 x i8>* %in, align 1
10 %sext = sext <2 x i8> %wide.load35 to <2 x i64>
11 store <2 x i64> zeroinitializer, <2 x i64>* undef, align 8
12 store <2 x i64> %sext, <2 x i64>* %out, align 8
25 define void @test2(<4 x i8>* %in, <4 x i64>* %out) nounwind {
26 %wide.load35 = load <4 x i8>* %in, align 1
27 %sext = sext <4 x i8> %wide.load35 to <4 x i64>
28 store <4 x i64> zeroinitializer, <4 x i64>* undef, align 8
29 store <4 x i64> %sext, <4 x i64>* %out, align 8
36 define void @test3(<4 x i8>* %in, <4 x i32>* %out) nounwind {
37 %wide.load35 = load <4 x i8>* %in, align 1
38 %sext = sext <4 x i8> %wide.load35 to <4 x i32>
39 store <4 x i32> zeroinitializer, <4 x i32>* undef, align 8
40 store <4 x i32> %sext, <4 x i32>* %out, align 8
53 define void @test4(<8 x i8>* %in, <8 x i32>* %out) nounwind {
54 %wide.load35 = load <8 x i8>* %in, align 1
55 %sext = sext <8 x i8> %wide.load35 to <8 x i32>
56 store <8 x i32> zeroinitializer, <8 x i32>* undef, align 8
57 store <8 x i32> %sext, <8 x i32>* %out, align 8
64 define void @test5(<8 x i8>* %in, <8 x i16>* %out) nounwind {
65 %wide.load35 = load <8 x i8>* %in, align 1
66 %sext = sext <8 x i8> %wide.load35 to <8 x i16>
67 store <8 x i16> zeroinitializer, <8 x i16>* undef, align 8
68 store <8 x i16> %sext, <8 x i16>* %out, align 8
81 define void @test6(<16 x i8>* %in, <16 x i16>* %out) nounwind {
82 %wide.load35 = load <16 x i8>* %in, align 1
83 %sext = sext <16 x i8> %wide.load35 to <16 x i16>
84 store <16 x i16> zeroinitializer, <16 x i16>* undef, align 8
85 store <16 x i16> %sext, <16 x i16>* %out, align 8
92 define void @test7(<2 x i16>* %in, <2 x i64>* %out) nounwind {
93 %wide.load35 = load <2 x i16>* %in, align 1
94 %sext = sext <2 x i16> %wide.load35 to <2 x i64>
95 store <2 x i64> zeroinitializer, <2 x i64>* undef, align 8
96 store <2 x i64> %sext, <2 x i64>* %out, align 8
100 ; SSE41-LABEL: test7:
110 define void @test8(<4 x i16>* %in, <4 x i64>* %out) nounwind {
111 %wide.load35 = load <4 x i16>* %in, align 1
112 %sext = sext <4 x i16> %wide.load35 to <4 x i64>
113 store <4 x i64> zeroinitializer, <4 x i64>* undef, align 8
114 store <4 x i64> %sext, <4 x i64>* %out, align 8
121 define void @test9(<4 x i16>* %in, <4 x i32>* %out) nounwind {
122 %wide.load35 = load <4 x i16>* %in, align 1
123 %sext = sext <4 x i16> %wide.load35 to <4 x i32>
124 store <4 x i32> zeroinitializer, <4 x i32>* undef, align 8
125 store <4 x i32> %sext, <4 x i32>* %out, align 8
128 ; SSE41-LABEL: test9:
138 define void @test10(<8 x i16>* %in, <8 x i32>* %out) nounwind {
139 %wide.load35 = load <8 x i16>* %in, align 1
140 %sext = sext <8 x i16> %wide.load35 to <8 x i32>
141 store <8 x i32> zeroinitializer, <8 x i32>* undef, align 8
142 store <8 x i32> %sext, <8 x i32>* %out, align 8
145 ; AVX2-LABEL: test10:
149 define void @test11(<2 x i32>* %in, <2 x i64>* %out) nounwind {
150 %wide.load35 = load <2 x i32>* %in, align 1
151 %sext = sext <2 x i32> %wide.load35 to <2 x i64>
152 store <2 x i64> zeroinitializer, <2 x i64>* undef, align 8
153 store <2 x i64> %sext, <2 x i64>* %out, align 8
156 ; SSE41-LABEL: test11:
159 ; AVX1-LABEL: test11:
162 ; AVX2-LABEL: test11:
166 define void @test12(<4 x i32>* %in, <4 x i64>* %out) nounwind {
167 %wide.load35 = load <4 x i32>* %in, align 1
168 %sext = sext <4 x i32> %wide.load35 to <4 x i64>
169 store <4 x i64> zeroinitializer, <4 x i64>* undef, align 8
170 store <4 x i64> %sext, <4 x i64>* %out, align 8
173 ; AVX2-LABEL: test12: