================
@@ -1635,6 +1635,38 @@
BuiltinTypeDeclBuilder::addByteAddressBufferStoreMethods() {
return *this;
}
+BuiltinTypeDeclBuilder &
+BuiltinTypeDeclBuilder::addByteAddressBufferInterlockedMethods() {
+ assert(!Record->isCompleteDefinition() && "record is already complete");
+ ASTContext &AST = SemaRef.getASTContext();
+
+ // Each entry declares two overloads (with and without an out original-value
+ // parameter). Adding a new atomic here only requires a new line — the shared
+ // helper takes care of the composition.
+ addByteAddressBufferInterlockedMethod("InterlockedAdd", AST.UnsignedIntTy,
+ "__builtin_hlsl_interlocked_add");
+
+ // 64-bit typed atomics on UAVs require SM 6.6 (DXIL 1.6 introduces the
+ // int64 overload of the atomicBinOp op). Skip synthesizing the *64 methods
+ // on older DXIL targets so callers get "no matching member function" from
+ // overload resolution — this matches DXC and mirrors how other HLSL SM-gated
+ // features are handled (see hlsl_intrinsics.h `_HLSL_AVAILABILITY`
+ // annotations). Non-DXIL targets (e.g., SPIR-V) always get the method: their
+ // 64-bit atomic support is gated by device extensions, not shader model.
+ const llvm::Triple &TT = AST.getTargetInfo().getTriple();
+ bool DXILNeedsSM66 =
----------------
farzonl wrote:
bools should be like questions change this up to something like for equals
something like this `IsSM66` for less than `IsLessthanSM66`, `IsGreaterThan`,
`IsGreaterThanOrEqualTo*`.
https://github.com/llvm/llvm-project/pull/208128
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits