mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Support: Simplify BranchProbability operators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207541 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4afab2afa8
commit
9c77098125
@ -59,15 +59,9 @@ public:
|
|||||||
bool operator<(BranchProbability RHS) const {
|
bool operator<(BranchProbability RHS) const {
|
||||||
return (uint64_t)N * RHS.D < (uint64_t)D * RHS.N;
|
return (uint64_t)N * RHS.D < (uint64_t)D * RHS.N;
|
||||||
}
|
}
|
||||||
bool operator>(BranchProbability RHS) const {
|
bool operator>(BranchProbability RHS) const { return RHS < *this; }
|
||||||
return RHS < *this;
|
bool operator<=(BranchProbability RHS) const { return !(RHS < *this); }
|
||||||
}
|
bool operator>=(BranchProbability RHS) const { return !(*this < RHS); }
|
||||||
bool operator<=(BranchProbability RHS) const {
|
|
||||||
return (uint64_t)N * RHS.D <= (uint64_t)D * RHS.N;
|
|
||||||
}
|
|
||||||
bool operator>=(BranchProbability RHS) const {
|
|
||||||
return RHS <= *this;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob);
|
raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user