1 ; Test floating-point negation on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
6 define float @f1(float %f) {
8 ; CHECK: lcdfr %f0, %f0
10 %res = fsub float -0.0, %f
15 define double @f2(double %f) {
17 ; CHECK: lcdfr %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) {
28 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
29 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
30 ; CHECK-DAG: wflcxb [[NEGREG1:%v[0-9]+]], [[REG1]]
31 ; CHECK: wfdxb [[RES:%v[0-9]+]], [[NEGREG1]], [[REG2]]
32 ; CHECK: vst [[RES]], 0(%r2)
34 %orig = load fp128, fp128 *%ptr
35 %negzero = fpext float -0.0 to fp128
36 %neg = fsub fp128 0xL00000000000000008000000000000000, %orig
37 %op2 = load fp128, fp128 *%ptr2
38 %res = fdiv fp128 %neg, %op2
39 store fp128 %res, fp128 *%ptr