blob: 83f4d831241dc71510fe4b70172d63ed710f7fe8 [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 Peck60e71272010-10-21 03:34:22 +000013 ; FUN-NOT: fadd
Wesley Pecka70f28c2010-02-23 19:15:24 +000014 ; FUN: brlid
15 ; FPU-NOT: brlid
Wesley Peck60e71272010-10-21 03:34:22 +000016 ; FPU: fadd
Wesley Pecka70f28c2010-02-23 19:15:24 +000017
18 ret float %tmp.1
19 ; FUN: rtsd
20 ; FPU: rtsd
21}
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 Peck60e71272010-10-21 03:34:22 +000028 ; FUN-NOT: frsub
Wesley Pecka70f28c2010-02-23 19:15:24 +000029 ; FUN: brlid
30 ; FPU-NOT: brlid
Wesley Peck60e71272010-10-21 03:34:22 +000031 ; FPU: frsub
Wesley Pecka70f28c2010-02-23 19:15:24 +000032
33 ret float %tmp.1
34 ; FUN: rtsd
35 ; FPU: rtsd
36}
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 Peck60e71272010-10-21 03:34:22 +000043 ; FUN-NOT: fmul
Wesley Pecka70f28c2010-02-23 19:15:24 +000044 ; FUN: brlid
45 ; FPU-NOT: brlid
Wesley Peck60e71272010-10-21 03:34:22 +000046 ; FPU: fmul
Wesley Pecka70f28c2010-02-23 19:15:24 +000047
48 ret float %tmp.1
49 ; FUN: rtsd
50 ; FPU: rtsd
51}
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 Peck60e71272010-10-21 03:34:22 +000058 ; FUN-NOT: fdiv
Wesley Pecka70f28c2010-02-23 19:15:24 +000059 ; FUN: brlid
60 ; FPU-NOT: brlid
Wesley Peck60e71272010-10-21 03:34:22 +000061 ; FPU: fdiv
Wesley Pecka70f28c2010-02-23 19:15:24 +000062
63 ret float %tmp.1
64 ; FUN: rtsd
65 ; FPU: rtsd
Wesley Pecka70f28c2010-02-23 19:15:24 +000066}