[llvm] r276571 - [X86][SSE] Added PR27854 tests
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 24 09:39:51 PDT 2016
Author: rksimon
Date: Sun Jul 24 11:39:50 2016
New Revision: 276571
URL: http://llvm.org/viewvc/llvm-project?rev=276571&view=rev
Log:
[X86][SSE] Added PR27854 tests
Modified:
llvm/trunk/test/CodeGen/X86/buildvec-insertvec.ll
Modified: llvm/trunk/test/CodeGen/X86/buildvec-insertvec.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/buildvec-insertvec.ll?rev=276571&r1=276570&r2=276571&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/buildvec-insertvec.ll (original)
+++ llvm/trunk/test/CodeGen/X86/buildvec-insertvec.ll Sun Jul 24 11:39:50 2016
@@ -55,3 +55,51 @@ entry:
%2 = insertelement <2 x double> %1, double -0.0, i32 1
ret <2 x double> %2
}
+
+define <4 x float> @test_buildvector_v4f32_register(float %f0, float %f1, float %f2, float %f3) {
+; CHECK-LABEL: test_buildvector_v4f32_register:
+; CHECK: # BB#0:
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1],xmm2[0],xmm0[3]
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm3[0]
+; CHECK-NEXT: retq
+ %ins0 = insertelement <4 x float> undef, float %f0, i32 0
+ %ins1 = insertelement <4 x float> %ins0, float %f1, i32 1
+ %ins2 = insertelement <4 x float> %ins1, float %f2, i32 2
+ %ins3 = insertelement <4 x float> %ins2, float %f3, i32 3
+ ret <4 x float> %ins3
+}
+
+define <4 x float> @test_buildvector_v4f32_load(float* %p0, float* %p1, float* %p2, float* %p3) {
+; CHECK-LABEL: test_buildvector_v4f32_load:
+; CHECK: # BB#0:
+; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0],mem[0],xmm0[2,3]
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1,2],mem[0]
+; CHECK-NEXT: retq
+ %f0 = load float, float* %p0, align 4
+ %f1 = load float, float* %p1, align 4
+ %f2 = load float, float* %p2, align 4
+ %f3 = load float, float* %p3, align 4
+ %ins0 = insertelement <4 x float> undef, float %f0, i32 0
+ %ins1 = insertelement <4 x float> %ins0, float %f1, i32 1
+ %ins2 = insertelement <4 x float> %ins1, float %f2, i32 2
+ %ins3 = insertelement <4 x float> %ins2, float %f3, i32 3
+ ret <4 x float> %ins3
+}
+
+define <4 x float> @test_buildvector_v4f32_partial_load(float %f0, float %f1, float %f2, float* %p3) {
+; CHECK-LABEL: test_buildvector_v4f32_partial_load:
+; CHECK: # BB#0:
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1],xmm2[0],xmm0[3]
+; CHECK-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1,2],mem[0]
+; CHECK-NEXT: retq
+ %f3 = load float, float* %p3, align 4
+ %ins0 = insertelement <4 x float> undef, float %f0, i32 0
+ %ins1 = insertelement <4 x float> %ins0, float %f1, i32 1
+ %ins2 = insertelement <4 x float> %ins1, float %f2, i32 2
+ %ins3 = insertelement <4 x float> %ins2, float %f3, i32 3
+ ret <4 x float> %ins3
+}
More information about the llvm-commits
mailing list