InstcountCI: Changes how code size is calculated

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.
This commit is contained in:
Ryan Houdek committed 2025-04-23 12:56:46 -07:00
1 parent bf77fa4275
commit adcefe62cf
3 files changed
+33 -74

No files matched your search

@@ -43,6 +43,9 @@ struct HostFeatures {
bool SupportsAFP {};
bool SupportsFloatExceptions {};
// Flag if this is InstCountCI
bool IsInstCountCI {};
// MIDR information
// Also used for determining number of CPU cores for CPUID
fextl::vector<uint32_t> CPUMIDRs;