[llvm] [AMDGPU][True16][CodeGen] uaddsat/usubsat sdag for true16 format (PR #118708)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 15:04:51 PST 2024


================
@@ -1241,6 +1241,15 @@ let True16Predicate = NotHasTrue16BitInsts, SubtargetPredicate = isGFX10Plus in
    >;
 } // End True16Predicate = NotHasTrue16BitInsts, SubtargetPredicate = isGFX10Plus
 
+let True16Predicate = UseRealTrue16Insts in {
+  def : OpSelBinOpClampPat<uaddsat, V_ADD_NC_U16_t16_e64>;
+  def : OpSelBinOpClampPat<usubsat, V_SUB_NC_U16_t16_e64>;
+  def : GCNPat<
+    (add i16:$src0, (i16 NegSubInlineIntConst16:$src1)),
+    (V_SUB_NC_U16_t16_e64 0, VSrc_b16:$src0, 0, NegSubInlineIntConst16:$src1, 0, 0)
----------------
arsenm wrote:

Oh, this is not the addsat case. This is unrelated to this patch. The add->sub pattern should be done separately

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


More information about the llvm-commits mailing list