Shader_IR: Implement Fast BRX and allow multi-branches in the CFG.

This commit is contained in:
Fernando Sahmkow 2019-09-23 22:55:25 -04:00 committed by FernandoS27
parent 2baf1e1ed4
commit 683008bc59
7 changed files with 260 additions and 132 deletions

View file

@ -1704,6 +1704,13 @@ public:
return expr.value ? decomp.v_true : decomp.v_false;
}
Id operator()(const ExprGprEqual& expr) {
const Id target = decomp.Constant(decomp.t_uint, expr.value);
const Id gpr = decomp.BitcastTo<Type::Uint>(
decomp.Emit(decomp.OpLoad(decomp.t_float, decomp.registers.at(expr.gpr))));
return decomp.Emit(decomp.OpLogicalEqual(decomp.t_uint, gpr, target));
}
Id Visit(const Expr& node) {
return std::visit(*this, *node);
}