|
|
|
|
|
by haberman
4763 days ago
|
|
Very nice! I wouldn't have thought to use flex to recognize optimizable patterns. :) It crashes for me on OS X but I'll have to try it on Linux. You may have tried this already, but where you have: mov al, byte [PTR]
Usually you want to write this instead to avoid a partial register stall (also in case there's junk sitting in the register). movzx eax, byte [PTR]
|
|
Partial register stalls are where you write part of the register, then read the full register:
But I am emitting this: So there's no stall.I got jit4 about as far as is reasonable for a single-pass compiler, but I intend to implement a proper BF->IR->ASM compiler to implement some more complex multi-pass optimizations I have in mind.