[PATCH] D95620: [RISCV] Support scalable-vector integer reduction intrinsics
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 02:37:48 PST 2021
frasercrmck added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1677
+ MVT M1VT = MVT::getScalableVectorVT(VecEltVT, NumElts);
+ SDValue Splat0 = DAG.getSplatVector(
+ M1VT, DL, DAG.getConstant(0, DL, Subtarget.getXLenVT()));
----------------
craig.topper wrote:
> craig.topper wrote:
> > Doesn't this need to be the identify value for the operation not always 0? I think AND would need -1. SMIN would need INT_MAX, SMAX would need INT_MIN, UMAX would need UINT_MAX.
> > Doesn't this need to be the identify value for the operation not always 0? I think AND would need -1. SMIN would need INT_MAX, SMAX would need INT_MIN, UMAX would need UINT_MAX.
>
> Oops UMAX would need 0, UMIN would need UINT_MAX
Wow, of course they would. Can't believe I missed that. Thanks! Must have been too focused on "add".
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95620/new/
https://reviews.llvm.org/D95620
More information about the llvm-commits
mailing list