1 ; Test floating-point negation.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
6 define float @f1(float %f) {
8 ; CHECK: lcebr %f0, %f0
10 %res = fsub float -0.0, %f
15 define double @f2(double %f) {
17 ; CHECK: lcdbr %f0, %f0
19 %res = fsub double -0.0, %f
23 ; Test f128. With the loads and stores, a pure negation would probably
24 ; be better implemented using an XI on the upper byte. Do some extra
25 ; processing so that using FPRs is unequivocally better.
26 define void @f3(fp128 *%ptr, fp128 *%ptr2) {
31 %orig = load fp128 *%ptr
32 %negzero = fpext float -0.0 to fp128
33 %neg = fsub fp128 0xL00000000000000008000000000000000, %orig
34 %op2 = load fp128 *%ptr2
35 %res = fdiv fp128 %neg, %op2
36 store fp128 %res, fp128 *%ptr