video_core/control_flow: Provide operator!= for types with operator==

Provides operational symmetry for the respective structures.
This commit is contained in:
Lioncash 2019-07-16 11:59:57 -04:00
parent 1780e0e3d0
commit c1c89411da

View File

@ -25,27 +25,44 @@ struct Condition {
bool IsUnconditional() const { bool IsUnconditional() const {
return predicate == Pred::UnusedIndex && cc == ConditionCode::T; return predicate == Pred::UnusedIndex && cc == ConditionCode::T;
} }
bool operator==(const Condition& other) const { bool operator==(const Condition& other) const {
return std::tie(predicate, cc) == std::tie(other.predicate, other.cc); return std::tie(predicate, cc) == std::tie(other.predicate, other.cc);
} }
bool operator!=(const Condition& other) const {
return !operator==(other);
}
}; };
struct ShaderBlock { struct ShaderBlock {
u32 start{};
u32 end{};
bool ignore_branch{};
struct Branch { struct Branch {
Condition cond{}; Condition cond{};
bool kills{}; bool kills{};
s32 address{}; s32 address{};
bool operator==(const Branch& b) const { bool operator==(const Branch& b) const {
return std::tie(cond, kills, address) == std::tie(b.cond, b.kills, b.address); return std::tie(cond, kills, address) == std::tie(b.cond, b.kills, b.address);
} }
} branch{};
bool operator!=(const Branch& b) const {
return !operator==(b);
}
};
u32 start{};
u32 end{};
bool ignore_branch{};
Branch branch{};
bool operator==(const ShaderBlock& sb) const { bool operator==(const ShaderBlock& sb) const {
return std::tie(start, end, ignore_branch, branch) == return std::tie(start, end, ignore_branch, branch) ==
std::tie(sb.start, sb.end, sb.ignore_branch, sb.branch); std::tie(sb.start, sb.end, sb.ignore_branch, sb.branch);
} }
bool operator!=(const ShaderBlock& sb) const {
return !operator==(sb);
}
}; };
struct ShaderCharacteristics { struct ShaderCharacteristics {