File: finite-libcalls.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (52 lines) | stat: -rw-r--r-- 1,685 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-pc-linux-gnu     | FileCheck %s --check-prefix=CHECK --check-prefix=GNU
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc  | FileCheck %s --check-prefix=CHECK --check-prefix=WIN

; PR35672 - https://bugs.llvm.org/show_bug.cgi?id=35672
; FIXME: We would not need the function-level attributes if FMF were propagated to DAG nodes for this case.

define float @exp_f32(float %x) #0 {
; CHECK-LABEL: exp_f32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    jmp expf # TAILCALL
  %exp = tail call nnan ninf float @llvm.exp.f32(float %x)
  ret float %exp
}

define double @exp_f64(double %x) #0 {
; CHECK-LABEL: exp_f64:
; CHECK:       # %bb.0:
; CHECK-NEXT:    jmp exp # TAILCALL
  %exp = tail call nnan ninf double @llvm.exp.f64(double %x)
  ret double %exp
}

define x86_fp80 @exp_f80(x86_fp80 %x) #0 {
; GNU-LABEL: exp_f80:
; GNU:       # %bb.0:
; GNU-NEXT:    subq $24, %rsp
; GNU-NEXT:    fldt {{[0-9]+}}(%rsp)
; GNU-NEXT:    fstpt (%rsp)
; GNU-NEXT:    callq expl
; GNU-NEXT:    addq $24, %rsp
; GNU-NEXT:    retq
;
; WIN-LABEL: exp_f80:
; WIN:       # %bb.0:
; WIN-NEXT:    subq $56, %rsp
; WIN-NEXT:    fldt {{[0-9]+}}(%rsp)
; WIN-NEXT:    fstpt {{[0-9]+}}(%rsp)
; WIN-NEXT:    callq expl
; WIN-NEXT:    addq $56, %rsp
; WIN-NEXT:    retq
  %exp = tail call nnan ninf x86_fp80 @llvm.exp.f80(x86_fp80 %x)
  ret x86_fp80 %exp
}

declare float @llvm.exp.f32(float) #1
declare double @llvm.exp.f64(double) #1
declare x86_fp80 @llvm.exp.f80(x86_fp80) #1

attributes #0 = { nounwind "no-infs-fp-math"="true" "no-nans-fp-math"="true" }
attributes #1 = { nounwind readnone speculatable }