mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-03-02 09:29:13 +00:00
Add some performance hints to conditionals.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
412a44fafd
commit
8e4030a5aa
@ -162,14 +162,14 @@ namespace EightBit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t AM_AbsoluteX() {
|
uint8_t AM_AbsoluteX() {
|
||||||
if (Address_AbsoluteX())
|
if (UNLIKELY(Address_AbsoluteX()))
|
||||||
addCycle();
|
addCycle();
|
||||||
BUS().ADDRESS() = MEMPTR();
|
BUS().ADDRESS() = MEMPTR();
|
||||||
return getByte();
|
return getByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t AM_AbsoluteY() {
|
uint8_t AM_AbsoluteY() {
|
||||||
if (Address_AbsoluteY())
|
if (UNLIKELY(Address_AbsoluteY()))
|
||||||
addCycle();
|
addCycle();
|
||||||
BUS().ADDRESS() = MEMPTR();
|
BUS().ADDRESS() = MEMPTR();
|
||||||
return getByte();
|
return getByte();
|
||||||
@ -191,7 +191,7 @@ namespace EightBit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t AM_IndirectIndexedY() {
|
uint8_t AM_IndirectIndexedY() {
|
||||||
if (Address_IndirectIndexedY())
|
if (UNLIKELY(Address_IndirectIndexedY()))
|
||||||
addCycle();
|
addCycle();
|
||||||
BUS().ADDRESS() = MEMPTR();
|
BUS().ADDRESS() = MEMPTR();
|
||||||
return getByte();
|
return getByte();
|
||||||
|
@ -336,7 +336,7 @@ int EightBit::MOS6502::execute(uint8_t cell) {
|
|||||||
__assume(0);
|
__assume(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cycles() == 0)
|
if (UNLIKELY(cycles() == 0))
|
||||||
throw std::logic_error("Unhandled opcode");
|
throw std::logic_error("Unhandled opcode");
|
||||||
|
|
||||||
return cycles();
|
return cycles();
|
||||||
@ -480,7 +480,7 @@ void EightBit::MOS6502::ADC_d(uint8_t data) {
|
|||||||
void EightBit::MOS6502::Branch(int8_t displacement) {
|
void EightBit::MOS6502::Branch(int8_t displacement) {
|
||||||
const auto page = PC().high;
|
const auto page = PC().high;
|
||||||
PC().word += displacement;
|
PC().word += displacement;
|
||||||
if (PC().high != page)
|
if (UNLIKELY(PC().high != page))
|
||||||
addCycle();
|
addCycle();
|
||||||
addCycle();
|
addCycle();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user