File: macho-embedded-float.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (37 lines) | stat: -rw-r--r-- 1,097 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
; RUN: llc -mtriple=thumbv7em-none-macho %s -o - -mcpu=cortex-m4 | FileCheck --check-prefix=CHECK-HARD %s
; RUN: llc -mtriple=thumbv7m-none-macho %s -o - -mcpu=cortex-m4 | FileCheck --check-prefix=CHECK-SOFT %s
; RUN: llc -mtriple=thumbv7em-linux-gnueabi %s -o - -mcpu=cortex-m4 | FileCheck --check-prefix=CHECK-SOFT %s

define float @test_default_cc(float %a, float %b) {
; CHECK-HARD-LABEL: test_default_cc:
; CHECK-HARD-NOT: vmov
; CHECK-HARD: vadd.f32 s0, s0, s1
; CHECK-HARD-NOT: vmov

; CHECK-SOFT-LABEL: test_default_cc:
; CHECK-SOFT-DAG: vmov [[A:s[0-9]+]], r0
; CHECK-SOFT-DAG: vmov [[B:s[0-9]+]], r1
; CHECK-SOFT: vadd.f32 [[RES:s[0-9]+]], [[A]], [[B]]
; CHECK-SOFT: vmov r0, [[RES]]

  %res = fadd float %a, %b
  ret float %res
}


define arm_aapcs_vfpcc float @test_libcall(float %in) {
; CHECK-HARD-LABEL: test_libcall:
; CHECK-HARD-NOT: vmov
; CHECK-HARD: b.w _sinf

; CHECK-SOFT-LABEL: test_libcall:
; CHECK-SOFT: vmov r0, s0
; CHECK-SOFT: bl {{_?}}sinf
; CHECK-SOFT: vmov s0, r0

  %res = call float @llvm.sin.f32(float %in)
  ret float %res
}


declare float @llvm.sin.f32(float)