1; Test floating-point negation. 2; 3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s 4 5; Test f32. 6define float @f1(float %f) { 7; CHECK-LABEL: f1: 8; CHECK: lcebr %f0, %f0 9; CHECK: br %r14 10 %res = fsub float -0.0, %f 11 ret float %res 12} 13 14; Test f64. 15define double @f2(double %f) { 16; CHECK-LABEL: f2: 17; CHECK: lcdbr %f0, %f0 18; CHECK: br %r14 19 %res = fsub double -0.0, %f 20 ret double %res 21} 22 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. 26define void @f3(fp128 *%ptr, fp128 *%ptr2) { 27; CHECK-LABEL: f3: 28; CHECK: lcxbr 29; CHECK: dxbr 30; CHECK: br %r14 31 %orig = load fp128 , fp128 *%ptr 32 %negzero = fpext float -0.0 to fp128 33 %neg = fsub fp128 0xL00000000000000008000000000000000, %orig 34 %op2 = load fp128 , fp128 *%ptr2 35 %res = fdiv fp128 %neg, %op2 36 store fp128 %res, fp128 *%ptr 37 ret void 38} 39