mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-13 07:00:40 +02:00
Inspired from: https://github.com/dotnet/runtime/issues/8072 Currently FEX is /very/ heavy handed with our backpatching where we wrap every backpatched loadstore with `dmb ish`. This can be relaxed slightly according to the linked issue. For TSO load instructions the instruction sequence changes to: ldr <args>; dmb ld; <-- Slightly less strict dmb For TSO store instructions the instruction sequence changes to: dmb ish; <-- Still the all encompassing dmb str <args>; For backpatching loadstores this does the same thing where only one side needs the nop and it uses the same instruction sequence when backpatched. The minor change is that on load backpatching, we are no longer backing up a single instruction, instead just re-executing the instruction we patched directly. Took a long time to come back to this (Last looked in August 2020). Previously when I was implementing this idea it didn't work, but that was because our CompareExchange operation was broken back then. With the CAS now, it should just work.