[llvm] [X86] computeKnownBitsForTargetNode - add INTRINSIC_WO_CHAIN handling for PSADBW intrinsics (PR #83580)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 2 10:13:53 PST 2024
================
@@ -36980,6 +36980,18 @@ void X86TargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
}
break;
}
+ case ISD::INTRINSIC_WO_CHAIN: {
+ switch (Op->getConstantOperandVal(0)) {
+ case Intrinsic::x86_sse2_psad_bw:
+ case Intrinsic::x86_avx2_psad_bw:
+ case Intrinsic::x86_avx512_psad_bw_512:
+ // PSADBW - fills low 16 bits and zeros upper 48 bits of each i64 result.
+ assert(VT.getScalarType() == MVT::i64 && "Unexpected PSADBW types");
+ Known.Zero.setBitsFrom(16);
+ break;
----------------
goldsteinn wrote:
Why not just write a helper that does the right logic now, then your patch for https://github.com/llvm/llvm-project/issues/81765 will just be calling the function for `X86ISD::PSADBW` as well?
Don't feel strongly, just seems strange.
https://github.com/llvm/llvm-project/pull/83580
More information about the llvm-commits
mailing list