Evan Cheng | 56ec77b | 2008-09-24 23:27:55 +0000 | [diff] [blame] | 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 | grep movq | count 1 |
| 7 | |
| 8 | define <2 x i64> @t1(i32* %p) nounwind { |
| 9 | entry: |
| 10 | %0 = load i32* %p, align 4 ; <i32> [#uses=1] |
| 11 | %1 = insertelement <4 x i32> undef, i32 %0, i32 0 ; <<4 x i32>> [#uses=1] |
| 12 | %2 = insertelement <4 x i32> %1, i32 0, i32 1 ; <<4 x i32>> [#uses=1] |
| 13 | %3 = insertelement <4 x i32> %2, i32 0, i32 2 ; <<4 x i32>> [#uses=1] |
| 14 | %4 = insertelement <4 x i32> %3, i32 0, i32 3 ; <<4 x i32>> [#uses=1] |
| 15 | %5 = bitcast <4 x i32> %4 to <16 x i8> ; <<16 x i8>> [#uses=1] |
| 16 | %6 = tail call <4 x i32> @llvm.x86.sse41.pmovsxbd(<16 x i8> %5) nounwind readnone ; <<4 x i32>> [#uses=1] |
| 17 | %7 = bitcast <4 x i32> %6 to <2 x i64> ; <<2 x i64>> [#uses=1] |
| 18 | ret <2 x i64> %7 |
| 19 | } |
| 20 | |
| 21 | declare <4 x i32> @llvm.x86.sse41.pmovsxbd(<16 x i8>) nounwind readnone |
| 22 | |
| 23 | define <2 x i64> @t2(i64* %p) nounwind readonly { |
| 24 | entry: |
| 25 | %0 = load i64* %p ; <i64> [#uses=1] |
| 26 | %tmp2 = insertelement <2 x i64> zeroinitializer, i64 %0, i32 0 ; <<2 x i64>> [#uses=1] |
| 27 | %1 = bitcast <2 x i64> %tmp2 to <8 x i16> ; <<8 x i16>> [#uses=1] |
| 28 | %2 = tail call <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16> %1) nounwind readnone ; <<4 x i32>> [#uses=1] |
| 29 | %3 = bitcast <4 x i32> %2 to <2 x i64> ; <<2 x i64>> [#uses=1] |
| 30 | ret <2 x i64> %3 |
| 31 | } |
| 32 | |
| 33 | declare <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16>) nounwind readnone |
| 34 | |
| 35 | |
| 36 | @gv = external global i16 ; <i16*> [#uses=1] |
| 37 | |
| 38 | define <2 x i64> @t3() nounwind { |
| 39 | entry: |
| 40 | %0 = load i16* @gv, align 2 ; <i16> [#uses=1] |
| 41 | %1 = insertelement <8 x i16> undef, i16 %0, i32 0 ; <<8 x i16>> [#uses=1] |
| 42 | %2 = bitcast <8 x i16> %1 to <16 x i8> ; <<16 x i8>> [#uses=1] |
| 43 | %3 = tail call <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8> %2) nounwind readnone ; <<2 x i64>> [#uses=1] |
| 44 | ret <2 x i64> %3 |
| 45 | } |
| 46 | |
| 47 | declare <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8>) nounwind readnone |