From e1f80841ddaa4af431e61446daf70120c8bf87ab Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Sun, 21 Apr 2019 15:01:19 +0000 Subject: [PATCH] [AArch64] add tests with multiple binop+splat vals; NFC See D60890 for context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358853 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/AArch64/mul_by_elt.ll | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/CodeGen/AArch64/mul_by_elt.ll b/test/CodeGen/AArch64/mul_by_elt.ll index bdefca50654..c51ef8c379c 100644 --- a/test/CodeGen/AArch64/mul_by_elt.ll +++ b/test/CodeGen/AArch64/mul_by_elt.ll @@ -102,6 +102,8 @@ define <4 x i32> @splat2_after_mul_constant(<4 x i32> %a) { ret <4 x i32> %splat } +; Different type, lane, and 2 variable operands. + define <8 x i16> @splat1_before_mul(<8 x i16> %a, <8 x i16> %b) { ; CHECK-LABEL: splat1_before_mul: ; CHECK: // %bb.0: @@ -125,3 +127,34 @@ define <8 x i16> @splat1_after_mul(<8 x i16> %a, <8 x i16> %b) { ret <8 x i16> %splat } +; Multiple multiplies. + +define <4 x float> @splat0_before_fmul_fmul_constant(<4 x float> %a) { +; CHECK-LABEL: splat0_before_fmul_fmul_constant: +; CHECK: // %bb.0: +; CHECK-NEXT: fmov v1.4s, #3.00000000 +; CHECK-NEXT: fmul v0.4s, v1.4s, v0.s[0] +; CHECK-NEXT: fmov v1.4s, #6.00000000 +; CHECK-NEXT: fmul v0.4s, v1.4s, v0.s[0] +; CHECK-NEXT: ret + %splat1 = shufflevector <4 x float> %a, <4 x float> undef, <4 x i32> zeroinitializer + %mul1 = fmul <4 x float> %splat1, + %splat2 = shufflevector <4 x float> %mul1, <4 x float> undef, <4 x i32> zeroinitializer + %mul2 = fmul <4 x float> %splat2, + ret <4 x float> %mul2 +} + +define <4 x float> @splat0_after_fmul_fmul_constant(<4 x float> %a) { +; CHECK-LABEL: splat0_after_fmul_fmul_constant: +; CHECK: // %bb.0: +; CHECK-NEXT: fmov v1.4s, #3.00000000 +; CHECK-NEXT: fmul v0.4s, v0.4s, v1.4s +; CHECK-NEXT: fmov v1.4s, #6.00000000 +; CHECK-NEXT: fmul v0.4s, v0.4s, v1.4s +; CHECK-NEXT: dup v0.4s, v0.s[0] +; CHECK-NEXT: ret + %mul1 = fmul <4 x float> %a, + %mul2 = fmul <4 x float> %mul1, + %splat = shufflevector <4 x float> %mul2, <4 x float> undef, <4 x i32> zeroinitializer + ret <4 x float> %splat +} -- 2.40.0