blob: ec57187381776dad58fc52b7dff44bd6b5d1f669 [file] [log] [blame]
Owen Anderson58d57292012-09-01 06:04:27 +00001; RUN: llc -march=arm -mcpu=cortex-a9 -mattr=+vfp4 -enable-unsafe-fp-math < %s | FileCheck %s
2
3; CHECK: test1
4define 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
14define 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
24define 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
33define 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
42define 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
51define 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
60declare float @llvm.fma.f32(float, float, float)