[clang] [llvm] [PowerPC] Add Support for BCDSHIFT, BCDSHIFTR, BCDTRUNC, BCDUTRUNC, and BCDUSHIFT instruction support (PR #154715)

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 3 13:51:43 PDT 2025


================
@@ -11151,6 +11161,20 @@ SDValue PPCTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
 
   SDLoc dl(Op);
 
+  // Lowers BCD intrinsics with rounding operand
+  auto MapNodeWithSplatVector = [&](unsigned Opcode) -> SDValue {
+    SDValue SplatVal =
+        DAG.getNode(ISD::SPLAT_VECTOR, dl, MVT::v4i32, Op.getOperand(2));
----------------
amy-kwan wrote:

I agree with Tony that the elaborated comment would be good.

Also, could the lambdas be combined? It seems the only differentiating line is the return statement, so perhaps we can just check the PPCISD opcode coming in and perform the appropriate return line depending on the opcode?

https://github.com/llvm/llvm-project/pull/154715


More information about the llvm-commits mailing list