1 ; Test the Test Data Class instruction, as used by fpclassify.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
6 declare float @llvm.fabs.f32(float)
7 declare double @llvm.fabs.f64(double)
8 declare fp128 @llvm.fabs.f128(fp128)
10 define i32 @fpc(double %x) {
13 ; CHECK-DAG: lhi %r2, 5
14 ; CHECK-DAG: ltdbr %f1, %f0
15 ; CHECK: je [[RET:.L.*]]
16 %testeq = fcmp oeq double %x, 0.000000e+00
17 br i1 %testeq, label %ret, label %nonzero, !prof !1
20 ; CHECK-DAG: lhi %r2, 1
21 ; CHECK-DAG: cdbr %f0, %f0
23 %testnan = fcmp uno double %x, 0.000000e+00
24 br i1 %testnan, label %ret, label %nonzeroord, !prof !1
27 ; CHECK-DAG: lhi %r2, 2
28 ; CHECK-DAG: tcdb %f0, 48
30 %abs = tail call double @llvm.fabs.f64(double %x)
31 %testinf = fcmp oeq double %abs, 0x7FF0000000000000
32 br i1 %testinf, label %ret, label %finite, !prof !1
35 ; CHECK-DAG: lhi %r2, 3
36 ; CHECK-DAG: tcdb %f0, 831
39 %testnormal = fcmp uge double %abs, 0x10000000000000
40 %finres = select i1 %testnormal, i32 3, i32 4
46 %res = phi i32 [ 5, %entry ], [ 1, %nonzero ], [ 2, %nonzeroord ], [ %finres, %finite ]
50 !1 = !{!"branch_weights", i32 1, i32 1}