1 ; Test negated 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: lndfr %f0, %f0
12 %abs = call float @llvm.fabs.f32(float %f)
13 %res = fsub float -0.0, %abs
18 declare double @llvm.fabs.f64(double %f)
19 define double @f2(double %f) {
21 ; CHECK: lndfr %f0, %f0
23 %abs = call double @llvm.fabs.f64(double %f)
24 %res = fsub double -0.0, %abs
28 ; Test f128. With the loads and stores, a pure negative-absolute would
29 ; probably be better implemented using an OI on the upper byte. Do some
30 ; extra processing so that using FPRs is unequivocally better.
31 declare fp128 @llvm.fabs.f128(fp128 %f)
32 define void @f3(fp128 *%ptr, fp128 *%ptr2) {
37 %orig = load fp128, fp128 *%ptr
38 %abs = call fp128 @llvm.fabs.f128(fp128 %orig)
39 %negabs = fsub fp128 0xL00000000000000008000000000000000, %abs
40 %op2 = load fp128, fp128 *%ptr2
41 %res = fdiv fp128 %negabs, %op2
42 store fp128 %res, fp128 *%ptr