summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2017-12-30 11:20:56 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2017-12-30 11:20:56 +0000
commitfa0f793c8daaf4173afcff568bee45191bbf27a0 (patch)
tree3f7a8bfb9be3adb4e7984b3ac752e23ccfd16a91
parentc15a438a219967135d334a0bee12115d5c5b17b3 (diff)
downloadbcm5719-llvm-fa0f793c8daaf4173afcff568bee45191bbf27a0.tar.gz
bcm5719-llvm-fa0f793c8daaf4173afcff568bee45191bbf27a0.zip
[X86][SSE] Add test for (v2f32 uitofp(build_vector(i32, i32))) (PR35732)
To compare against (v2f32 build_vector(f32 uitofp(i32), f32 uitofp(i32))) llvm-svn: 321583
-rw-r--r--llvm/test/CodeGen/X86/cvtv2f32.ll37
1 files changed, 34 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/X86/cvtv2f32.ll b/llvm/test/CodeGen/X86/cvtv2f32.ll
index 556c858759f..afb9aa9411e 100644
--- a/llvm/test/CodeGen/X86/cvtv2f32.ll
+++ b/llvm/test/CodeGen/X86/cvtv2f32.ll
@@ -5,8 +5,8 @@
; uitofp <2 x i32> codegen from buildvector or legalization is different but gives the same results
; across the full 0 - 0xFFFFFFFF u32 range.
-define <2 x float> @uitofp_2i32_buildvector(i32 %x, i32 %y, <2 x float> %v) {
-; X32-LABEL: uitofp_2i32_buildvector:
+define <2 x float> @uitofp_2i32_cvt_buildvector(i32 %x, i32 %y, <2 x float> %v) {
+; X32-LABEL: uitofp_2i32_cvt_buildvector:
; X32: # %bb.0:
; X32-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
; X32-NEXT: movdqa {{.*#+}} xmm2 = [1258291200,1258291200,1258291200,1258291200]
@@ -18,7 +18,7 @@ define <2 x float> @uitofp_2i32_buildvector(i32 %x, i32 %y, <2 x float> %v) {
; X32-NEXT: mulps %xmm1, %xmm0
; X32-NEXT: retl
;
-; X64-LABEL: uitofp_2i32_buildvector:
+; X64-LABEL: uitofp_2i32_cvt_buildvector:
; X64: # %bb.0:
; X64-NEXT: movd %edi, %xmm1
; X64-NEXT: pinsrd $1, %esi, %xmm1
@@ -38,6 +38,37 @@ define <2 x float> @uitofp_2i32_buildvector(i32 %x, i32 %y, <2 x float> %v) {
ret <2 x float> %t5
}
+define <2 x float> @uitofp_2i32_buildvector_cvt(i32 %x, i32 %y, <2 x float> %v) {
+; X32-LABEL: uitofp_2i32_buildvector_cvt:
+; X32: # %bb.0:
+; X32-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
+; X32-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
+; X32-NEXT: unpcklpd {{.*#+}} xmm2 = xmm2[0],xmm1[0]
+; X32-NEXT: movapd {{.*#+}} xmm1 = [4.503600e+15,4.503600e+15]
+; X32-NEXT: orpd %xmm1, %xmm2
+; X32-NEXT: subpd %xmm1, %xmm2
+; X32-NEXT: cvtpd2ps %xmm2, %xmm1
+; X32-NEXT: mulps %xmm1, %xmm0
+; X32-NEXT: retl
+;
+; X64-LABEL: uitofp_2i32_buildvector_cvt:
+; X64: # %bb.0:
+; X64-NEXT: movd %esi, %xmm1
+; X64-NEXT: movd %edi, %xmm2
+; X64-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm1[0]
+; X64-NEXT: movdqa {{.*#+}} xmm1 = [4.503600e+15,4.503600e+15]
+; X64-NEXT: por %xmm1, %xmm2
+; X64-NEXT: subpd %xmm1, %xmm2
+; X64-NEXT: cvtpd2ps %xmm2, %xmm1
+; X64-NEXT: mulps %xmm1, %xmm0
+; X64-NEXT: retq
+ %t1 = insertelement <2 x i32> undef, i32 %x, i32 0
+ %t2 = insertelement <2 x i32> %t1, i32 %y, i32 1
+ %t3 = uitofp <2 x i32> %t2 to <2 x float>
+ %t4 = fmul <2 x float> %v, %t3
+ ret <2 x float> %t4
+}
+
define <2 x float> @uitofp_2i32_legalized(<2 x i32> %in, <2 x float> %v) {
; X32-LABEL: uitofp_2i32_legalized:
; X32: # %bb.0:
OpenPOWER on IntegriCloud