Implement IMAGE_ATOMIC_SWAP (#2194)

We already handle everything for this opcode in our IMAGE_ATOMIC function, so implementing this is fairly simple.
Should improve Wipeout 3.
This commit is contained in:
Stephen Miller 2025-01-19 21:20:51 -06:00 committed by GitHub
parent 4fa501c8d5
commit 0f93edb377
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -3420,8 +3420,8 @@ constexpr std::array<InstFormat, 112> InstructionFormatMIMG = {{
{InstClass::VectorMemImgUt, InstCategory::VectorMemory, 4, 1, ScalarType::Uint32, {InstClass::VectorMemImgUt, InstCategory::VectorMemory, 4, 1, ScalarType::Uint32,
ScalarType::Uint32}, ScalarType::Uint32},
// 15 = IMAGE_ATOMIC_SWAP // 15 = IMAGE_ATOMIC_SWAP
{InstClass::VectorMemImgNoSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Undefined, {InstClass::VectorMemImgNoSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Uint32,
ScalarType::Undefined}, ScalarType::Uint32},
// 16 = IMAGE_ATOMIC_CMPSWAP // 16 = IMAGE_ATOMIC_CMPSWAP
{InstClass::VectorMemImgNoSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Undefined, {InstClass::VectorMemImgNoSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Undefined,
ScalarType::Undefined}, ScalarType::Undefined},

View file

@ -107,6 +107,8 @@ void Translator::EmitVectorMemory(const GcnInst& inst) {
return IMAGE_GET_RESINFO(inst); return IMAGE_GET_RESINFO(inst);
// Image atomic operations // Image atomic operations
case Opcode::IMAGE_ATOMIC_SWAP:
return IMAGE_ATOMIC(AtomicOp::Swap, inst);
case Opcode::IMAGE_ATOMIC_ADD: case Opcode::IMAGE_ATOMIC_ADD:
return IMAGE_ATOMIC(AtomicOp::Add, inst); return IMAGE_ATOMIC(AtomicOp::Add, inst);
case Opcode::IMAGE_ATOMIC_SMIN: case Opcode::IMAGE_ATOMIC_SMIN: