1 ; Test floating-point negation.
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 define float @f1(float %f) {
9 ; CHECK: lcdfr %f0, %f0
11 %res = fsub float -0.0, %f
16 define double @f2(double %f) {
18 ; CHECK: lcdfr %f0, %f0
20 %res = fsub double -0.0, %f
24 ; Test f128. With the loads and stores, a pure negation would probably
25 ; be better implemented using an XI on the upper byte. Do some extra
26 ; processing so that using FPRs is unequivocally better.
27 define void @f3(fp128 *%ptr, fp128 *%ptr2) {
32 %orig = load fp128, fp128 *%ptr
33 %negzero = fpext float -0.0 to fp128
34 %neg = fsub fp128 0xL00000000000000008000000000000000, %orig
35 %op2 = load fp128, fp128 *%ptr2
36 %res = fdiv fp128 %neg, %op2
37 store fp128 %res, fp128 *%ptr