mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 03:16:54 +02:00
shader: allow RDNA2 SDWA partial destinations for i24 multiply
This commit is contained in:
@@ -3668,6 +3668,39 @@ void TestNewShaderRecompilerVop1SdwaBfrev() {
|
||||
}
|
||||
}
|
||||
|
||||
void TestVop2SdwaMulI24Destination() {
|
||||
using namespace ShaderRecompiler::Decoder;
|
||||
const uint32_t captured[][2] = {
|
||||
{0x121818f9u, 0x04861488u}, {0x123434f9u, 0x0486146au}};
|
||||
for (uint32_t index = 0; index < 2; ++index) {
|
||||
Instruction decoded;
|
||||
DecodeInstruction(captured[index], 0, decoded);
|
||||
const uint32_t reg = index == 0 ? 12u : 26u;
|
||||
Check(decoded.opcode == Opcode::V_MUL_I32_I24 && decoded.word_count == 2 &&
|
||||
decoded.dst.kind == OperandKind::Vgpr && decoded.dst.reg == reg &&
|
||||
decoded.dst.sdwa_sel == 4 && decoded.dst.sdwa_dst_unused == 2 &&
|
||||
decoded.dst.explicit_sdwa_dst && !decoded.dst.clamp &&
|
||||
decoded.dst.omod == 0 && decoded.src0.sdwa_sel == 6 &&
|
||||
decoded.src1.kind == OperandKind::Vgpr && decoded.src1.reg == reg &&
|
||||
decoded.src1.sdwa_sel == 4 && !decoded.src1.sdwa_sext,
|
||||
"captured V_MUL_I32_I24 SDWA destination/source metadata is incorrect");
|
||||
Check(index == 0 ? decoded.src0.kind == OperandKind::IntegerInlineConstant &&
|
||||
decoded.src0.value == 8
|
||||
: decoded.src0.kind == OperandKind::VccLo,
|
||||
"captured V_MUL_I32_I24 SDWA scalar source is incorrect");
|
||||
}
|
||||
for (const uint32_t modifier : {
|
||||
0x04861788u, 0x04861c88u, 0x04871488u, 0x07861488u,
|
||||
0x04961488u, 0x04a61488u, 0x14861488u, 0x24861488u,
|
||||
0x04863488u, 0x04865488u}) {
|
||||
const uint32_t invalid[] = {captured[0][0], modifier};
|
||||
Instruction decoded;
|
||||
DecodeInstruction(invalid, 0, decoded);
|
||||
Check(decoded.opcode == Opcode::UNSUPPORTED && decoded.word_count == 2,
|
||||
"V_MUL_I32_I24 SDWA accepted reserved selectors or float modifiers");
|
||||
}
|
||||
}
|
||||
|
||||
void TestNewShaderRecompilerVop1SdwaNotDestination() {
|
||||
auto options = MakeCompileOptions(ShaderType::Pixel);
|
||||
|
||||
@@ -14784,6 +14817,7 @@ int main() {
|
||||
TestNewShaderRecompilerF64AluEncodings();
|
||||
TestNewShaderRecompilerVop1SdwaBfrev();
|
||||
TestNewShaderRecompilerVop1SdwaNotDestination();
|
||||
TestVop2SdwaMulI24Destination();
|
||||
TestNewShaderRecompilerScalarMemoryBindingDomains();
|
||||
// Opcode semantics and optimized SPIR-V are exercised by
|
||||
// ShaderRecompilerComputeTests; keep the distinct decoder contract checks
|
||||
|
||||
Reference in New Issue
Block a user