1 ; Test the Test Data Class instruction, selected manually via the intrinsic.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare i32 @llvm.s390.tdc.f32(float, i64)
6 declare i32 @llvm.s390.tdc.f64(double, i64)
7 declare i32 @llvm.s390.tdc.f128(fp128, i64)
9 ; Check using as i32 - f32
10 define i32 @f1(float %x) {
12 ; CHECK: tceb %f0, 123
15 %res = call i32 @llvm.s390.tdc.f32(float %x, i64 123)
19 ; Check using as i32 - f64
20 define i32 @f2(double %x) {
22 ; CHECK: tcdb %f0, 123
25 %res = call i32 @llvm.s390.tdc.f64(double %x, i64 123)
29 ; Check using as i32 - f128
30 define i32 @f3(fp128 %x) {
32 ; CHECK: ld %f0, 0(%r2)
33 ; CHECK: ld %f2, 8(%r2)
34 ; CHECK: tcxb %f0, 123
37 %res = call i32 @llvm.s390.tdc.f128(fp128 %x, i64 123)
44 define void @f4(float %x) {
46 ; CHECK: tceb %f0, 123
49 %res = call i32 @llvm.s390.tdc.f32(float %x, i64 123)
50 %cond = icmp ne i32 %res, 0
51 br i1 %cond, label %call, label %exit
61 ; Check branch negated
62 define void @f5(float %x) {
64 ; CHECK: tceb %f0, 123
67 %res = call i32 @llvm.s390.tdc.f32(float %x, i64 123)
68 %cond = icmp eq i32 %res, 0
69 br i1 %cond, label %call, label %exit
79 ; Check non-const mask
80 define void @f6(float %x, i64 %y) {
82 ; CHECK: tceb %f0, 0(%r2)
85 %res = call i32 @llvm.s390.tdc.f32(float %x, i64 %y)
86 %cond = icmp eq i32 %res, 0
87 br i1 %cond, label %call, label %exit