[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 4 14:48:31 PST 2025
================
@@ -19105,6 +19105,51 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
return nullptr;
switch (BuiltinID) {
+ case Builtin::BI__builtin_hlsl_adduint64: {
----------------
farzonl wrote:
So while HLSL does not support pointers we do have a concept of out args. if you search for `EmitHLSLOutArgExpr` I think you can find some uses. My thinking is maybe we could do our own builtin like you have done but without the pointer and have an anonymous struct returned. then we could still piggy back off of the code genen for __builtin_addc even if we don't use the builtin itself. Maybe thats more complicated than it has to be, but it could be a way to keep the codegen for the `uadd_with_overflow` intrinsic in one place.
https://github.com/llvm/llvm-project/pull/125319
More information about the cfe-commits
mailing list