mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-08 20:00:17 +02:00
Due to how jit block tail padding is working, there's no real good way to determine the true "implementation size" of an instruction without the backend being aware of wanting to investigate it. Trying to inject another instruction, or another IR operation actually subtly changes codegen in a way that gives invalid results. The only real way to get around this is to inject a known token in to the instruction stream as we `ExitFunction`. So inject a `udf #0x420f`, and change the scanning behaviour to find the first one and cut everything else off afterwards. This already scoops out some code in some game blocks that were accidentally landing ExitFunction code in the json. This also has been tested to work with #4528 with its InstCountCI specific changes reverted. This means we don't need to play subtle padding tricks in the JIT to get the information we want in InstcountCI.