[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 26 13:52:44 PST 2025
================
@@ -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>];
----------------
bogner wrote:
We would need to rev the DXIL version to introduce UAddc for other types I think. I think Farzon's concern is that we might want to (at some point) handle `int_uadd_with_overflow` generically, and since there isn't a DXIL op for it that would presumably involve an expansion. If we use the 32 bit `int_uadd_with_overflow` to map to UAddc, then whatever pass did that expansion would need to know not to do it for certain overloads and that might be awkward.
https://github.com/llvm/llvm-project/pull/127137
More information about the cfe-commits
mailing list