File: constrained-fp80-trunc-ext.ll

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (61 lines) | stat: -rw-r--r-- 2,299 bytes parent folder | download | duplicates (2)
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
53
54
55
56
57
58
59
60
61
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -O3 -mtriple=x86_64-gnu-linux < %s | FileCheck %s

define x86_fp80 @constrained_fpext_f32_as_fp80(float %mem) {
; CHECK-LABEL: constrained_fpext_f32_as_fp80:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    movss %xmm0, -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    flds -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    retq
entry:
  %ext = call x86_fp80 @llvm.experimental.constrained.fpext.f80.f32(
            float %mem,
            metadata !"fpexcept.strict")
  ret x86_fp80 %ext
}

define float @constrained_fptrunc_f80_to_f32(x86_fp80 %reg) {
; CHECK-LABEL: constrained_fptrunc_f80_to_f32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    fldt {{[0-9]+}}(%rsp)
; CHECK-NEXT:    fstps -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
; CHECK-NEXT:    retq
  %trunc = call float @llvm.experimental.constrained.fptrunc.f32.f80(
             x86_fp80 %reg,
             metadata !"round.dynamic",
             metadata !"fpexcept.strict")
  ret float %trunc
}

define x86_fp80 @constrained_fpext_f64_to_f80(double %mem) {
; CHECK-LABEL: constrained_fpext_f64_to_f80:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    movsd %xmm0, -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    fldl -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    retq
entry:
  %ext = call x86_fp80 @llvm.experimental.constrained.fpext.f80.f64(
            double %mem,
            metadata !"fpexcept.strict")
  ret x86_fp80 %ext
}

define double @constrained_fptrunc_f80_to_f64(x86_fp80 %reg) {
; CHECK-LABEL: constrained_fptrunc_f80_to_f64:
; CHECK:       # %bb.0:
; CHECK-NEXT:    fldt {{[0-9]+}}(%rsp)
; CHECK-NEXT:    fstpl -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    movsd {{.*#+}} xmm0 = mem[0],zero
; CHECK-NEXT:    retq
  %trunc = call double @llvm.experimental.constrained.fptrunc.f64.f80(
             x86_fp80 %reg,
             metadata !"round.dynamic",
             metadata !"fpexcept.strict")
  ret double %trunc
}

declare x86_fp80 @llvm.experimental.constrained.fpext.f80.f32(float, metadata)
declare x86_fp80 @llvm.experimental.constrained.fpext.f80.f64(double, metadata)
declare float @llvm.experimental.constrained.fptrunc.f32.f80(x86_fp80, metadata, metadata)
declare double @llvm.experimental.constrained.fptrunc.f64.f80(x86_fp80, metadata, metadata)