================
@@ -738,6 +739,16 @@ def UMin : DXILOp<40, binary> {
   let attributes = [Attributes<DXIL1_0, [ReadNone]>];
 }
 
+def UAddc : DXILOp<44, binaryWithCarryOrBorrow > {
+  let Doc = "Unsigned 32-bit integer arithmetic add with carry. uaddc(a,b) = 
(a+b, a+b overflowed ? 1 : 0)";
+  let intrinsics = [IntrinSelect<int_uadd_with_overflow>];
----------------
farzonl wrote:

This isn't a nice tablegen solution, but we have the power to check  if we have 
a non 32 bit case in `DXILIntrinsicExpansion.cpp`. It would be a little bit of 
a new pattern for us because it would be the first time we check an intrinsic  
and might not apply a transformation.

Downside is it assumes the DXIL version doesn't update UAddc for other types 
and if it ever did we would have to introduces some versioning to only do this 
for pre DXIL 1.6.x.

Upside it lets you keep the  direct mapping of `int_uadd_with_overflow` to 
`UAddc` and only modify for the expansion cases.

https://github.com/llvm/llvm-project/pull/127137
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to