Ryan Houdek
4048faa54b
FEXCore/Frontend: Ensure instruction sizes account for sha256 in thunk op
...
Fixes the hashing mechanism from DiskCache.cpp, allowing it to properly
handle thunk relocations.
Fixes #5896
2026-09-02 14:32:08 -07:00
Justin Becker
34a87cc94c
Decoder: fix illegal LEA encoding
2026-07-27 15:48:35 -07:00
LC
ab4fb7b3ad
[SVE256] Ensure insertion behavior for AES operations on SSE
...
These slipped through, so now we can add tests for them to prevent that
from happening again.
2026-07-03 19:35:31 -04:00
LC
df41b85827
OpcodeDispatcher: Merge VPINSRB/VPINSRW handling
...
We can just pass the size through Bind instead of having two functions
that effectively do the same thing, only differing on element size.
2026-06-21 15:33:37 -04:00
LC
8989ce1766
[SVE256] Handle SSE insertions for PCMPESTRM/PCMPISTRM ops
...
See #3799
2026-06-19 18:53:50 -04:00
LC
f64d4c571b
[SVE256] Handle SSE insertions for MOVSHDUP/MOVSLDUP
...
See #3799
2026-06-17 20:38:58 -04:00
LC
daaa6ec129
[SVE256] Handle SSE insertions for aligned and unaligned moves
...
See #3799
2026-06-17 19:39:06 -04:00
LC
88afc22d5b
[SVE256] Handle SSE insertions for MOVNTDQA
...
See #3799
2026-06-17 19:38:57 -04:00
LC
634fbb5a73
[SVE256] Handle SSE insertions for Float->Int/Int->Float conversions
...
See #3799
2026-06-17 04:44:39 -04:00
LC
a0e8f1097f
[SVE256] Handle SSE insertions for PHMINPOSUW
...
See #3799
2026-06-17 01:21:19 -04:00
LC
32b11603d8
[SVE256] Handle SSE insertions for PMOVSX/PMOVZX ops
2026-06-17 00:04:03 -04:00
LC
c62805e86d
OpcodeDispatcher: Make use of Bind consistently
...
We had a few places that were using Bind, and a few other places
that were using specializations as a means to composing the instruction
tables. Instead, we can just use Bind consistently, which lets us tidy
up a bunch of the implementations (and gets rid of some unnecessary
codegen).
2026-06-16 15:07:59 -04:00
Ryan Houdek
1b58664541
X86Tables: Describe instructions that support LOCK prefix
2026-06-02 19:41:02 -07:00
Daniel Lu
5cce65cdfa
OpcodeDispatcher: Decode INVD and WBINVD through privileged op handling
2026-05-22 15:25:22 -07:00
Simon Scherer
ab14882761
FEXCore: Fix 2byte stack access for 0x66 PUSH/POP FS/GS
2026-04-27 15:21:11 -07:00
Ryan Houdek
2e6a7f869c
OpcodeDispatcher: Fixes nop encoded prefetch instruction
...
We had a bug where nop encoded prefetch instructions were getting
flagged as illegal instructions erroneously. Fix that and add a unittest
for ensuring execution.
Fixes `Devil May Cry 4`
2026-04-06 11:04:46 -07:00
Tony Wasserka
22faa58e0b
X86Tables: Use explicit type for SecondInstGroupOps definition
...
GCC considers it a "conflicting declaration" to use auto for a variable that
was already declared before.
2026-03-16 19:15:05 +01:00
Lioncache
c8f3772753
X87Tables: Handle aliases for FSTP
2026-02-26 19:08:48 -05:00
Lioncache
b046942a28
X87Tables: Handle aliases for FXCH
2026-02-26 17:44:12 -05:00
Lioncache
6909d49683
X87Tables: Add handling for FCOMP DE D0 aliases
...
Handles the single remaining alias for FCOMP.
2026-02-26 16:14:55 -05:00
Ryan Houdek
cf3c41acc7
FEXCore: Fixup ARPL implementation
...
Some subtle details were wrong in the implementation, and some minor
changes to be more optimal.
2026-02-10 14:29:32 -08:00
FrontMage
9bf9c00474
x86: implement ARPL (0x63) in 32-bit mode
2026-02-10 14:12:52 -08:00
FrontMage
51afcc5ca8
x87: fix dispatch table sizes after adding FCOM/FCOMP
2026-02-10 18:08:41 +08:00
FrontMage
7a0ed4c462
x87: support 0xDC D0/D8 FCOM/FCOMP st(i)
2026-02-10 18:08:41 +08:00
Tony Wasserka
ba2b0ef809
Enable automatic code formatting for X86Tables.h
2026-01-23 15:39:54 +01:00
Ryan Houdek
0b92d431f5
Frontend: Only decode REX if it is at the correct location
...
Otherwise it is a nop
2025-12-29 17:57:12 -08:00
Ryan Houdek
3025a10808
FEXCore: Revert literal optimization from #4884
...
This no longer does anything due to #5123
2025-12-22 10:00:55 -08:00
Billy Laws
2878583627
OpcodeDispatcher: Support relocated operand type variants
...
In order to support code caching of 32-bit libraries, any library-base
relative relocations on the guest must be transformed into FEX
relocations so e.g. absolute jumps or loads refer to the correct
location when the library is loaded at a different base address.
2025-12-22 16:19:02 +00:00
Ryan Houdek
d654f55c3c
OpcodeDispatcher: Move FEX reserved instruction
...
This now conflicts with an SMX instruction, so move it over to another
bytecode that is unlikely to be used.
2025-10-16 11:20:58 -07:00
Lioncache
7aa5bc0503
EnumUtils: Further simplify enum passthrough formatting
...
Turns out a simpler way was added to the docs at some point and I never
noticed.
Before:
text data bss dec hex filename
4159895 1471360 4336824 9968079 9819cf Bin/FEX
After:
text data bss dec hex filename
4157159 1471360 4336824 9965343 980f1f Bin/FEX
2025-10-07 01:52:05 -04:00
Lioncache
b7117b86ea
X86Tables: Remove unused LateInitCopyTable()
2025-10-06 15:04:36 -04:00
Ryan Houdek
b5d93bc4a0
Merge pull request #4928 from lioncash/passthru
...
EnumUtils: Add define for default passthrough formatting
2025-10-03 19:45:41 -07:00
Ryan Houdek
f45be1f59e
OpcodeDispatcher: Implement support for imm extrq/insertq
...
Fairly straightforward to implement, but not exciting in their
performance.
2025-10-03 13:05:43 -07:00
Lioncache
a0c2ce0068
EnumUtils: Add define for default passthrough formatting
...
Handles a normal case where printing an enum type as an integral value
is still desirable.
Mainly just a way to reduce boilerplate.
2025-10-03 14:21:19 -04:00
Ryan Houdek
3fa400bc55
Frontend: Improve DecodeInst size from 128 bytes to 80
...
We were paying a large cost per Literal type that we can special case
for the two class of instructions that use a 64-bit literal.
If we packed this would get to a further 62 bytes but probably not worth
it.
2025-09-12 16:07:01 -07:00
Ryan Houdek
90ea16325a
Frontend: Move a couple of members from DecodeInst
...
LastEscapePrefix doesn't need to be in DecodeInst, and we can have a
couple of flags for ForceTSO/DecodedSIB/DecodedModRM.
2025-09-12 15:37:18 -07:00
Lioncache
f9c15fa0a5
Frontend/OpcodeDispatcher: Remove unused headers
...
Removes assorted unused headers and forward declarations.
2025-09-09 00:28:05 -04:00
Ryan Houdek
bd0cae9298
Merge pull request #4825 from bylaws/unityomg
...
Frontend: Force acq/rel semantics for known Unity ringbuffer offsets
2025-09-06 17:09:13 -07:00
Ryan Houdek
6ae94581bb
Merge pull request #4821 from bylaws/monof
...
Frontend: Fix tailcall handling when mono hacks are enabled
2025-09-06 16:51:08 -07:00
Billy Laws
28a1c28cb4
Frontend: Track the raw opcode and use for mono tailcall detection
...
This path was nonfunctional prior to this, as the jump is a group-opcode
which wouldn't be picked up (as Op is rewritten in NormalOp).
2025-09-02 22:42:02 +01:00
Billy Laws
fcba49768c
Frontend: Force acq/rel semantics for known Unity ringbuffer offsets
...
Unity games crash with TSO disabled due to the SPSC GfxDevice
ThreadedStreamBuffer read/write pointer updates missing acq/rel
semantics. Rather than attempting to use heuristics to match cases like
this, which could be overzealous and hit more accesses than necessary, just
target the problem directly as this is consist across 32/64 bit Unity versions
for at least the past 10 years. Gate this behind the existing Unity mono
hacks to avoid false-positives in non-Unity games.
2025-09-02 22:05:22 +01:00
Lioncache
1f756fb386
General: Replace usages of .at(0) with .data() where applicable
...
This is generally more straightforward in cases where bounds checking isn't necessary.
2025-09-02 13:03:37 -04:00
Ryan Houdek
add54b8089
X86Tables: Convert AVX tables to constexpr
...
One set of tables for 128-bit and one set of tables for 256-bit.
This one took a bit longer since I needed to convert a few handlers over
to `Bind`. With this all of our x86 tables are costexpr so they end up
in RO mapped memory which is great.
2025-08-27 14:55:10 -07:00
Ryan Houdek
80cacc462e
X86Tables: Move x87 tables to be constexpr
2025-08-27 12:24:25 -07:00
Ryan Houdek
1a2b2f8870
X86Tables: Move Second ModRM table to be constexpr
2025-08-27 12:24:25 -07:00
Ryan Houdek
e8c576047f
X86Tables: Moves Base ops to be constexpr
2025-08-27 12:24:25 -07:00
Ryan Houdek
995d3152eb
X86Tables: Convert Secondary tables to constexpr
2025-08-27 12:24:25 -07:00
Ryan Houdek
ddc40cc273
X86Tables: Converts PrimaryGroup table to constexpr
2025-08-27 12:24:25 -07:00
Ryan Houdek
5ee311b831
X86Tables: Converts H0F3A table to constexpr
2025-08-27 12:24:24 -07:00
Ryan Houdek
ea90296e22
X86Tables: Converts H0F38 table to constexpr
2025-08-27 12:24:24 -07:00