Merge pull request #1713 from FernandoS27/bra-cc

Implemented BRA CC conditional and FSET CC Setting
This commit is contained in:
bunnei 2018-11-26 18:28:03 -05:00 committed by GitHub
commit 7684f4d0cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 4 deletions

View File

@ -3401,6 +3401,10 @@ private:
regs.SetRegisterToInteger(instr.gpr0, false, 0, predicate + " ? 0xFFFFFFFF : 0", 1, regs.SetRegisterToInteger(instr.gpr0, false, 0, predicate + " ? 0xFFFFFFFF : 0", 1,
1); 1);
} }
if (instr.generates_cc.Value() != 0) {
regs.SetInternalFlag(InternalFlag::ZeroFlag, predicate);
LOG_WARNING(HW_GPU, "FSET Condition Code is incomplete");
}
break; break;
} }
case OpCode::Type::IntegerSet: { case OpCode::Type::IntegerSet: {
@ -3682,11 +3686,17 @@ private:
"BRA with constant buffers are not implemented"); "BRA with constant buffers are not implemented");
const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; const Tegra::Shader::ConditionCode cc = instr.flow_condition_code;
UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T,
"BRA condition code used: {}", static_cast<u32>(cc));
const u32 target = offset + instr.bra.GetBranchTarget(); const u32 target = offset + instr.bra.GetBranchTarget();
if (cc != Tegra::Shader::ConditionCode::T) {
const std::string condition_code = regs.GetConditionCode(cc);
shader.AddLine("if (" + condition_code + "){");
shader.scope++;
shader.AddLine("{ jmp_to = " + std::to_string(target) + "u; break; }"); shader.AddLine("{ jmp_to = " + std::to_string(target) + "u; break; }");
shader.scope--;
shader.AddLine('}');
} else {
shader.AddLine("{ jmp_to = " + std::to_string(target) + "u; break; }");
}
break; break;
} }
case OpCode::Id::IPA: { case OpCode::Id::IPA: {