[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 25 05:20:32 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>];
----------------
farzonl wrote:
One thing I am a little worried about is if we are misusing `int_uadd_with_overflow` here. This kind feels like a square is a rectangle but rectangles are not squares cases where llvm is using `int_uadd_with_overflow` much more broadly than we are. It makes me think If something else were to come along and emit `int_uadd_with_overflow` and it wasn't a `uint32_t2` or `uint32_t4` case would we be doing the right thing by associating the overflow intrinsic with `UAddc`?
https://github.com/llvm/llvm-project/pull/127137
More information about the cfe-commits
mailing list