1; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a9 -mattr=+vfp4 -enable-unsafe-fp-math %s -o - \ 2; RUN: | FileCheck %s 3 4; CHECK: test1 5define float @test1(float %x) { 6; CHECK-NOT: vfma 7; CHECK: vmul.f32 8; CHECK-NOT: vfma 9 %t1 = fmul float %x, 3.0 10 %t2 = call float @llvm.fma.f32(float %x, float 2.0, float %t1) 11 ret float %t2 12} 13 14; CHECK: test2 15define float @test2(float %x, float %y) { 16; CHECK-NOT: vmul 17; CHECK: vfma.f32 18; CHECK-NOT: vmul 19 %t1 = fmul float %x, 3.0 20 %t2 = call float @llvm.fma.f32(float %t1, float 2.0, float %y) 21 ret float %t2 22} 23 24; CHECK: test3 25define float @test3(float %x, float %y) { 26; CHECK-NOT: vfma 27; CHECK: vadd.f32 28; CHECK-NOT: vfma 29 %t2 = call float @llvm.fma.f32(float %x, float 1.0, float %y) 30 ret float %t2 31} 32 33; CHECK: test4 34define float @test4(float %x, float %y) { 35; CHECK-NOT: vfma 36; CHECK: vsub.f32 37; CHECK-NOT: vfma 38 %t2 = call float @llvm.fma.f32(float %x, float -1.0, float %y) 39 ret float %t2 40} 41 42; CHECK: test5 43define float @test5(float %x) { 44; CHECK-NOT: vfma 45; CHECK: vmul.f32 46; CHECK-NOT: vfma 47 %t2 = call float @llvm.fma.f32(float %x, float 2.0, float %x) 48 ret float %t2 49} 50 51; CHECK: test6 52define float @test6(float %x) { 53; CHECK-NOT: vfma 54; CHECK: vmul.f32 55; CHECK-NOT: vfma 56 %t1 = fsub float -0.0, %x 57 %t2 = call float @llvm.fma.f32(float %x, float 5.0, float %t1) 58 ret float %t2 59} 60 61declare float @llvm.fma.f32(float, float, float) 62