[llvm] [AMDGPU] selecting v_sat_pk instruction, version 2 (PR #123297)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 00:46:41 PST 2025


================
@@ -6605,6 +6622,13 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N,
     Results.push_back(lowerFSQRTF16(SDValue(N, 0), DAG));
     break;
   }
+  case ISD::TRUNCATE_SSAT_U: {
+    SDLoc SL(N);
+    SDValue Op =
+        DAG.getNode(AMDGPUISD::SAT_PK_CAST, SL, MVT::i16, N->getOperand(0));
+    Results.push_back(Op);
----------------
arsenm wrote:

You need to insert a cast to the original type,  does this not assert as-is? 

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


More information about the llvm-commits mailing list