mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-10 16:00:31 +02:00
In order to implement the SSE4.2 string instructions in a reasonable manner, we can make use of a fallback implementation for the time being. This implementation just returns the intermediate result and leaves it up to the function making use of it to derive the final result from said intermediate result. This is fine, considering we have the immediate control byte that tells us exactly what is desired as far as output formats go. Given that the result of this IR op will never take up more than 16-bits, we store the flags we need to set in the upper 16 bits of the result to avoid needing to implement multiple return values in the JIT. Also, since the IR op just returns the intermediate result, this can be used to implement all of the explicit string instructions with a single IR op. The implementation is pretty heavily documented to help make heads or tails of these monster instructions.