mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-16 18:15:25 +00:00
21 lines
592 B
Plaintext
21 lines
592 B
Plaintext
|
int Helper_AtomicMaxS32(int offset, int value)
|
||
|
{
|
||
|
uint oldValue, newValue;
|
||
|
do
|
||
|
{
|
||
|
oldValue = $SHARED_MEM$[offset];
|
||
|
newValue = uint(max(int(oldValue), value));
|
||
|
} while (atomicCompSwap($SHARED_MEM$[offset], newValue, oldValue) != oldValue);
|
||
|
return int(oldValue);
|
||
|
}
|
||
|
|
||
|
int Helper_AtomicMinS32(int offset, int value)
|
||
|
{
|
||
|
uint oldValue, newValue;
|
||
|
do
|
||
|
{
|
||
|
oldValue = $SHARED_MEM$[offset];
|
||
|
newValue = uint(min(int(oldValue), value));
|
||
|
} while (atomicCompSwap($SHARED_MEM$[offset], newValue, oldValue) != oldValue);
|
||
|
return int(oldValue);
|
||
|
}
|