[llvm] [VP][RISCV] Add vp.cttz.elts intrinsic and its RISC-V codegen (PR #90502)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 11:07:41 PDT 2024
================
@@ -9074,6 +9074,38 @@ SDValue TargetLowering::expandVPCTTZ(SDNode *Node, SelectionDAG &DAG) const {
return DAG.getNode(ISD::VP_CTPOP, dl, VT, Tmp, Mask, VL);
}
+SDValue TargetLowering::expandVPCTTZElements(SDNode *N,
+ SelectionDAG &DAG) const {
+ // %cond = to_bool_vec %source
+ // %splat = splat /*val=*/VL
+ // %tz = step_vector
+ // %v = vp.select %cond, /*true=*/tz, /*false=*/%splat
+ // %r = vp.reduce.umin %v
----------------
topperc wrote:
I'm not sure this works. If element 0 and element 1 are both zero and element 2 is non-zero this will return 0, but we want to return 1.
https://github.com/llvm/llvm-project/pull/90502
More information about the llvm-commits
mailing list