Implement the InterlockedCompareStore
HLSL Function
#99128
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
InterlockedCompareStore
clang builtin,InterlockedCompareStore
clang builtin withhlsl_intrinsics.h
InterlockedCompareStore
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
InterlockedCompareStore
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/InterlockedCompareStore.hlsl
clang/test/SemaHLSL/BuiltIns/InterlockedCompareStore-errors.hlsl
int_dx_InterlockedCompareStore
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_InterlockedCompareStore
to79
inDXIL.td
InterlockedCompareStore.ll
andInterlockedCompareStore_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_InterlockedCompareStore
intrinsic inIntrinsicsSPIRV.td
InterlockedCompareStore
lowering and map it toint_spv_InterlockedCompareStore
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/InterlockedCompareStore.ll
DirectX
SPIR-V
OpAtomicCompareExchange:
Description:
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
Comparator, and
equaled Comparator.
The instruction’s result is the Original Value.
Result Type must be an integer type scalar.
Use Equal for the memory semantics of this instruction when Value
and Original Value compare equal.
Use Unequal for the memory semantics of this instruction when Value
and Original Value compare unequal. Unequal must not be set to
Release or Acquire and Release. In addition, Unequal cannot be
set to a stronger memory-order then Equal.
The type of Value must be the same as Result Type. The type of the
value pointed to by Pointer must be the same as Result Type. This
type must also match the type of Comparator.
Memory is a memory Scope.
9
230
<id>
Result Type
Result <id>
<id>
Pointer
Scope <id>
Memory
Memory Semantics <id>
Equal
Memory Semantics <id>
Unequal
<id>
Value
<id>
Comparator
Test Case(s)
Example 1
Example 2
HLSL:
Atomically compares the destination to the comparison value. If they are identical, the destination is overwritten with the input value.
Syntax
Parameters
dest [in]
Type: R
The destination address.
compare_value [in]
Type: T
The comparison value.
value [in]
Type: T
The input value.
Return value
This function does not return a value.
Remarks
Atomically compares the value referenced by dest with compare_value and stores value in the location referenced by dest if the values match. This operation can only be performed on int or uint typed resources and shared memory variables. There are two possible uses for this function. The first is when R is a shared memory variable type. In this case, the function performs the operation on the shared memory register referenced by dest. The second scenario is when R is a resource variable type. In this scenario, the function performs the operation on the resource location referenced by dest.
Interlocked operations do not imply any memory fence/barrier.
Minimum Shader Model
This function is supported in the following shader models.
This function is supported in the following types of shaders:
See also
Intrinsic Functions
Shader Model 5
The text was updated successfully, but these errors were encountered: