Alyssa Rosenzweig
68f58e415f
OpcodeDispatcher: optimize cmpxchg masking
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-22 13:29:47 -04:00
Alyssa Rosenzweig
698abec25c
JIT: drop FindMSB zero handling
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-22 13:29:47 -04:00
Alyssa Rosenzweig
1578f5ed47
JIT: drop FindLSB masking
...
consequence of the UB
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-22 13:29:47 -04:00
Alyssa Rosenzweig
80d7b5a5c9
JIT: drop FindLSB zero handling
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-10-22 13:29:47 -04:00
Ryan Houdek
d7afcee622
AVX128: Fixes asome AVX bugs
...
vblendvps, vblendvpd, vpblendvb all broke because of failing to zext the
128-bit register correctly.
vinsertps broke because it was accidentally using the wrong
implementation.
Extends each of their unittests to handle these cases.
2024-10-18 15:49:25 -07:00
Paulo Matos
10ec6b63b6
Fix FXTRACT for 0.0 and -0.0
...
Fixes fxtract by returning the correct values for 0.0 and -0.0. We moved the split of fxtract into _sig and _exp, to the opcode dispatcher, to ease some comparisons.
Also removed the IR node F80XTRACTStack which is not needed anymore.
2024-10-17 09:05:10 +02:00
Paulo Matos
49087007be
Implement NZCVSelectV for selection on FPRs
...
Behaves like NZCVSelect for FPRs.
2024-10-17 08:42:50 +02:00
Ryan Houdek
4b945a9041
Merge pull request #4105 from pmatos/X87MMXState
...
Implement explicit state switch between X87 and MMX
2024-10-16 15:52:27 -07:00
Paulo Matos
0d53f2b45c
Implements explicit state switch between X87 and MMX
...
Fixes #3850
2024-10-15 17:58:53 +02:00
Ryan Houdek
e53f3969e9
FEXCore: Change yield implementation to use wfe
...
According to
https://github.com/rust-lang/rust/commit/c064b6560b7ce0adeb9bbf5d7dcf12b1acb0c807
turns out that the arm yield instruction is effectively a nop on all
reasonably new CPUs.
Instead switch over to wfe because it matches x86 `PAUSE` semantics more
closely.
2024-10-15 05:50:26 -07:00
LC
389ad737e6
Merge pull request #4103 from Sonicadvance1/shared_vdso_mmap
...
VDSOEmulation: Support loading VDSO thunk as shared
2024-10-10 01:25:12 -04:00
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
c740801ea5
VDSOEmulation: Support loading VDSO thunk as shared
...
Just requires a thread pointer check to be fixed in FEXCore.
This doesn't need unique pages to exist for the file mapping and can be
shared since it's readonly mapped.
2024-10-03 21:06:35 -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
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
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
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
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
Ryan Houdek
f3ba8cb33c
OpcodeDispatcher: Constexpr-ify DDD tables
2024-09-16 17:40:20 -07:00
Ryan Houdek
e714933b10
OpcodeDispatcher: Constexpr-ify H0F3A tables
2024-09-16 17:40:20 -07:00
Ryan Houdek
9a0f83cbf6
OpcodeDispatcher: Constexpr-ify H0F38 tables
2024-09-16 17:40:20 -07:00
Ryan Houdek
c4d30e8437
OpcodeDispatcher: Constexpr-ify SecondaryModRM tables
2024-09-16 17:40:20 -07:00