Read the blog post at FEX-Emu's Site!
"Kept you waiting, huh?" - Solid Snake, professional sneaky man.
We're not going to sugar coat it, this last month was very busy and time just kept moving faster than expected.
A ton of work landed this month so we're going to just need to pick some of the highlights. Let's hop in!
Jit work you say?
A bunch of random bug fixes and performance improvements landed this month. Primary things here are that there were various behaviour fixes for some
instructions. Undefined and defined flag fixes that FEX was messing up, some deadlock fixes, handling more cases that were previously asserts. There
was an optimization for the PMULHRSW instruction family that increased some Geekbench benchmark numbers. Surely some game uses it somewhere to notice
the 2x perf uplift. We also made the "full" self-modifying-code detection faster, which is used for Unity games in some instances. So that's nice.
We also reduced some lock-contention in the JIT so multiple threads jitting code at the same time should block each other less frequently.
There's more of course but come on we gotta go!
Removed hacky unixlib fallbacks
For Wine we had some fallbacks for when our unixlib helper library wasn't installed. This last month we removed these fallbacks and require the
unixlib for these features now. Currently all of these features technically are optional, so it isn't a big deal if unixlib is missing. We also
discovered when removing these that we would accidentally be doing Windows syscalls if someone was replacing XTAJIT/Prism with FEX. Oops! Well those
fallbacks are removed so that won't happen anymore at least.
Disk-cache as an option
Through an absolute flurry of commits this last month, disk caching of JIT code is in a place where we think it can be tinkered with more readily.
What does disk caching mean for FEX? Once the configuration option is enabled; any code that FEX's JIT generates is cached to the disk in a FOZ file
format database. Then when FEX needs to JIT code subsequently, it will attempt to look up code from that FOZ database first before going through the
work of actually jitting. This database lookup happens during the initial run but also subsequent runs of FEX to reduce JIT stutter when running
games.
Some downsides today are that if the disk caching is enabled on applications that JIT code itself, then the cache can technically grow unbounded. We
haven't yet implemented any caching size limits or any way to remove stale cache entries. Additionally if any of the file contents change, there might
be conflicts today where the cache doesn't get invalidated in those instances. So there's still some growing pains but we don't think these are a
showstopper for tinkering today. To give it a try you can set the `FEX_DISKCACHE=1` environment variable or the `"DiskCache": "1"` json option
to enable everything. This works with both the FEX linux interpreter program and also WINE, it maybe be a bit more stable in WINE for now. The cache
files will end up in WINE's %APPDATA% directory or $HOME/.cache/fex-emu/ by default. So if you are running out of space make sure to delete
those directories to recover some space!
Let us know how it goes and if there are any games that completely break when this feature is enabled! We'll be spending continued effort making this
feature better as time goes on.
Oh right, the new logo
If you missed the random post, we got a new logo! You'll find that it's not dramatically different, but the rainbox gear has definitely changed!
Raw Changes
FEX Release FEX-2609
-
ARMEmitter
- Fill in bfloat API holes (52cc568)
-
CMake
- Fix MINGW compilation under ArchLinux (fd141ed)
-
CPUID
- Adds a few new bits (92e43c2)
-
Common
- Config
- Fixes Cache directory when
STEAM_COMPAT_SHADER_PATHon Win32 (e3c6b37)
- Fixes Cache directory when
- Config
-
Config
-
Core
- Adds more validation around pool buffer ownership (e7836f2)
-
Decoder
- fix illegal LEA encoding (a3d609e)
-
DiskCache
- support multiple entries per lookup key (566a5e2)
- also patch branches for more anon hit rate (023d0cd)
- detect inline data, hash around it and patch it on Lookup (42c6632)
- key fixes (50e6eee)
- SMC regression fixes (a77d00a)
- optional validation-only mode (6ff7e82)
- initial anon caching (e010e8a)
- disable with thunk relocs for now (5a68359)
- hash guest code according to its real extents (ab6e675)
- Lookup optimizations (8cf2bf7)
- on Linux, block signals in Writer thread (ef5439e)
- get rid of more extra copies/allocs on Lookup (dea5c62)
- Apply relocations from disk blob (e1d8881)
- use memory-mapped IO for reads when possible (fd180a1)
- clean up bucket key building a bit (0814780)
- bucket/key bookkeeping (9d4b493)
- make Writer thread low-priority (c9b23eb)
- add some SHM stats (44f69f4)
- offload Store to a WorkQueueThread (b2b6b26)
-
External
- Update fmt to upstream master to fix building with LLVM 23 (5a4f84c)
-
Externals
- Update vixl (cf6da6a)
-
FEX
- Only fsync on assert (b563703)
-
FEXCore
-
Support ThreadRemoveCodeEntry as relocatable (c4c82f2)
-
Removes syscall optimization (a6e74cd)
-
Fixes ever shrinking JIT code buffer (fa9bbf0)
-
prevent deadlock when branching to MAX_UINT64 (9377bac)
-
Adds a lock-free atomic bitset that supports contiguous range allocations (adea3e4)
-
Fixes SourceOutline description (a4e04dd)
-
Allocator
- Support naming VMA regions from rpmalloc (84fabf4)
-
Config
-
Context
- Removes InitialRIP/RSP from CreateThread (c3769a6)
-
Frontend
- Ensure instruction sizes account for sha256 in thunk op (55c80e6)
-
HostFeatures
- Adds HostFeatures hashing support (7614e48)
-
SharedCodeBufferManager
- Pivot what tracks memory allocations (bc69693)
-
Utils
- Implements a new atomic segmented bitmap allocator (f386c62)
-
-
FEXUnixlib
- Removes unused variable/warning. (ff4da8a)
-
Frontend
-
HostFeatures
- Fixes crash in mingw build (4ed80fd)
-
InstCountCI
- Enforce DiskCache version matching (e17fdf9)
-
JIT
- Fixes some alignment logic (bf30f6a)
-
LookupCache
-
MOVVectorUnalignedOp
- Fix same-register MMX writes being treated as a Nop (7187bc0)
-
Misc
- Adds some missing headers (7966bfb)
-
OpcodeDispatcher
-
Scripts
- Fixes failure in doc_outline_generator (69fe852)
-
SharedCodeBufferManager
-
Steam
- CompatTool
- Become more picky about configs (9618b5a)
- CompatTool
-
Thunks
- Adds some new PV paths (71afe47)
-
UnixLib
- Removes old non-unixlib handling (51c241d)
-
Utils
- File
- Properly handle move assignment/construction (00b1249)
- File
-
WOW64
- Update frame state ESP and EIP before unlocking context for syscall (063af71)
-
Win32
- Actually set app config path and name (c772c0e)
-
Windows
-
Use NtRaiseException to raise guest exception (310c250)
-
Fix syscall regression (7fe7c39)
-
Split CMAKE_CXX_FLAGS before passing to execute_process (d04ad79)
-
Handle interrupt 3 in HandleGuestException (c1e9d19)
-
Handle 0x2c interrupt in HandleGuestException (f42dc71)
-
CRT
- Add printf and puts stubs (73ab3bc)
-
-
Wine
- Change behaviour around SMC and NtReadFile (ec63be4)
-
Misc
- Mark tag word valid for FST ST(0) self-store (7052f91)
- Mark both operands valid in the tag word for FXCH (a454845)
- System_Tests: Enable WFET/WFIT tests (8243b93)
- Clear C1 for fdecstp and fincstp (cfef3d2)
- Faster translation for *PMULHRSW (8346920)
- Preserve previous value of IE exception flag (511c45c)
- Resolve symlinks continuously until we find the actual binary name. (433091c)
- Scripts/fit_native: Classify Oryon-1/3 (73dc3b3)
- Fix pf2id overflow saturation (62c9c13)
- Fix PFACC producing wrong results due to missing MMX-sized path in VFAddP (fca23d8)
- Fix pf2iw to saturate on 32-to-16-bit truncation (3a179a3)
- FCOMI fails to clear OF, SF, AF (2a76d3b)
- code-format-helper: More dependabot upgrades (9617284)
- Avoid double offset relocations (f0b4501)
- Disk Cache initial implementation (f50279a)
- clang-format: Slight whitespace difference (7075377)
- Fix warnings in llvm-mingw builds (f6d20a1)
- Fix precision loss for F64 to i32 conversion (c171c06)
-
thunkgen
- satisfy the clang 22 ComplierInstance VFS invariant. (9686454)
-
unittests
-
x87StackOptimizationPass
- Generalize ST(0) tag invalidation on pop (ac6be77)