blob: 2aef4fd64105631e727a79c259b7bbb51f0b1317 [file] [log] [blame]
Wesley Pecka70f28c2010-02-23 19:15:24 +00001; Ensure that floating point operations are lowered to function calls when the
2; FPU is not available in the hardware and that function calls are not used
3; when the FPU is available in the hardware.
4;
5; RUN: llc < %s -march=mblaze | FileCheck -check-prefix=FUN %s
6; RUN: llc < %s -march=mblaze -mattr=+fpu | FileCheck -check-prefix=FPU %s
7
8define float @test_add(float %a, float %b) {
9 ; FUN: test_add:
10 ; FPU: test_add:
11
12 %tmp.1 = fadd float %a, %b
Wesley Pecka70f28c2010-02-23 19:15:24 +000013 ; FUN: brlid
14 ; FPU-NOT: brlid
Wesley Pecka70f28c2010-02-23 19:15:24 +000015
16 ret float %tmp.1
17 ; FUN: rtsd
18 ; FPU: rtsd
Wesley Peck4e9141f2010-10-21 03:57:26 +000019 ; FUN-NOT: fadd
20 ; FPU-NEXT: fadd
Wesley Pecka70f28c2010-02-23 19:15:24 +000021}
22
23define float @test_sub(float %a, float %b) {
24 ; FUN: test_sub:
25 ; FPU: test_sub:
26
27 %tmp.1 = fsub float %a, %b
Wesley Pecka70f28c2010-02-23 19:15:24 +000028 ; FUN: brlid
29 ; FPU-NOT: brlid
Wesley Pecka70f28c2010-02-23 19:15:24 +000030
31 ret float %tmp.1
32 ; FUN: rtsd
33 ; FPU: rtsd
Wesley Peck4e9141f2010-10-21 03:57:26 +000034 ; FUN-NOT: frsub
35 ; FPU-NEXT: frsub
Wesley Pecka70f28c2010-02-23 19:15:24 +000036}
37
38define float @test_mul(float %a, float %b) {
39 ; FUN: test_mul:
40 ; FPU: test_mul:
41
42 %tmp.1 = fmul float %a, %b
Wesley Pecka70f28c2010-02-23 19:15:24 +000043 ; FUN: brlid
44 ; FPU-NOT: brlid
Wesley Pecka70f28c2010-02-23 19:15:24 +000045
46 ret float %tmp.1
47 ; FUN: rtsd
48 ; FPU: rtsd
Wesley Peck4e9141f2010-10-21 03:57:26 +000049 ; FUN-NOT: fmul
50 ; FPU-NEXT: fmul
Wesley Pecka70f28c2010-02-23 19:15:24 +000051}
52
53define float @test_div(float %a, float %b) {
54 ; FUN: test_div:
55 ; FPU: test_div:
56
57 %tmp.1 = fdiv float %a, %b
Wesley Pecka70f28c2010-02-23 19:15:24 +000058 ; FUN: brlid
59 ; FPU-NOT: brlid
Wesley Pecka70f28c2010-02-23 19:15:24 +000060
61 ret float %tmp.1
62 ; FUN: rtsd
63 ; FPU: rtsd
Wesley Peck4e9141f2010-10-21 03:57:26 +000064 ; FUN-NOT: fdiv
65 ; FPU-NEXT: fdiv
Wesley Pecka70f28c2010-02-23 19:15:24 +000066}