25x speedup by moving to switch table

This commit is contained in:
2023-09-20 11:34:46 +02:00
parent f911a78d84
commit 3f85ee0603
2 changed files with 584 additions and 568 deletions

View File

@@ -19,12 +19,12 @@ fun main(args: Array<String>) {
cpu.runState = CPU.RunState.RUNNING
cpu.pc = 0x80u
val start = System.nanoTime()
val ninsn = cpu.run(50000000)
val ninsn = cpu.run(600000000)
val end = System.nanoTime()
System.err.println("Halted at 0${cpu.pc.toString(8)}")
val time = (end - start).toDouble() / 1_000_000_000.0
println("Executed ${ninsn} in ${time}s: ${ninsn / time} i/s")
println("Executed ${ninsn} in ${time}s: ${ninsn / time / 1_000_000} MIPS")
} finally {
println("Exiting")
console.stop()

File diff suppressed because it is too large Load Diff