Commit c9ca99ee by Chris Forbes

Fix comment describing compare/exchange behavior

Change-Id: Iacc8bd65e9f8ba268dbe7dae6aa244a25c6f770a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29548Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent 97035bde
......@@ -1496,7 +1496,7 @@ namespace rr
Value *Nucleus::createAtomicCompareExchange(Value *ptr, Value *value, Value *compare, std::memory_order memoryOrderEqual, std::memory_order memoryOrderUnequal)
{
RR_DEBUG_INFO_UPDATE_LOC();
// Note: AtomicCmpXchgInstruction returns a 1-member struct containing the result, not the result directly.
// Note: AtomicCmpXchgInstruction returns a 2-member struct containing {result, success-flag}, not the result directly.
return V(::builder->CreateExtractValue(
::builder->CreateAtomicCmpXchg(V(ptr), V(compare), V(value), atomicOrdering(true, memoryOrderEqual), atomicOrdering(true, memoryOrderUnequal)),
llvm::ArrayRef<unsigned>(0u)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment