1; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=penryn | FileCheck %s 2 3define <4 x float> @test(float %a) { 4; CHECK-LABEL: test: 5; CHECK: insertps $29, {{.*}}, %xmm0 6; CHECK-NEXT: retl 7 8entry: 9 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 1 10 %tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 2 11 %tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 3 12 ret <4 x float> %tmp6 13} 14 15define <2 x i64> @test2(i32 %a) { 16; CHECK-LABEL: test2: 17; CHECK: movd {{.*}}, %xmm0 18; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,0,1] 19; CHECK-NEXT: retl 20 21entry: 22 %tmp7 = insertelement <4 x i32> zeroinitializer, i32 %a, i32 2 23 %tmp9 = insertelement <4 x i32> %tmp7, i32 0, i32 3 24 %tmp10 = bitcast <4 x i32> %tmp9 to <2 x i64> 25 ret <2 x i64> %tmp10 26} 27 28define <4 x float> @test3(<4 x float> %A) { 29; CHECK-LABEL: test3: 30; CHECK: insertps {{.*#+}} xmm0 = zero,xmm0[0],zero,zero 31; CHECK-NEXT: retl 32 33 %tmp0 = extractelement <4 x float> %A, i32 0 34 %tmp1 = insertelement <4 x float> <float 0.000000e+00, float undef, float undef, float undef >, float %tmp0, i32 1 35 %tmp2 = insertelement <4 x float> %tmp1, float 0.000000e+00, i32 2 36 ret <4 x float> %tmp2 37} 38