Open chibinz opened 3 years ago
Similar to the idea of parse-generator, could we come up with some sort of algorithms that take bit patterns (00101...1 where ... means dont care) as input, and automatically generate a optimal decoder table?
Potential issue that I could think of right now:
Currently the dispatch is written manually, first bits 27 - 25, then bit 24 -21, and optionally bits 7 - 4 for arm mode, and bits 15 - 11 for thumb mode. While the cpu is really not the bottle neck, other emulator writers seemed to agreed upon using 12 bits for arm opcode dispatching. Const generics are useful eliminating branches at compile time. Right now it's only available in rust nightly, and is scheduled to stablize in version 1.51, March 25. I feel a bit reluctant to switch tool chain.