1 ; Test floating-point absolute.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
7 declare float @llvm.fabs.f32(float %f)
8 define float @f1(float %f) {
10 ; CHECK: lpdfr %f0, %f0
12 %res = call float @llvm.fabs.f32(float %f)
17 declare double @llvm.fabs.f64(double %f)
18 define double @f2(double %f) {
20 ; CHECK: lpdfr %f0, %f0
22 %res = call double @llvm.fabs.f64(double %f)
26 ; Test f128. With the loads and stores, a pure absolute would probably
27 ; be better implemented using an NI on the upper byte. Do some extra
28 ; processing so that using FPRs is unequivocally better.
29 declare fp128 @llvm.fabs.f128(fp128 %f)
30 define void @f3(fp128 *%ptr, fp128 *%ptr2) {
35 %orig = load fp128, fp128 *%ptr
36 %abs = call fp128 @llvm.fabs.f128(fp128 %orig)
37 %op2 = load fp128, fp128 *%ptr2
38 %res = fdiv fp128 %abs, %op2
39 store fp128 %res, fp128 *%ptr