summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/hlsl.meta.slang588
1 files changed, 572 insertions, 16 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index ef5c3ae5d..3d712559d 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -2707,6 +2707,46 @@ ${{{{
return __atomicMax(buf[byteAddress / 8], value);
}
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMax64(uint byteAddress, int64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMax64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMax64(uint byteAddress, int64_t value, out int64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMax64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMax64(uint byteAddress, uint64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMax64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMax64(uint byteAddress, uint64_t value, out uint64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMax64";
+ }
+ }
+
// Min
__cuda_sm_version(3.5)
@@ -2724,6 +2764,46 @@ ${{{{
return __atomicMin(buf[byteAddress / 8], value);
}
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMin64(uint byteAddress, int64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMin64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMin64(uint byteAddress, int64_t value, out int64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMin64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMin64(uint byteAddress, uint64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMin64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedMin64(uint byteAddress, uint64_t value, out uint64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedMin64";
+ }
+ }
+
// And
__target_intrinsic(cuda, "atomicAnd($0._getPtrAt<uint64_t>($1), $2)")
@@ -2740,6 +2820,26 @@ ${{{{
return __atomicAnd(buf[byteAddress / 8], value);
}
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedAnd64(uint byteAddress, uint64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedAnd64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedAnd64(uint byteAddress, uint64_t value, out uint64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedAnd64";
+ }
+ }
+
// Or
__target_intrinsic(cuda, "atomicOr($0._getPtrAt<uint64_t>($1), $2)")
@@ -2756,6 +2856,26 @@ ${{{{
return __atomicOr(buf[byteAddress / 8], value);
}
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedOr64(uint byteAddress, uint64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedOr64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedOr64(uint byteAddress, uint64_t value, out uint64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedOr64";
+ }
+ }
+
// Xor
__target_intrinsic(cuda, "atomicXor($0._getPtrAt<uint64_t>($1), $2)")
@@ -2772,6 +2892,26 @@ ${{{{
return __atomicXor(buf[byteAddress / 8], value);
}
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedXor64(uint byteAddress, uint64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedXor64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedXor64(uint byteAddress, uint64_t value, out uint64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedXor64";
+ }
+ }
+
// Exchange
__target_intrinsic(cuda, "atomicExch($0._getPtrAt<uint64_t>($1), $2)")
@@ -2788,31 +2928,89 @@ ${{{{
return __atomicExchange(buf[byteAddress / 8], value);
}
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedExchangeFloat(uint byteAddress, float value, out float outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedExchangeFloat";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedExchange64(uint byteAddress, int64_t value, out int64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedExchange64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedExchange64(uint byteAddress, uint64_t value, out uint64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedExchange64";
+ }
+ }
+
// SM6.6 6 64bit atomics.
- __specialized_for_target(hlsl)
- void InterlockedAdd64(uint byteAddress, int64_t valueToAdd, out int64_t outOriginalValue)
+ [ForceInline]
+ void InterlockedAdd64(uint byteAddress, int64_t valueToAdd)
{
- __atomicAdd(this, byteAddress, valueToAdd, outOriginalValue);
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedAdd64";
+ case glsl:
+ case spirv:
+ let buf = __getEquivalentStructuredBuffer<int64_t>(this);
+ __atomicAdd(buf[byteAddress / 8], valueToAdd);
+ }
}
- __specialized_for_target(glsl)
- __specialized_for_target(spirv)
- void InterlockedAdd64(uint byteAddress, int64_t valueToAdd, out int64_t originalValue)
+
+ [ForceInline]
+ void InterlockedAdd64(uint byteAddress, int64_t valueToAdd, out int64_t outOriginalValue)
{
- let buf = __getEquivalentStructuredBuffer<int64_t>(this);
- originalValue = __atomicAdd(buf[byteAddress / 8], valueToAdd);
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedAdd64";
+ case glsl:
+ case spirv:
+ let buf = __getEquivalentStructuredBuffer<int64_t>(this);
+ outOriginalValue = __atomicAdd(buf[byteAddress / 8], valueToAdd);
+ }
}
- __specialized_for_target(hlsl)
- void InterlockedAdd64(uint byteAddress, uint64_t valueToAdd, out uint64_t outOriginalValue)
+
+ [ForceInline]
+ void InterlockedAdd64(uint byteAddress, uint64_t valueToAdd)
{
- __atomicAdd(this, byteAddress, valueToAdd, outOriginalValue);
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedAdd64";
+ case glsl:
+ case spirv:
+ let buf = __getEquivalentStructuredBuffer<uint64_t>(this);
+ __atomicAdd(buf[byteAddress / 8], valueToAdd);
+ }
}
- __specialized_for_target(glsl)
- __specialized_for_target(spirv)
- void InterlockedAdd64(uint byteAddress, uint64_t valueToAdd, out uint64_t originalValue)
+
+ [ForceInline]
+ void InterlockedAdd64(uint byteAddress, uint64_t valueToAdd, out uint64_t outOriginalValue)
{
- let buf = __getEquivalentStructuredBuffer<uint64_t>(this);
- originalValue = __atomicAdd(buf[byteAddress / 8], valueToAdd);
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedAdd64";
+ case glsl:
+ case spirv:
+ let buf = __getEquivalentStructuredBuffer<uint64_t>(this);
+ outOriginalValue = __atomicAdd(buf[byteAddress / 8], valueToAdd);
+ }
}
+
__specialized_for_target(hlsl)
void InterlockedCompareExchange64(uint byteAddress, int64_t compareValue, int64_t value, out int64_t outOriginalValue)
{
@@ -2837,6 +3035,66 @@ ${{{{
let buf = __getEquivalentStructuredBuffer<uint64_t>(this);
outOriginalValue = __cas(buf[byteAddress / 8], compareValue, value);
}
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedCompareStoreFloatBitwise(uint byteAddress, float compareValue, float value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedCompareStoreFloatBitwise";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedCompareExchangeFloatBitwise(uint byteAddress, float compareValue, float value, out float outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedCompareExchangeFloatBitwise";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedCompareStore64(uint byteAddress, int64_t compareValue, int64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedCompareStore64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedCompareExchange64(uint byteAddress, int64_t compareValue, int64_t value, out int64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedCompareExchange64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedCompareStore64(uint byteAddress, uint64_t compareValue, uint64_t value)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedCompareStore64";
+ }
+ }
+
+ [require(hlsl)]
+ [ForceInline]
+ void InterlockedCompareExchange64(uint byteAddress, uint64_t compareValue, uint64_t value, out uint64_t outOriginalValue)
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm ".InterlockedCompareExchange64";
+ }
+ }
+
${{{{
} // endif (type == RWByteAddressBuffer)
}}}}
@@ -5200,6 +5458,42 @@ void InterlockedAdd(__ref uint dest, uint value, out uint original_value)
}
}
+[ForceInline]
+void InterlockedAdd(__ref int64_t dest, int64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedAdd";
+ }
+}
+
+[ForceInline]
+void InterlockedAdd(__ref int64_t dest, int64_t value, out int64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedAdd";
+ }
+}
+
+[ForceInline]
+void InterlockedAdd(__ref uint64_t dest, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedAdd";
+ }
+}
+
+[ForceInline]
+void InterlockedAdd(__ref uint64_t dest, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedAdd";
+ }
+}
+
__glsl_version(430)
void InterlockedAnd(__ref int dest, int value)
{
@@ -5266,6 +5560,24 @@ void InterlockedAnd(__ref uint dest, uint value, out uint original_value)
}
}
+[ForceInline]
+void InterlockedAnd(__ref uint64_t dest, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedAnd";
+ }
+}
+
+[ForceInline]
+void InterlockedAnd(__ref uint64_t dest, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedAnd";
+ }
+}
+
__glsl_version(430)
void InterlockedCompareExchange(__ref int dest, int compare_value, int value, out int original_value)
{
@@ -5300,6 +5612,60 @@ void InterlockedCompareExchange(__ref uint dest, uint compare_value, uint value,
}
}
+[ForceInline]
+void InterlockedCompareExchangeFloatBitwise(__ref float dest, float compare_value, float value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareExchangeFloatBitwise";
+ }
+}
+
+[ForceInline]
+void InterlockedCompareExchangeFloatBitwise(__ref float dest, float compare_value, float value, out float original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareExchangeFloatBitwise";
+ }
+}
+
+[ForceInline]
+void InterlockedCompareExchange(__ref int64_t dest, int64_t compare_value, int64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedCompareExchange(__ref int64_t dest, int64_t compare_value, int64_t value, out int64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedCompareExchange(__ref uint64_t dest, uint64_t compare_value, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedCompareExchange(__ref uint64_t dest, uint64_t compare_value, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareExchange";
+ }
+}
+
__glsl_version(430)
void InterlockedCompareStore(__ref int dest, int compare_value, int value)
{
@@ -5332,6 +5698,33 @@ void InterlockedCompareStore(__ref uint dest, uint compare_value, uint value)
}
}
+[ForceInline]
+void InterlockedCompareStoreFloatBitwise(__ref float dest, float compare_value, float value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareStoreFloatBitwise";
+ }
+}
+
+[ForceInline]
+void InterlockedCompareStore(__ref int64_t dest, int64_t compare_value, int64_t value);
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareStore";
+ }
+}
+
+[ForceInline]
+void InterlockedCompareStore(__ref uint64_t dest, uint64_t compare_value, uint64_t value);
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedCompareStore";
+ }
+}
+
__glsl_version(430)
void InterlockedExchange(__ref int dest, int value, out int original_value)
{
@@ -5366,6 +5759,60 @@ void InterlockedExchange(__ref uint dest, uint value, out uint original_value)
}
}
+[ForceInline]
+void InterlockedExchange(__ref float dest, float value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedExchange(__ref float dest, float value, out float original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedExchange(__ref int64_t dest, int64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedExchange(__ref int64_t dest, int64_t value, out int64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedExchange(__ref uint64_t dest, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedExchange";
+ }
+}
+
+[ForceInline]
+void InterlockedExchange(__ref uint64_t dest, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedExchange";
+ }
+}
+
__glsl_version(430)
void InterlockedMax(__ref int dest, int value)
{
@@ -5432,6 +5879,42 @@ void InterlockedMax(__ref uint dest, uint value, out uint original_value)
}
}
+[ForceInline]
+void InterlockedMax(__ref int64_t dest, int64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMax";
+ }
+}
+
+[ForceInline]
+void InterlockedMax(__ref int64_t dest, int64_t value, out int64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMax";
+ }
+}
+
+[ForceInline]
+void InterlockedMax(__ref uint64_t dest, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMax";
+ }
+}
+
+[ForceInline]
+void InterlockedMax(__ref uint64_t dest, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMax";
+ }
+}
+
__glsl_version(430)
void InterlockedMin(__ref int dest, int value)
{
@@ -5498,6 +5981,42 @@ void InterlockedMin(__ref uint dest, uint value, out uint original_value)
}
}
+[ForceInline]
+void InterlockedMin(__ref int64_t dest, int64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMin";
+ }
+}
+
+[ForceInline]
+void InterlockedMin(__ref int64_t dest, int64_t value, out int64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMin";
+ }
+}
+
+[ForceInline]
+void InterlockedMin(__ref uint64_t dest, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMin";
+ }
+}
+
+[ForceInline]
+void InterlockedMin(__ref uint64_t dest, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedMin";
+ }
+}
+
__glsl_version(430)
void InterlockedOr(__ref int dest, int value)
{
@@ -5564,6 +6083,24 @@ void InterlockedOr(__ref uint dest, uint value, out uint original_value)
}
}
+[ForceInline]
+void InterlockedOr(__ref uint64_t dest, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedOr";
+ }
+}
+
+[ForceInline]
+void InterlockedOr(__ref uint64_t dest, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedOr";
+ }
+}
+
__glsl_version(430)
void InterlockedXor(__ref int dest, int value)
{
@@ -5630,6 +6167,25 @@ void InterlockedXor(__ref uint dest, uint value, out uint original_value)
}
}
+[ForceInline]
+void InterlockedXor(__ref uint64_t dest, uint64_t value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedXor";
+ }
+}
+
+[ForceInline]
+void InterlockedXor(__ref uint64_t dest, uint64_t value, out uint64_t original_value)
+{
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "InterlockedXor";
+ }
+}
+
+
// Is floating-point value finite?
__generic<T : __BuiltinFloatingPointType>