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