Bruno Cardoso Lopes | ef8d699 | 2011-08-11 21:50:44 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s |
Bruno Cardoso Lopes | 50b37c7 | 2011-08-15 21:45:54 +0000 | [diff] [blame] | 2 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck -check-prefix=CHECK-SSE %s |
Bruno Cardoso Lopes | ef8d699 | 2011-08-11 21:50:44 +0000 | [diff] [blame] | 3 | |
| 4 | ; CHECK-NOT: vunpck |
| 5 | ; CHECK: vinsertf128 $1 |
| 6 | define <8 x float> @A(<8 x float> %a) nounwind uwtable readnone ssp { |
| 7 | entry: |
| 8 | %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> <i32 8, i32 8, i32 8, i32 8, i32 0, i32 1, i32 2, i32 3> |
| 9 | ret <8 x float> %shuffle |
| 10 | } |
| 11 | |
| 12 | ; CHECK-NOT: vunpck |
| 13 | ; CHECK: vinsertf128 $1 |
| 14 | define <4 x double> @B(<4 x double> %a) nounwind uwtable readnone ssp { |
| 15 | entry: |
| 16 | %shuffle = shufflevector <4 x double> %a, <4 x double> undef, <4 x i32> <i32 4, i32 4, i32 0, i32 1> |
| 17 | ret <4 x double> %shuffle |
| 18 | } |
| 19 | |
Bruno Cardoso Lopes | 50b37c7 | 2011-08-15 21:45:54 +0000 | [diff] [blame] | 20 | declare <2 x double> @llvm.x86.sse2.min.pd(<2 x double>, <2 x double>) nounwind readnone |
| 21 | |
| 22 | declare <2 x double> @llvm.x86.sse2.min.sd(<2 x double>, <2 x double>) nounwind readnone |
| 23 | |
| 24 | ; Just check that no crash happens |
| 25 | ; CHECK-SSE: _insert_crash |
| 26 | define void @insert_crash() nounwind { |
| 27 | allocas: |
| 28 | %v1.i.i451 = shufflevector <4 x double> zeroinitializer, <4 x double> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef> |
| 29 | %ret_0a.i.i.i452 = shufflevector <4 x double> %v1.i.i451, <4 x double> undef, <2 x i32> <i32 0, i32 1> |
| 30 | %vret_0.i.i.i454 = tail call <2 x double> @llvm.x86.sse2.min.pd(<2 x double> %ret_0a.i.i.i452, <2 x double> undef) nounwind |
| 31 | %ret_val.i.i.i463 = tail call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %vret_0.i.i.i454, <2 x double> undef) nounwind |
| 32 | %ret.i1.i.i464 = extractelement <2 x double> %ret_val.i.i.i463, i32 0 |
| 33 | %double2float = fptrunc double %ret.i1.i.i464 to float |
| 34 | %smearinsert50 = insertelement <4 x float> undef, float %double2float, i32 3 |
| 35 | %blendAsInt.i503 = bitcast <4 x float> %smearinsert50 to <4 x i32> |
| 36 | store <4 x i32> %blendAsInt.i503, <4 x i32>* undef, align 4 |
| 37 | ret void |
| 38 | } |
Bruno Cardoso Lopes | 97136c9 | 2011-09-19 23:36:50 +0000 | [diff] [blame^] | 39 | |
| 40 | ; CHECK: _C |
| 41 | ; CHECK-NOT: vinsertf128 $1 |
| 42 | define <4 x i32> @C(<4 x i32> %v1) nounwind readonly { |
| 43 | %1 = shufflevector <4 x i32> %v1, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
| 44 | %2 = shufflevector <8 x i32> %1, <8 x i32> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
| 45 | ret <4 x i32> %2 |
| 46 | } |