Ryan Houdek
e82d2c70c3
Merge pull request #4095 from alyssarosenzweig/opt/jit-time
...
speed up the JIT
2024-10-04 09:00:03 -07:00
Ryan Houdek
7dda75646d
OpcodeDispatcher: Fixes segment prefixing on vector element loadstores
...
These had completely forgotten to load segment prefixes on the element
loadstore operations. This had caused a crash on the Linux version of
"Halls of Tormet" (steamid 2218750).
This game has TLS vector data which it was loading with a movhps and hit
this path.
2024-10-03 20:51:37 -07:00
Alyssa Rosenzweig
44484a7b05
ConstProp: drop non-loadbearing opts
...
every pattern costs us JIT time, but not every pattern is doing anything.
especially with the flag rework of 2023-2024, a lot of patterns just don't make
sense anymore. constant folding in particular isn't too useful now.
only instcountci change is AAD which i'm contractually forbidden from caring
about.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 14:01:32 -04:00
Alyssa Rosenzweig
6ac7ba388f
ConstProp: rm leftover
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
36d0a67070
ConstProp: don't pool with a hash table
...
hash tables have high overhead! but individual blocks are small, so the
quadratic search is _much_ faster in practice. knocks 8% off node.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
0650dd1992
ConstProp: defer initialization
...
for blocks that don't need pooling. hopefully that's most of them.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
e2d58809ed
OpcodeDispatcher: rm dead
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
967a74cda9
OpcodeDispatcher: manually inline constants
...
less work for constprop.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
6cc6181261
OpcodeDispatcher/Flags: dont emit zero
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
f175b525f4
OpcodeDispatcher/Flags: inline constants
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
319f1e66cb
RegisterAllocationPass: eliminate a silly sxtb
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
d16969bdce
RegisterAllocationPass: simplify
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
c17858bfeb
RegisterAllocationPass: don't lookup sources
...
lot of silly chasing. not needed.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
ec24fc3d5d
RegisterAllocationPass: infer AnyRemapped
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
8819fa88d5
RegisterAllocationPass: avoid allocating remaps
...
shaves 6ms off.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 13:38:48 -04:00
Alyssa Rosenzweig
5aaa18e7a2
RegisterAllocationPass: remove Class->Allocated
...
not needed anymore.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 12:41:37 -04:00
Alyssa Rosenzweig
8a551b9e64
RegisterAllocationPass: rm leftover comment
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 12:41:37 -04:00
Alyssa Rosenzweig
aa548bd19c
RegisterAllocationPass: track if we need a remap
...
should be faster on average.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 12:41:37 -04:00
Alyssa Rosenzweig
9565f16d84
RegisterAllocationPass: simplify
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-02 12:41:37 -04:00
Paulo Matos
eb76dbdf4d
x87 small cleanups; NFC
2024-10-02 18:27:51 +02:00
Ryan Houdek
0b8b5108b9
Thunks: Moves AppendThunkDefinitions function to the frontend
...
Backend doesn't need access to this at all
2024-09-27 15:48:31 -07:00
Ryan Houdek
24211f8523
FEXCore: Move ThunksHandler class to FEXLoader
...
With as little changes as possible, because this is fairly tricky.
2024-09-27 15:48:31 -07:00
Ryan Houdek
94462e4dd0
Thunks: Temporarily add more TLS variables while moving
...
Prep commit to give Thunks the data it needs before moving.
2024-09-27 15:48:31 -07:00
Ryan Houdek
aa44668a41
FEXCore/Thunks: Moves the implementation of LinkAddressToGuestFunction to ContextImpl
...
No functional change, just moving code here.
2024-09-27 15:48:31 -07:00
Ryan Houdek
33a675624c
FEXCore/Thunks: Remove lock passing in AddCustomIREntrypoint
...
This was a legacy feature that is no longer necessary every since we
removed the frontend IRLoader.
2024-09-27 15:48:31 -07:00
LC
9100235041
Merge pull request #4077 from Sonicadvance1/frontend_informed_supportsavx
...
SignalDelegator: Let the frontend inform AVX support
2024-09-27 18:15:13 -04:00
Paulo Matos
f35a212f06
Fix FScale'ing zero that should return zero
...
Added tests will fail without the current patch.
This will properly check if we return the correct sign of zero.
2024-09-26 17:57:39 +02:00
Ryan Houdek
9b627e8743
FEXCore: Add global data directory support
...
Currently unused as all data still comes from local installs.
2024-09-24 01:17:43 -07:00
LC
9d6865f62d
Merge pull request #4073 from Sonicadvance1/constexpr_all_tables
...
OpcodeDispatcher: Constexpr-ify all the tables possible
2024-09-23 21:40:37 -04:00
LC
d547f2b8f2
Merge pull request #4080 from Sonicadvance1/improve_createthread_stack
...
Linux: Optimize CreateNewThread and HandleNewClone stack usage
2024-09-23 21:28:56 -04:00
Ryan Houdek
b5c9eb3463
Merge pull request #4081 from Sonicadvance1/smarter_meta_reload
...
Config: Be a bit smarter in ReloadMetaLayer
2024-09-23 04:52:25 -07:00
Ryan Houdek
00a3793814
Config: Be a bit smarter in ReloadMetaLayer
...
Reduces stack usage from ~1024 bytes to ~704 bytes and stops making a
bunch of string copies when they can just be pointers instead.
2024-09-23 04:21:10 -07:00
LC
9310ac59f4
Merge pull request #4076 from Sonicadvance1/remove_block_sampling
...
FEXCore: Remove BlockSamplingData
2024-09-22 19:18:37 -04:00
Ryan Houdek
58bcf691d6
Linux: Optimize CreateNewThread stack usage
...
We were creating a copy of the FEXCore::Core::CPUState object when we
didn't need to. We can pass the host thread's CPUState frame through to
the creation handlers since it's read-only (so modify it to be const).
We then just move the RAX and RSP setting to /after/ the CreateThread
handling instead of before.
This reduces stack usage from ~1392 bytes to ~80 bytes.
2024-09-22 10:45:21 -07:00
Alyssa Rosenzweig
33186b803d
JIT: fix scalar fmax on non-AFP platforms
...
NaN and signed zero handling was busted. Pretty nasty.
Fixes the following Vulkan CTS test run under emulation without thunking with a clang-built Mesa:
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.generated_args.denorm_nmax_nan_flush_to_zero_vert
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-22 12:14:21 -04:00
Alyssa Rosenzweig
bb1d7d0750
JIT: rm broken dead code
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-22 12:14:21 -04:00
Ryan Houdek
e7605c94dd
SignalDelegator: Let the frontend inform AVX support
...
Since the frontend has changed to informing the backend if AVX is
supported, there is no reason to feed that configuration back in to
SignalDelegator from the backend.
Instead inform the SignalDelegator directly in the frontend instead of
this now weird round-about path.
2024-09-22 08:23:06 -07:00
Ryan Houdek
ab5a10374b
FEXCore: Remove BlockSamplingData
...
This was a legacy interface that has long lost its implementation and
has long lost its use. This interface was similar to an older
Dolphin-Emu interface that was useful in that project, but isn't really
useful in a world with hundreds of threads and processes running at the
same time.
2024-09-22 08:04:39 -07:00
Ryan Houdek
dc2a26582f
FEXCore/OpcodeDispatcher: Fixes missing static on some tables
...
This was causing egregious stack usage in these two functions
2024-09-16 18:52:55 -07:00
Ryan Houdek
e6512fbe4d
X86Tables: Remove function wraps from VEX tables
2024-09-16 18:52:55 -07:00
Ryan Houdek
dbca441573
X86Tables: Remove function wraps from DDD table
2024-09-16 18:52:55 -07:00
Ryan Houdek
31adc953b7
X86Tables: Remove function wraps from H0F38/H0F3A table
2024-09-16 18:52:55 -07:00
Ryan Houdek
0dd7f5e2f7
X86Tables: Remove function wraps from SecondaryModRM table
2024-09-16 18:52:54 -07:00
Ryan Houdek
36556c4705
X86Tables: Remove function wraps from Group tables
2024-09-16 18:52:54 -07:00
Ryan Houdek
e29fac3f25
X86Tables: Remove function wraps from Secondary tables
2024-09-16 18:52:54 -07:00
Ryan Houdek
c984bdb42a
OpcodeDispatcher: Remove previous template instantiantions and use Bind
2024-09-16 18:52:54 -07:00
Ryan Houdek
2645b374a7
OpcodeDispatcher: Deduplicate InstallToTable helper
2024-09-16 18:52:54 -07:00
Ryan Houdek
10192eebe5
X86Tables: Remove EVEX Table
...
Still track the telemetry if EVEX is attempted, but remove the tables
which we won't be supporting.
2024-09-16 17:40:20 -07:00
Ryan Houdek
0e57cbf5b9
OpcodeDispatcher: Remove EVEX table install
...
This hasn't been necessary for quite a while as we handle
invalid/unsupported opcodes in the frontend now.
2024-09-16 17:40:20 -07:00
Ryan Houdek
c7413d96ad
OpcodeDispatcher: Constexpr-ify VEX & VEXGroup tables
2024-09-16 17:40:20 -07:00