felix86 26.12
Even more optimizations!
Cross-instruction optimizations
Our individual instruction handlers, at least on the integer side, are pretty well optimized at this point. However, there are many optimization opportunities across multiple instructions due to the differences in architectures that we are now starting to take advantage of.
Optimizing away zero-extensions
Emulating the integer x86 instructions on RISC-V with great performance is much harder than emulating them on AArch64. One of the many reasons is that AArch64 zero-extends for free on 32-bit operations. This matches x86 behavior. On the other hand, RISC-V 32-bit operations sign-extend, and ZEXT.W instructions need to be used. Over many emulated instructions, this adds up.
felix86 would previously almost always emit ZEXT.W instructions to zero-extend the top bits of a GPR after an operation. It will now not zero-extend a register if it gets zero-extended later and the upper bits are not used until then.
For example:
add eax, ebx
add eax, ecx
sub eax, edx
On felix86 26.11, this RISC-V code would be emitted:
ADDW rax, rax, rbx
ADD.UW rax, rax, zero
ADDW rax, rax, rcx
ADD.UW rax, rax, zero
SUBW rax, rax, rdx
ADD.UW rax, rax, zero
But with the aforementioned optimization, felix86 26.12 emits this:
ADDW rax, rax, rbx
ADDW rax, rax, rcx
SUBW rax, rax, rdx
ADD.UW rax, rax, zero
Known-width optimization
We also now track the known register width after some instructions. This helps optimize away zero-extends or 8-bit and 16-bit merges into registers.
For example, in this instruction sequence:
xor eax, eax ; rax = 0
cmp rbx, rcx
setc al
; assume an instruction that marks flags as dead follows...
On felix86 26.11, this RISC-V code would be emitted:
MV rax, zero
SLTU cf, rbx, rcx
ANDI ra, cf, 0xff(255)
ANDI rax, rax, 0xffffff00(-256)
OR rax, rax, ra
But on felix86 26.12, we emit this:
MV rax, zero
SLTU rax, rbx, rcx
Since we know that RAX is 0, there are no upper bits to merge into, so the ANDI+ANDI+OR can go away.
More fusions
INC/DEC/ADD/SUB are now fused with Jcc, similar to how CMP and TEST were.
Benchmarks
Benchmarks have improved quite a bit this month.
We are now at ~60% native speed on integer benchmarks.
Table view
Volatile metadata support
Volatile metadata is metadata in PE files which lets you know which memory accesses in the PE require TSO emulation. Without it, when TSO emulation is enabled we are forced to emit fences on every load and store, and choose to (hackily) not do so on stack and vector instruction accesses.
Making use of this metadata is currently tricky on RISC-V. The ARM64EC version of Wine can hook into an x86 recompiler like FEX and one of the benefits of this is that the emulator gets notified for the load addresses of the EXE and DLLs that are being emulated. Wine doesn’t have an official RISC-V port (and there’s no RISC-V ABI for Windows anyway), so we can’t get this info from Wine itself. Even if it did, without support in Proton we wouldn’t be able to make use of it for Windows games that are run through Steam.
Still, felix86 will now attempt to find the Windows executable and scan it for its volatile metadata entry. If found, it can skip emitting some fences during TSO emulation.
This feature can be enabled with FELIX86_VOLATILE_METADATA, and it’s off by default. It may improve performance in some games that require TSO and have this metadata.
Guest environment passes through exec
Previously, the guest environment would be fully separate from the host. This meant that if you enter the guest environment (e.g. via felix86 --shell), you wouldn’t be able to change the emulator options from within the emulated executable (e.g. by running FELIX86_ALWAYS_TSO=1 ./MyGame).
This is now possible, as FELIX86_* options will be passed from the guest environment to the host. A nice benefit of this is being able to set felix86 options in the Steam launch command.
Too lazy to use ~/.config/felix86/profiles/steam/*.toml? You can use the GUI instead
Support for SteamRT3 Steam client
This new Steam client would break something in our /proc/mountinfo emulation. This is now fixed and the new 64-bit Steam client works. Additionally, some Vulkan extensions were missing from our thunks that were used in newer versions of Proton. They are now added.
felix86 at SpacemiT DevCon 2026
felix86 was demoed at SpacemiT DevCon 2026, allowing attendees to play Hades on RISC-V hardware.
Hades on RISC-V, running via felix86
Thanks for reading this post.
If you like this project, please give us a star on GitHub: https://github.com/OFFTKP/felix86
