-0.0 requires a constant pool. +0.0 can be made with vmv.v.x x0.
Not doing this in getNeutralElement for fear of changing other targets.
Paths
| Differential D115978
[RISCV] Use positive 0.0 for the neutral element in fadd reductions if nsz is present. ClosedPublic Authored by craig.topper on Dec 17 2021, 3:37 PM.
Details Summary -0.0 requires a constant pool. +0.0 can be made with vmv.v.x x0. Not doing this in getNeutralElement for fear of changing other targets.
Diff Detail
Event TimelineHerald added subscribers: VincentWu, luke957, achieveartificialintelligence and 25 others. · View Herald TranscriptDec 17 2021, 3:37 PM craig.topper retitled this revision from [RISCV] Use positive 0.0 for the neutral element in reductions if nsz is present. to [RISCV] Use positive 0.0 for the neutral element in fadd reductions if nsz is present..Dec 17 2021, 3:39 PM Comment Actions LGTM. Though perhaps we can improve the generation of -0.0 in another patch. Something like this (similarly for f64) fmv.w.x fa5, x0 fsgnjn.s fa5, fa5, fa5 I think it should work and we avoid the constant pool (at expense of an extra instruction). This revision is now accepted and ready to land.Dec 22 2021, 11:32 PM This revision was landed with ongoing or failed builds.Dec 23 2021, 8:38 AM Closed by commit rG7704c503ecb8: [RISCV] Use positive 0.0 for the neutral element in fadd reductions if nsz is… (authored by craig.topper). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 396033 llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp.ll
llvm/test/CodeGen/RISCV/rvv/vreductions-fp-sdnode.ll
|