xref: /llvm-project/llvm/test/CodeGen/SystemZ/zos-intrinsics.ll (revision 42de2b7e9911a1cafa818d5c5ec1124e6aec79a4)
1; RUN: llc -mtriple s390x-zos < %s | FileCheck %s
2
3define float @sqrt_ieee(float %x) {
4entry:
5  %res = call float @llvm.sqrt.f32(float %x)
6  ret float %res
7}
8
9define float @cos_ieee(float %x) {
10entry:
11  %res = call float @llvm.cos.f32(float %x)
12  ret float %res
13}
14
15define double @sin_ieee(double %x) {
16entry:
17  %res = call double @llvm.sin.f64(double %x)
18  ret double %res
19}
20
21define fp128 @exp2_ieee(fp128 %x) {
22entry:
23  %res = call fp128 @llvm.exp2.f128(fp128 %x)
24  ret fp128 %res
25}
26
27declare float @llvm.sqrt.f32(float)
28declare float @llvm.cos.f32(float)
29declare double @llvm.sin.f64(double)
30declare fp128 @llvm.exp2.f128(fp128)
31
32; Check the calls in the ADA.
33; CHECK: .section ".ada"
34
35; Check that there is no call to sqrt.
36; CHECK-NOT:  .quad   R(@@WSQT@B)
37; CHECK-NOT:  .quad   V(@@WSQT@B)
38
39; Check that there is the correct library call.
40; CHECK:      .quad   R(@@FCOS@B)
41; CHECK-NEXT: .quad   V(@@FCOS@B)
42; CHECK:      .quad   R(@@SSIN@B)
43; CHECK-NEXT: .quad   V(@@SSIN@B)
44; CHECK:      .quad   R(@@LXP2@B)
45; CHECK-NEXT: .quad   V(@@LXP2@B)
46