Add branch hint attributes to a couple branches

This commit is contained in:
Billy Laws 2022-09-29 20:25:31 +01:00
parent b310b99bdc
commit 2cdf6c1fe6
2 changed files with 4 additions and 3 deletions

View File

@ -150,7 +150,7 @@ namespace skyline::dirty {
*/ */
void MarkDirty(size_t index) { void MarkDirty(size_t index) {
auto &state{states[index]}; auto &state{states[index]};
if (state.type == BindingState::Type::None) { if (state.type == BindingState::Type::None) [[likely]] {
return; return;
} else if (state.type == BindingState::Type::Inline) { } else if (state.type == BindingState::Type::Inline) {
*state.inlineDirtyPtr = true; *state.inlineDirtyPtr = true;

View File

@ -78,8 +78,9 @@ namespace skyline {
*/ */
const SegmentType &operator[](size_t index) const { const SegmentType &operator[](size_t index) const {
auto &l2Entry{level2Table[index >> L2Bits]}; auto &l2Entry{level2Table[index >> L2Bits]};
if (l2Entry.valid) if (l2Entry.valid) [[likely]]
return l2Entry.segment; return l2Entry.segment;
else
return level1Table[index >> L1Bits]; return level1Table[index >> L1Bits];
} }