-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IR Interpreter #8725
IR Interpreter #8725
Conversation
|
||
// Let's try that one more time. We won't get back here because we toggled the value. | ||
js.startDefaultPrefix = false; | ||
// TODO ARM64: This crashes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it still? I think we want this, both here and in arm64jit.
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah, we do. Have not tried recently on ARM64.
I wonder. For this sequence:
Maybe we could just pretend there was no beql at all? It can be relatively common, and it's just skipping the break when the divisor is non zero. -[Unknown] |
Without this, Gods Eater Burst is horribly broken.
Without this, Gods Eater Burst crashes before going in game.
Add a pass to remove temporary regs
@unknownbrackets yes that should be safe. We could even do it before the IR to not have to create a new block, although ideally future multi-block compilation will optimize it away. |
These are often used following divs, and are harmless. Things get a bit easier if we just never compile them.
jit-ir: Optimize out beql; break; sequences
Also fixes off by one in ForceCheck.
We've removed on Windows too, and this fixes a build error.
Buildfixes + Travis caching
Thanks for the fixes @unknownbrackets , I'll merge this later today after a few more changes. Should get around to fixing the rounding as well, as this will produce broken saves in God Eater etc... |
So, this is different from the previous one that used MIPS instructions as an IR directly.
This translates code into a fast-to-interpret and easy-to-analyze IR (intermediate representation). Gets rid of delay slots and other MIPS silliness (though there's a small wart with "likely" branch instructions) while still keeping the MIPS register set and semantics, mostly. It then optimizes and caches these blocks like the real JITs and executes them.
This new IR should also suitable as a first step for things like more proper full-function compilation, SSA, etc. you'd probably want to first use this translator, run the constant propagation pass, then link multiple of these blocks together and lift into an AST, transform that into SSA, perform more optimizations and then do register allocation and code generation. Or something simpler :)
Anyhow, this is around 50% faster than the current interpreter already, so will be useful for non-JIT platforms like iOS, even if no more advanced compilation is done.
It's completely missing things like CPU floating point rounding mode for now.