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.

BenchmarksHigher is better, compared with native performance and showing improvement since 26.11
felix86 26.11felix86 26.12Native
7-Zip compression+10.8% since 26.11
felix86 26.11 2,04767%
felix86 26.12 2,26874%
Native 3,062MIPS
7-Zip decompression+22.2% since 26.11
felix86 26.11 1,88761%
felix86 26.12 2,30674%
Native 3,117MIPS
Coremark+23.7% since 26.11
felix86 26.11 7,88052%
felix86 26.12 9,75065%
Native 15,017iter/s
Dhrystone 2.1+4.9% since 26.11
felix86 26.11 3,27749%
felix86 26.12 3,43951%
Native 6,722DMIPS
OpenSSL SHA-256+73.7% since 26.11
felix86 26.11 63.037%
felix86 26.12 109.464%
Native 169.8MB/s
OpenSSL AES-256-GCM+31.2% since 26.11
felix86 26.11 28.539%
felix86 26.12 37.451%
Native 73.8MB/s
OpenSSL RSA-2048+12.5% since 26.11
felix86 26.11 80.347%
felix86 26.12 90.353%
Native 171.3sign/s
SQLite speedtest1+15.6% since 26.11
felix86 26.11 2.135%
felix86 26.12 2.440%
Native 5.9runs/min
Stockfish+22.7% since 26.11
felix86 26.11 45.047%
felix86 26.12 55.258%
Native 95.1knodes/s
x264 encode+22.7% since 26.11
felix86 26.11 4.146%
felix86 26.12 5.056%
Native 8.9fps
zstd -3 compression+9.0% since 26.11
felix86 26.11 123.270%
felix86 26.12 134.376%
Native 176.7MB/s
zstd -3 decompression+5.3% since 26.11
felix86 26.11 351.763%
felix86 26.12 370.567%
Native 556.8MB/s
Table view
Benchmark Version Unitfelix86 26.11felix86 26.12NativeChange since 26.11% of native
7-Zip compression 26.02 MIPS2,0472,2683,062+10.8%67% → 74%
7-Zip decompression 26.02 MIPS1,8872,3063,117+22.2%61% → 74%
Coremark v1.01 iter/s7,8809,75015,017+23.7%52% → 65%
Dhrystone 2.1 2.1 DMIPS3,2773,4396,722+4.9%49% → 51%
OpenSSL SHA-256 4.0.1 MB/s63.0109.4169.8+73.7%37% → 64%
OpenSSL AES-256-GCM 4.0.1 MB/s28.537.473.8+31.2%39% → 51%
OpenSSL RSA-2048 4.0.1 sign/s80.390.3171.3+12.5%47% → 53%
SQLite speedtest1 3.53.4 runs/min2.12.45.9+15.6%35% → 40%
Stockfish sf_18 knodes/s45.055.295.1+22.7%47% → 58%
x264 encode b35605ac fps4.15.08.9+22.7%46% → 56%
zstd -3 compression v1.5.7 MB/s123.2134.3176.7+9.0%70% → 76%
zstd -3 decompression v1.5.7 MB/s351.7370.5556.8+5.3%63% → 67%

We are now at ~60% native speed on integer benchmarks.

Progress over releasesHigher is better, shown as % of native speed for the 10 benchmarks measured in previous releases
Geometric mean Lowest to highest benchmark
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

Written on December 1, 2026