shader_ir: Add condition code helper
This commit is contained in:
parent
a58abbcfc4
commit
fbc67a0563
|
@ -321,6 +321,16 @@ OperationCode ShaderIR::GetPredicateCombiner(PredOperation operation) {
|
||||||
return op->second;
|
return op->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Node ShaderIR::GetConditionCode(Tegra::Shader::ConditionCode cc) {
|
||||||
|
switch (cc) {
|
||||||
|
case Tegra::Shader::ConditionCode::NEU:
|
||||||
|
return GetInternalFlag(InternalFlag::Zero, true);
|
||||||
|
default:
|
||||||
|
UNIMPLEMENTED_MSG("Unimplemented condition code: {}", static_cast<u32>(cc));
|
||||||
|
return GetPredicate(static_cast<u64>(Pred::NeverExecute));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) {
|
void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) {
|
||||||
bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src));
|
bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src));
|
||||||
}
|
}
|
||||||
|
|
|
@ -672,6 +672,9 @@ private:
|
||||||
/// Returns a predicate combiner operation
|
/// Returns a predicate combiner operation
|
||||||
OperationCode GetPredicateCombiner(Tegra::Shader::PredOperation operation);
|
OperationCode GetPredicateCombiner(Tegra::Shader::PredOperation operation);
|
||||||
|
|
||||||
|
/// Returns a condition code evaluated from internal flags
|
||||||
|
Node GetConditionCode(Tegra::Shader::ConditionCode cc);
|
||||||
|
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
inline Node Operation(OperationCode code, const T*... operands) {
|
inline Node Operation(OperationCode code, const T*... operands) {
|
||||||
return StoreNode(OperationNode(code, operands...));
|
return StoreNode(OperationNode(code, operands...));
|
||||||
|
|
Reference in New Issue