2017-03-31 02:53:04 +08:00
|
|
|
; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
|
|
|
|
|
2018-06-12 08:52:43 +08:00
|
|
|
define <2 x float> @fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
|
|
|
|
; CHECK-LABEL: fma_1:
|
2017-03-31 02:53:04 +08:00
|
|
|
; CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
|
|
|
|
%tmp1 = fmul contract <2 x float> %A, %B;
|
|
|
|
%tmp2 = fadd contract <2 x float> %C, %tmp1;
|
|
|
|
ret <2 x float> %tmp2
|
|
|
|
}
|
|
|
|
|
2018-06-12 08:52:43 +08:00
|
|
|
; This case will fold as it was only available through unsafe before, now available from
|
|
|
|
; the contract on the fadd
|
|
|
|
define <2 x float> @fma_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
|
|
|
|
; CHECK-LABEL: fma_2:
|
Utilize new SDNode flag functionality to expand current support for fma
Summary: This patch originated from D47388 and is a proper subset of the originating changes, containing only the fmf optimization guard extensions.
Reviewers: spatel, hfinkel, wristow, arsenm, javed.absar, rampitec, nhaehnle, nemanjai
Reviewed By: rampitec, nhaehnle
Subscribers: tpr, nemanjai, wdng
Differential Revision: https://reviews.llvm.org/D47918
llvm-svn: 334876
2018-06-16 08:03:06 +08:00
|
|
|
; CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
|
2018-06-12 08:52:43 +08:00
|
|
|
%tmp1 = fmul <2 x float> %A, %B;
|
|
|
|
%tmp2 = fadd contract <2 x float> %C, %tmp1;
|
|
|
|
ret <2 x float> %tmp2
|
|
|
|
}
|
|
|
|
|
2017-03-31 02:53:04 +08:00
|
|
|
define <2 x float> @no_fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
|
|
|
|
; CHECK-LABEL: no_fma_1:
|
|
|
|
; CHECK: fmul
|
|
|
|
; CHECK: fadd
|
|
|
|
%tmp1 = fmul contract <2 x float> %A, %B;
|
|
|
|
%tmp2 = fadd <2 x float> %C, %tmp1;
|
|
|
|
ret <2 x float> %tmp2
|
|
|
|
}
|
|
|
|
|
2018-06-12 08:52:43 +08:00
|
|
|
define <2 x float> @fma_sub_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
|
|
|
|
; CHECK-LABEL: fma_sub_1:
|
|
|
|
; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
|
|
|
|
%tmp1 = fmul contract <2 x float> %A, %B;
|
|
|
|
%tmp2 = fsub contract <2 x float> %C, %tmp1;
|
2017-03-31 02:53:04 +08:00
|
|
|
ret <2 x float> %tmp2
|
|
|
|
}
|
2017-04-06 01:58:48 +08:00
|
|
|
|
2018-06-12 08:52:43 +08:00
|
|
|
; This case will fold as it was only available through unsafe before, now available from
|
|
|
|
; the contract on the fsub
|
|
|
|
define <2 x float> @fma_sub_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
|
|
|
|
; CHECK-LABEL: fma_sub_2:
|
Utilize new SDNode flag functionality to expand current support for fma
Summary: This patch originated from D47388 and is a proper subset of the originating changes, containing only the fmf optimization guard extensions.
Reviewers: spatel, hfinkel, wristow, arsenm, javed.absar, rampitec, nhaehnle, nemanjai
Reviewed By: rampitec, nhaehnle
Subscribers: tpr, nemanjai, wdng
Differential Revision: https://reviews.llvm.org/D47918
llvm-svn: 334876
2018-06-16 08:03:06 +08:00
|
|
|
; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
|
2018-06-12 08:52:43 +08:00
|
|
|
%tmp1 = fmul <2 x float> %A, %B;
|
2017-04-06 01:58:48 +08:00
|
|
|
%tmp2 = fsub contract <2 x float> %C, %tmp1;
|
|
|
|
ret <2 x float> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x float> @no_fma_sub_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
|
|
|
|
; CHECK-LABEL: no_fma_sub_1:
|
|
|
|
; CHECK: fmul
|
|
|
|
; CHECK: fsub
|
|
|
|
%tmp1 = fmul contract <2 x float> %A, %B;
|
|
|
|
%tmp2 = fsub <2 x float> %C, %tmp1;
|
|
|
|
ret <2 x float> %tmp2
|
|
|
|
}
|