File: macho-embedded-float.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
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)