File: tdc-06.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 (50 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download | duplicates (19)
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
; Test the Test Data Class instruction, as used by fpclassify.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
;

declare float @llvm.fabs.f32(float)
declare double @llvm.fabs.f64(double)
declare fp128 @llvm.fabs.f128(fp128)

define i32 @fpc(double %x) {
entry:
; CHECK-LABEL: fpc
; CHECK-DAG: lhi %r2, 5
; CHECK-DAG: ltdbr %f0, %f0
; CHECK: je [[RET:.L.*]]
  %testeq = fcmp oeq double %x, 0.000000e+00
  br i1 %testeq, label %ret, label %nonzero, !prof !1

nonzero:
; CHECK-DAG: lhi %r2, 1
; CHECK-DAG: cdbr %f0, %f0
; CHECK: jo [[RET]]
  %testnan = fcmp uno double %x, 0.000000e+00
  br i1 %testnan, label %ret, label %nonzeroord, !prof !1

nonzeroord:
; CHECK-DAG: lhi %r2, 2
; CHECK-DAG: tcdb %f0, 48
; CHECK: jl [[RET]]
  %abs = tail call double @llvm.fabs.f64(double %x)
  %testinf = fcmp oeq double %abs, 0x7FF0000000000000
  br i1 %testinf, label %ret, label %finite, !prof !1

finite:
; CHECK-DAG: lhi %r2, 3
; CHECK-DAG: tcdb %f0, 831
; CHECK: blr %r14
; CHECK: lhi %r2, 4
  %testnormal = fcmp uge double %abs, 0x10000000000000
  %finres = select i1 %testnormal, i32 3, i32 4
  br label %ret

ret:
; CHECK: [[RET]]:
; CHECK: br %r14
  %res = phi i32 [ 5, %entry ], [ 1, %nonzero ], [ 2, %nonzeroord ], [ %finres, %finite ]
  ret i32 %res
}

!1 = !{!"branch_weights", i32 1, i32 1}