Fix OpAtomicUMin, OpAtomicUMax
I had made a bad assumption earlier that these would choose the correct operation based on signedness. That's not the case -- LLVM has separate Max/UMax and Min/UMin RMW operations.
Test: dEQP-VK.glsl.atomic_operations.*
Change-Id: I92a9e56011c4ef8ac658a826c480b16f65d0704d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31909
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
diff --git a/src/Reactor/Reactor.cpp b/src/Reactor/Reactor.cpp
index f9a0072..7ddee35 100644
--- a/src/Reactor/Reactor.cpp
+++ b/src/Reactor/Reactor.cpp
@@ -2540,7 +2540,7 @@
RValue<UInt> MinAtomic(RValue<Pointer<UInt> > x, RValue<UInt> y, std::memory_order memoryOrder)
{
- return RValue<UInt>(Nucleus::createAtomicMin(x.value, y.value, memoryOrder));
+ return RValue<UInt>(Nucleus::createAtomicUMin(x.value, y.value, memoryOrder));
}
RValue<Int> MaxAtomic(RValue<Pointer<Int> > x, RValue<Int> y, std::memory_order memoryOrder)
@@ -2550,7 +2550,7 @@
RValue<UInt> MaxAtomic(RValue<Pointer<UInt> > x, RValue<UInt> y, std::memory_order memoryOrder)
{
- return RValue<UInt>(Nucleus::createAtomicMax(x.value, y.value, memoryOrder));
+ return RValue<UInt>(Nucleus::createAtomicUMax(x.value, y.value, memoryOrder));
}
RValue<UInt> ExchangeAtomic(RValue<Pointer<UInt> > x, RValue<UInt> y, std::memory_order memoryOrder)