From df9a37f7984fa096f93806e9317e546933538dab Mon Sep 17 00:00:00 2001 From: Triang3l Date: Tue, 26 Apr 2022 23:08:31 +0300 Subject: [PATCH] [GPU] Ucode disasm: Fix exec formatting --- src/xenia/gpu/shader_translator_disasm.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/xenia/gpu/shader_translator_disasm.cc b/src/xenia/gpu/shader_translator_disasm.cc index 8c6440e3e..3abb25893 100644 --- a/src/xenia/gpu/shader_translator_disasm.cc +++ b/src/xenia/gpu/shader_translator_disasm.cc @@ -141,25 +141,27 @@ void DisassembleSourceOperand(const InstructionOperand& op, StringBuffer* out) { void ParsedExecInstruction::Disassemble(StringBuffer* out) const { switch (type) { case Type::kUnconditional: - out->AppendFormat(" {} ", opcode_name); + out->AppendFormat(" {}", opcode_name); break; case Type::kPredicated: out->Append(condition ? " (p0) " : "(!p0) "); - out->AppendFormat("{} ", opcode_name); + out->AppendFormat("{}", opcode_name); break; case Type::kConditional: - out->AppendFormat(" {} ", opcode_name); - if (!condition) { - out->Append('!'); - } - out->AppendFormat("b{}", bool_constant_index); + out->AppendFormat(" {} {}b{}", opcode_name, condition ? "" : "!", + bool_constant_index); break; } if (is_yield) { - out->Append(", Yield=true"); + if (type == Type::kConditional) { + // For `exec` or `(p0) exec` (but not `cexec`), "unexpected token ','" if + // preceded by a comma. + out->Append(','); + } + out->Append(" Yield=true"); } if (!clean) { - out->Append(" // PredicateClean=false"); + out->Append(" // PredicateClean=false"); } out->Append('\n'); }