blob: 251d22a85e90e7472ac39d9dcfc9cd919ba9b9f1 [file] [log] [blame]
David Goodwin831b5002009-08-04 18:11:59 +00001; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | grep -E {fnmscs\\W*s\[0-9\]+,\\W*s\[0-9\]+,\\W*s\[0-9\]+} | count 2
2; RUN: llvm-as < %s | llc -march=arm -mattr=+neon,+neonfp | grep -E {fnmscs\\W*s\[0-9\]+,\\W*s\[0-9\]+,\\W*s\[0-9\]+} | count 2
3; RUN: llvm-as < %s | llc -march=arm -mattr=+neon,-neonfp | grep -E {fnmscs\\W*s\[0-9\]+,\\W*s\[0-9\]+,\\W*s\[0-9\]+} | count 2
David Goodwin767a9522009-08-07 23:32:33 +00004; RUN: llvm-as < %s | llc -march=arm -mcpu=cortex-a8 | grep -E {fnmscs\\W*s\[0-9\]+,\\W*s\[0-9\]+,\\W*s\[0-9\]+} | count 2
5; RUN: llvm-as < %s | llc -march=arm -mcpu=cortex-a9 | grep -E {fnmscs\\W*s\[0-9\]+,\\W*s\[0-9\]+,\\W*s\[0-9\]+} | count 2
David Goodwin42a83f22009-08-04 17:53:06 +00006
Dan Gohman5743a3f2009-08-10 16:48:40 +00007define float @test1(float %acc, float %a, float %b) nounwind {
David Goodwin42a83f22009-08-04 17:53:06 +00008entry:
9 %0 = fmul float %a, %b
David Goodwinaeb66fe2009-08-10 22:31:04 +000010 %1 = fsub float -0.0, %0
David Goodwin42a83f22009-08-04 17:53:06 +000011 %2 = fsub float %1, %acc
12 ret float %2
13}
14
Dan Gohman5743a3f2009-08-10 16:48:40 +000015define float @test2(float %acc, float %a, float %b) nounwind {
David Goodwin831b5002009-08-04 18:11:59 +000016entry:
17 %0 = fmul float %a, %b
18 %1 = fmul float -1.0, %0
19 %2 = fsub float %1, %acc
20 ret float %2
21}
22