llvm.org GIT mirror llvm / master
ARM: switch armv7em MachO 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. Recommitted without breaking ELF this time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337450 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 59 minutes ago
3 changed file(s) with 40 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.isOSBinFormatMachO() &&
69 TargetTriple.getSubArch() == Triple::ARMSubArch_v7em) ||
6870 TargetTriple.isOSWindows() ||
6971 TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16;
7072 }
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 ; RUN: llc -mtriple=thumbv7em-linux-gnueabi %s -o - -mcpu=cortex-m4 | FileCheck --check-prefix=CHECK-SOFT %s
3
4 define float @test_default_cc(float %a, float %b) {
5 ; CHECK-HARD-LABEL: test_default_cc:
6 ; CHECK-HARD-NOT: vmov
7 ; CHECK-HARD: vadd.f32 s0, s0, s1
8 ; CHECK-HARD-NOT: vmov
9
10 ; CHECK-SOFT-LABEL: test_default_cc:
11 ; CHECK-SOFT-DAG: vmov [[A:s[0-9]+]], r0
12 ; CHECK-SOFT-DAG: vmov [[B:s[0-9]+]], r1
13 ; CHECK-SOFT: vadd.f32 [[RES:s[0-9]+]], [[A]], [[B]]
14 ; CEHCK-SOFT: vmov r0, [[RES]]
15
16 %res = fadd float %a, %b
17 ret float %res
18 }
19
20
21 define arm_aapcs_vfpcc float @test_libcall(float %in) {
22 ; CHECK-HARD-LABEL: test_libcall:
23 ; CHECK-HARD-NOT: vmov
24 ; CHECK-HARD: b.w _sinf
25
26 ; CHECK-SOFT-LABEL: test_libcall:
27 ; CHECK-SOFT: vmov r0, s0
28 ; CHECK-SOFT: bl {{_?}}sinf
29 ; CHECK-SOFT: vmov s0, r0
30
31 %res = call float @llvm.sin.f32(float %in)
32 ret float %res
33 }
34
35
36 declare float @llvm.sin.f32(float)