mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-08-14 19:27:33 +00:00
Couple of small changes in LIKELY/UNLIKELY usage.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -297,7 +297,7 @@ int EightBit::Intel8080::execute(uint8_t opcode) {
|
|||||||
|
|
||||||
execute(x, y, z, p, q);
|
execute(x, y, z, p, q);
|
||||||
|
|
||||||
if (cycles() == 0)
|
if (UNLIKELY(cycles() == 0))
|
||||||
throw std::logic_error("Unhandled opcode");
|
throw std::logic_error("Unhandled opcode");
|
||||||
|
|
||||||
return cycles();
|
return cycles();
|
||||||
@@ -416,13 +416,13 @@ void EightBit::Intel8080::execute(int x, int y, int z, int p, int q) {
|
|||||||
decrement(f, operand);
|
decrement(f, operand);
|
||||||
R(y, a, operand);
|
R(y, a, operand);
|
||||||
addCycles(4);
|
addCycles(4);
|
||||||
if (y == 6)
|
if (UNLIKELY(y == 6))
|
||||||
addCycles(7);
|
addCycles(7);
|
||||||
break;
|
break;
|
||||||
} case 6: // 8-bit load immediate
|
} case 6: // 8-bit load immediate
|
||||||
R(y, a, fetchByte());
|
R(y, a, fetchByte());
|
||||||
addCycles(7);
|
addCycles(7);
|
||||||
if (y == 6)
|
if (UNLIKELY(y == 6))
|
||||||
addCycles(3);
|
addCycles(3);
|
||||||
break;
|
break;
|
||||||
case 7: // Assorted operations on accumulator/flags
|
case 7: // Assorted operations on accumulator/flags
|
||||||
@@ -461,11 +461,11 @@ void EightBit::Intel8080::execute(int x, int y, int z, int p, int q) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: // 8-bit loading
|
case 1: // 8-bit loading
|
||||||
if (z == 6 && y == 6) { // Exception (replaces LD (HL), (HL))
|
if (UNLIKELY(z == 6 && y == 6)) { // Exception (replaces LD (HL), (HL))
|
||||||
halt();
|
halt();
|
||||||
} else {
|
} else {
|
||||||
R(y, a, R(z, a));
|
R(y, a, R(z, a));
|
||||||
if ((y == 6) || (z == 6)) // M operations
|
if (UNLIKELY((y == 6) || (z == 6))) // M operations
|
||||||
addCycles(3);
|
addCycles(3);
|
||||||
}
|
}
|
||||||
addCycles(4);
|
addCycles(4);
|
||||||
@@ -500,7 +500,7 @@ void EightBit::Intel8080::execute(int x, int y, int z, int p, int q) {
|
|||||||
UNREACHABLE;
|
UNREACHABLE;
|
||||||
}
|
}
|
||||||
addCycles(4);
|
addCycles(4);
|
||||||
if (z == 6)
|
if (UNLIKELY(z == 6))
|
||||||
addCycles(3);
|
addCycles(3);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
Reference in New Issue
Block a user