From 37ed9c199ca639565f6ce88105f9e39e898d82d0 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 1 Dec 2014 14:51:49 -0800 Subject: Update aosp/master LLVM for rebase to r222494. Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d --- test/CodeGen/PowerPC/fma.ll | 59 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 4 deletions(-) (limited to 'test/CodeGen/PowerPC/fma.ll') diff --git a/test/CodeGen/PowerPC/fma.ll b/test/CodeGen/PowerPC/fma.ll index db19761..ab5251b 100644 --- a/test/CodeGen/PowerPC/fma.ll +++ b/test/CodeGen/PowerPC/fma.ll @@ -1,12 +1,21 @@ -; RUN: llc < %s -march=ppc32 -fp-contract=fast | FileCheck %s +; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx | FileCheck %s +; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 | FileCheck -check-prefix=CHECK-VSX %s + +declare double @dummy1(double) #0 +declare double @dummy2(double, double) #0 +declare double @dummy3(double, double, double) #0 define double @test_FMADD1(double %A, double %B, double %C) { %D = fmul double %A, %B ; [#uses=1] - %E = fadd double %D, %C ; [#uses=1] + %E = fadd double %C, %D ; [#uses=1] ret double %E ; CHECK-LABEL: test_FMADD1: ; CHECK: fmadd ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FMADD1: +; CHECK-VSX: xsmaddmdp +; CHECK-VSX-NEXT: blr } define double @test_FMADD2(double %A, double %B, double %C) { @@ -16,15 +25,38 @@ define double @test_FMADD2(double %A, double %B, double %C) { ; CHECK-LABEL: test_FMADD2: ; CHECK: fmadd ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FMADD2: +; CHECK-VSX: xsmaddmdp +; CHECK-VSX-NEXT: blr } -define double @test_FMSUB(double %A, double %B, double %C) { +define double @test_FMSUB1(double %A, double %B, double %C) { %D = fmul double %A, %B ; [#uses=1] %E = fsub double %D, %C ; [#uses=1] ret double %E -; CHECK-LABEL: test_FMSUB: +; CHECK-LABEL: test_FMSUB1: ; CHECK: fmsub ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FMSUB1: +; CHECK-VSX: xsmsubmdp +; CHECK-VSX-NEXT: blr +} + +define double @test_FMSUB2(double %A, double %B, double %C, double %D) { + %E = fmul double %A, %B ; [#uses=2] + %F = fadd double %E, %C ; [#uses=1] + %G = fsub double %E, %D ; [#uses=1] + %H = call double @dummy2(double %F, double %G) ; [#uses=1] + ret double %H +; CHECK-LABEL: test_FMSUB2: +; CHECK: fmadd +; CHECK-NEXT: fmsub + +; CHECK-VSX-LABEL: test_FMSUB2: +; CHECK-VSX: xsmaddadp +; CHECK-VSX-NEXT: xsmsubmdp } define double @test_FNMADD1(double %A, double %B, double %C) { @@ -35,6 +67,10 @@ define double @test_FNMADD1(double %A, double %B, double %C) { ; CHECK-LABEL: test_FNMADD1: ; CHECK: fnmadd ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FNMADD1: +; CHECK-VSX: xsnmaddmdp +; CHECK-VSX-NEXT: blr } define double @test_FNMADD2(double %A, double %B, double %C) { @@ -45,6 +81,10 @@ define double @test_FNMADD2(double %A, double %B, double %C) { ; CHECK-LABEL: test_FNMADD2: ; CHECK: fnmadd ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FNMADD2: +; CHECK-VSX: xsnmaddmdp +; CHECK-VSX-NEXT: blr } define double @test_FNMSUB1(double %A, double %B, double %C) { @@ -54,6 +94,9 @@ define double @test_FNMSUB1(double %A, double %B, double %C) { ; CHECK-LABEL: test_FNMSUB1: ; CHECK: fnmsub ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FNMSUB1: +; CHECK-VSX: xsnmsubmdp } define double @test_FNMSUB2(double %A, double %B, double %C) { @@ -64,6 +107,10 @@ define double @test_FNMSUB2(double %A, double %B, double %C) { ; CHECK-LABEL: test_FNMSUB2: ; CHECK: fnmsub ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FNMSUB2: +; CHECK-VSX: xsnmsubmdp +; CHECK-VSX-NEXT: blr } define float @test_FNMSUBS(float %A, float %B, float %C) { @@ -74,4 +121,8 @@ define float @test_FNMSUBS(float %A, float %B, float %C) { ; CHECK-LABEL: test_FNMSUBS: ; CHECK: fnmsubs ; CHECK-NEXT: blr + +; CHECK-VSX-LABEL: test_FNMSUBS: +; CHECK-VSX: fnmsubs +; CHECK-VSX-NEXT: blr } -- cgit v1.1