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
15 define double @f2(double %f) {
17 ; CHECK: lcdfr %f0, %f0
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(ptr %ptr, ptr %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, ptr %ptr
35 %negzero = fpext float -0.0 to fp128
36 %neg = fneg fp128 %orig
37 %op2 = load fp128, ptr %ptr2
38 %res = fdiv fp128 %neg, %op2
39 store fp128 %res, ptr %ptr