1 ; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | not grep movd
2 ; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | not grep movq
3 ; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | grep pmovsxbd
4 ; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | grep pmovsxwd
5 ; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | grep pmovsxbq
6 ; RUN: llvm-as < %s | llc -march=x86-64 -mattr=sse41 -mtriple=x86_64-apple-darwin | grep movq | count 1
7 ; RUN: llvm-as < %s | llc -march=x86-64 -mattr=sse41 -mtriple=x86_64-unknown-linux-gnu | not grep movq
9 define <2 x i64> @t1(i32* %p) nounwind {
11 %0 = load i32* %p, align 4 ; <i32> [#uses=1]
12 %1 = insertelement <4 x i32> undef, i32 %0, i32 0 ; <<4 x i32>> [#uses=1]
13 %2 = insertelement <4 x i32> %1, i32 0, i32 1 ; <<4 x i32>> [#uses=1]
14 %3 = insertelement <4 x i32> %2, i32 0, i32 2 ; <<4 x i32>> [#uses=1]
15 %4 = insertelement <4 x i32> %3, i32 0, i32 3 ; <<4 x i32>> [#uses=1]
16 %5 = bitcast <4 x i32> %4 to <16 x i8> ; <<16 x i8>> [#uses=1]
17 %6 = tail call <4 x i32> @llvm.x86.sse41.pmovsxbd(<16 x i8> %5) nounwind readnone ; <<4 x i32>> [#uses=1]
18 %7 = bitcast <4 x i32> %6 to <2 x i64> ; <<2 x i64>> [#uses=1]
22 declare <4 x i32> @llvm.x86.sse41.pmovsxbd(<16 x i8>) nounwind readnone
24 define <2 x i64> @t2(i64* %p) nounwind readonly {
26 %0 = load i64* %p ; <i64> [#uses=1]
27 %tmp2 = insertelement <2 x i64> zeroinitializer, i64 %0, i32 0 ; <<2 x i64>> [#uses=1]
28 %1 = bitcast <2 x i64> %tmp2 to <8 x i16> ; <<8 x i16>> [#uses=1]
29 %2 = tail call <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16> %1) nounwind readnone ; <<4 x i32>> [#uses=1]
30 %3 = bitcast <4 x i32> %2 to <2 x i64> ; <<2 x i64>> [#uses=1]
34 declare <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16>) nounwind readnone
37 @gv = external global i16 ; <i16*> [#uses=1]
39 define <2 x i64> @t3() nounwind {
41 %0 = load i16* @gv, align 2 ; <i16> [#uses=1]
42 %1 = insertelement <8 x i16> undef, i16 %0, i32 0 ; <<8 x i16>> [#uses=1]
43 %2 = bitcast <8 x i16> %1 to <16 x i8> ; <<16 x i8>> [#uses=1]
44 %3 = tail call <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8> %2) nounwind readnone ; <<2 x i64>> [#uses=1]
48 declare <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8>) nounwind readnone