llvm.org GIT mirror llvm / feb1bb8
ARM: switch armv7em triple to hard-float defaults and libcalls. We were emitting incorrect calls to libm functions that LLVM had decided it knew about because the default is soft-float. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337385 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 2 years ago
3 changed file(s) with 38 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
6565 return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
6666 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
6767 TargetTriple.getEnvironment() == Triple::EABIHF ||
68 TargetTriple.getSubArch() == Triple::ARMSubArch_v7em ||
6869 TargetTriple.isOSWindows() ||
6970 TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16;
7071 }
1919 ; CHECK-M3: bl ___adddf3
2020
2121 ; CHECK-M4-LABEL: double_op:
22 ; CHECK-M4: {{(blx|b.w)}} ___adddf3
22 ; CHECK-M4: {{(bl|blx|b.w)}} ___adddf3
2323 }
0 ; RUN: llc -mtriple=thumbv7em-none-macho %s -o - -mcpu=cortex-m4 | FileCheck --check-prefix=CHECK-HARD %s
1 ; RUN: llc -mtriple=thumbv7m-none-macho %s -o - -mcpu=cortex-m4 | FileCheck --check-prefix=CHECK-SOFT %s
2
3 define float @test_default_cc(float %a, float %b) {
4 ; CHECK-HARD-LABEL: test_default_cc:
5 ; CHECK-HARD-NOT: vmov
6 ; CHECK-HARD: vadd.f32 s0, s0, s1
7 ; CHECK-HARD-NOT: vmov
8
9 ; CHECK-SOFT-LABEL: test_default_cc:
10 ; CHECK-SOFT-DAG: vmov [[A:s[0-9]+]], r0
11 ; CHECK-SOFT-DAG: vmov [[B:s[0-9]+]], r1
12 ; CHECK-SOFT: vadd.f32 [[RES:s[0-9]+]], [[A]], [[B]]
13 ; CEHCK-SOFT: vmov r0, [[RES]]
14
15 %res = fadd float %a, %b
16 ret float %res
17 }
18
19
20 define arm_aapcs_vfpcc float @test_libcall(float %in) {
21 ; CHECK-HARD-LABEL: test_libcall:
22 ; CHECK-HARD-NOT: vmov
23 ; CHECK-HARD: b.w _sinf
24
25 ; CHECK-SOFT-LABEL: test_libcall:
26 ; CHECK-SOFT: vmov r0, s0
27 ; CHECK-SOFT: bl _sinf
28 ; CHECK-SOFT: vmov s0, r0
29
30 %res = call float @llvm.sin.f32(float %in)
31 ret float %res
32 }
33
34
35 declare float @llvm.sin.f32(float)