mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-08 19:00:18 +02:00
If we const-prop the required functions and leafs then we can directly encode the CPUID information rather than jumping out of the JIT. In testing almost all CPUID executions const-prop which function is getting called. Worst case that I found was only 85% const-prop rate. This isn't quite 100% optimal since we need to call the RCLSE and Constprop passes after we optimize these, which would remove some redundant moves. Sadly there seems to be a bug in the constprop pass that starts crashing applications if that is done. Easily enough tested by running Half-Life 2 and it immediately hitting SIGILL. Even without this optimization, this is stil a significant savings since we aren't jumping out of the JIT anymore for these optimized CPUIDs.