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 = fneg float %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 = fneg double %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(ptr %ptr, ptr %ptr2) {
37 %orig = load fp128, ptr %ptr
38 %abs = call fp128 @llvm.fabs.f128(fp128 %orig)
39 %negabs = fneg fp128 %abs
40 %op2 = load fp128, ptr %ptr2
41 %res = fdiv fp128 %negabs, %op2
42 store fp128 %res, ptr %ptr