1 ; RUN: llc -mtriple=arm-eabi -mattr=+vfp2 %s -o - | FileCheck %s -check-prefix=VFP2
2 ; RUN: llc -mtriple=arm-eabi -mattr=+neon %s -o - | FileCheck %s -check-prefix=NEON
3 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s -check-prefix=A8
4 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a9 %s -o - | FileCheck %s -check-prefix=A9
5 ; RUN: llc -mtriple=arm-linux-gnueabi -mcpu=cortex-a9 -float-abi=hard %s -o - | FileCheck %s -check-prefix=HARD
6 ; RUN: llc -mtriple=arm-linux-gnueabi -mcpu=cortex-m4 -float-abi=hard %s -o - | FileCheck %s -check-prefix=VMLA
7 ; RUN: llc -mtriple=arm-linux-gnueabi -mcpu=cortex-m33 -float-abi=hard %s -o - | FileCheck %s -check-prefix=VMLA
9 define float @t1(float %acc, float %a, float %b) {
25 %0 = fmul float %a, %b
26 %1 = fadd float %acc, %0
30 define float @vmla_minsize(float %acc, float %a, float %b) #0 {
32 ; VMLA-LABEL: vmla_minsize:
33 ; VMLA: vmla.f32 s0, s1, s2
36 %0 = fmul float %a, %b
37 %1 = fadd float %acc, %0
41 define double @t2(double %acc, double %a, double %b) {
52 %0 = fmul double %a, %b
53 %1 = fadd double %acc, %0
57 define float @t3(float %acc, float %a, float %b) {
68 %0 = fmul float %a, %b
69 %1 = fadd float %0, %acc
73 ; It's possible to make use of fp vmla / vmls on Cortex-A9.
75 define void @t4(float %acc1, float %a, float %b, float %acc2, float %c, float* %P1, float* %P2) {
83 ; Two vmla with now RAW hazard
89 ; HARD: vmla.f32 s0, s1, s2
90 ; HARD: vmla.f32 s3, s1, s4
91 %0 = fmul float %a, %b
92 %1 = fadd float %acc1, %0
93 %2 = fmul float %a, %c
94 %3 = fadd float %acc2, %2
95 store float %1, float* %P1
96 store float %3, float* %P2
100 define float @t5(float %a, float %b, float %c, float %d, float %e) {
114 ; HARD: vmla.f32 s4, s0, s1
115 ; HARD: vmul.f32 s0, s2, s3
116 ; HARD: vadd.f32 s0, s4, s0
117 %0 = fmul float %a, %b
118 %1 = fadd float %e, %0
119 %2 = fmul float %c, %d
120 %3 = fadd float %1, %2
124 attributes #0 = { minsize nounwind optsize }