diff --git a/src/graphics/shader/recompiler/frontend/decode/VectorAluOps.cpp b/src/graphics/shader/recompiler/frontend/decode/VectorAluOps.cpp index 0735a15d9..b9c6a6ea9 100644 --- a/src/graphics/shader/recompiler/frontend/decode/VectorAluOps.cpp +++ b/src/graphics/shader/recompiler/frontend/decode/VectorAluOps.cpp @@ -11,7 +11,6 @@ using Detail::OpcodeMap; // architectural SDWA legality classes. enum class Vop2SdwaProfile { None, - Cndmask, Float32, Float16, IntegerFullDestination, @@ -29,7 +28,7 @@ struct Vop2OpcodeInfo { }; constexpr Vop2OpcodeInfo VOP2_OPCODE_LIST[] = { - {0x01u, Opcode::V_CNDMASK_B32, Vop2SdwaProfile::Cndmask}, + {0x01u, Opcode::V_CNDMASK_B32, Vop2SdwaProfile::IntegerPartialDestination}, {0x02u, Opcode::V_DOT2C_F32_F16}, {0x03u, Opcode::V_ADD_F32, Vop2SdwaProfile::Float32}, {0x04u, Opcode::V_SUB_F32, Vop2SdwaProfile::Float32}, @@ -929,8 +928,6 @@ constexpr uint32_t SdwaSelAll() { constexpr Vop2SdwaRule VOP2_SDWA_RULES[] = { {}, - {SdwaSelWords() | SdwaSelFull(), SdwaSelWords() | SdwaSelFull(), SdwaSelWords() | SdwaSelFull(), - true, false}, {SdwaSelFull(), SdwaSelFull(), SdwaSelFull(), false, true}, {SdwaSelWords() | SdwaSelFull(), SdwaSelWords() | SdwaSelFull(), SdwaSelWords() | SdwaSelFull(), true, true}, diff --git a/tests/ShaderRecompilerComputeTests.cpp b/tests/ShaderRecompilerComputeTests.cpp index 244982a6f..cbfa73a2c 100644 --- a/tests/ShaderRecompilerComputeTests.cpp +++ b/tests/ShaderRecompilerComputeTests.cpp @@ -14684,29 +14684,32 @@ TestCase Vop2SdwaCndmaskSourceModifier() { O::BUFFER_STORE_DWORD, O::S_ENDPGM}}; } -TestCase Vop2SdwaCndmaskFullDestinationWithSubDwordSource() { +TestCase Vop2SdwaCndmaskCapturedByte3Source() { using O = ShaderOpcode; std::vector code; - AppendVMovLiteral(&code, 0, 0xabcd1234u); - AppendVMovLiteral(&code, 1, 0x55667788u); + AppendVMovLiteral(&code, 0, 0x55667788u); + AppendBufferLoadDword(&code, 3, 30); code.push_back(EncodeVopc(0xc0, Vgpr(0), 0)); // v_cmp_f_u32 - code.push_back(0x020e02f9u); - code.push_back(0x06040600u); - AppendStoreVgpr(&code, 7, 0); + code.push_back(0x023a00f9u); + code.push_back(0x06030603u); + AppendStoreVgpr(&code, 29, 1); code.push_back(EncodeVopc(0xc7, Vgpr(0), 0)); // v_cmp_t_u32 - code.push_back(0x020e02f9u); - code.push_back(0x06040600u); - AppendStoreVgpr(&code, 7, 1); + code.push_back(0x023a00f9u); + code.push_back(0x06030603u); + AppendStoreVgpr(&code, 29, 2); AppendEnd(&code); TestCase test; - test.name = "Vop2SdwaCndmaskFullDestinationWithSubDwordSource"; + test.name = "Vop2SdwaCndmaskCapturedByte3Source"; test.code = code; - test.expected = {0x00001234u, 0x55667788u}; - test.opcodes = {O::V_MOV_B32, O::V_CMP_F_U32, O::V_CMP_T_U32, - O::V_CNDMASK_B32, O::BUFFER_STORE_DWORD, O::S_ENDPGM}; - test.required_spirv = {"OpSelect"}; + test.initial = {0xabcd1234u, 0, 0}; + test.expected = {0xabcd1234u, 0x000000abu, 0x55667788u}; + test.opcodes = {O::V_MOV_B32, O::BUFFER_LOAD_DWORD, O::V_CMP_F_U32, + O::V_CMP_T_U32, O::V_CNDMASK_B32, O::BUFFER_STORE_DWORD, + O::S_ENDPGM}; + test.decoded_counts = {{"V_CNDMASK_B32 v29, v3.sdwa(sel=3,sext=0), v0", 2}}; + test.required_spirv = {"OpBitFieldUExtract", "OpSelect"}; return test; } @@ -19291,7 +19294,7 @@ std::vector MakeCases() { AddCase(VectorCompareClassF32); AddCase(VectorCompareF16Ops); AddCase(Vop2SdwaCndmaskSourceModifier); - AddCase(Vop2SdwaCndmaskFullDestinationWithSubDwordSource); + AddCase(Vop2SdwaCndmaskCapturedByte3Source); AddCase(Vop3CndmaskUsesSgprMaskLaneBits); AddCase(Vop3CndmaskAllowsDataSourceModifier); AddCase(VectorCompareExecOps);