Emulating memory access: FEX-Emu devs on the x86-to-ARM memory model minefield
blaizedsouza · x · 2026-09-19
A Hackaday piece walks through how the FEX-Emu developers tackle memory access emulation when translating x86 code to ARM.
- Memory model mismatch: x86 offers strong Total Store Ordering guarantees, while ARM deliberately uses a weaker model for performance, so visibility of writes between cores isn't straightforward.
- Workarounds: emulators can translate x86 memory ops into ARM acquire/release, but doing it for nearly every reference is costly; newer ARM extensions like LRCPC help, and Apple Silicon added an x86-compatible TSO mode with little overhead.
- The ugly parts: x86's routine unaligned accesses and strong cache-line atomicity force FEX to catch alignment faults and dynamically patch barriers into translated code; split-lock operations are worst, sometimes requiring kernel excursions and running hundreds or thousands of times slower.
More from Infra
- Open models now outspend OpenAI on Vercel gateway, taking 78% of token volume — soumitrashukla9 · 2026-09-19
- Multi-GPU rig cooling debate: should fan curves be tuned per GPU under load — TheZachMueller · 2026-09-19
- ROCmFix: zero-dependency Python tool auto-fixes AMD ROCm setups and benches Vulkan vs HIP — pavlexlkl · 2026-09-19
- Three lines of bash escape Docker's Mac hypervisor: CVE-2026-77179 patched in Docker Desktop 4.88.0 — blaizedsouza · 2026-09-19
- Meta open-sources spmd_types: a type system to verify distributed PyTorch training correctness — austinvhuang · 2026-09-19
- Cosmos DB VLDB paper shows better scheduling can be worth $100M+ a year — blaizedsouza · 2026-09-19