1 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
2 ; RUN: llc < %s -O3 -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
4 define <2 x float> @fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
6 ; CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
7 %tmp1 = fmul contract <2 x float> %A, %B;
8 %tmp2 = fadd contract <2 x float> %C, %tmp1;
12 ; This case will fold as it was only available through unsafe before, now available from
13 ; the contract on the fadd
14 define <2 x float> @fma_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
16 ; CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
17 %tmp1 = fmul <2 x float> %A, %B;
18 %tmp2 = fadd contract <2 x float> %C, %tmp1;
22 define <2 x float> @no_fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
23 ; CHECK-LABEL: no_fma_1:
26 %tmp1 = fmul contract <2 x float> %A, %B;
27 %tmp2 = fadd <2 x float> %C, %tmp1;
31 define <2 x float> @fma_sub_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
32 ; CHECK-LABEL: fma_sub_1:
33 ; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
34 %tmp1 = fmul contract <2 x float> %A, %B;
35 %tmp2 = fsub contract <2 x float> %C, %tmp1;
39 ; This case will fold as it was only available through unsafe before, now available from
40 ; the contract on the fsub
41 define <2 x float> @fma_sub_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
42 ; CHECK-LABEL: fma_sub_2:
43 ; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
44 %tmp1 = fmul <2 x float> %A, %B;
45 %tmp2 = fsub contract <2 x float> %C, %tmp1;
49 define <2 x float> @no_fma_sub_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
50 ; CHECK-LABEL: no_fma_sub_1:
53 %tmp1 = fmul contract <2 x float> %A, %B;
54 %tmp2 = fsub <2 x float> %C, %tmp1;