mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 15:00:53 +02:00
For 128-bit divides, we can very quickly check at runtime if we can avoid the long divide and just do a 64-bit divide. For unsigned just check if the top bits are all zero. For signed just check if the top bits match bit 63 of the lower bits. Additionally, keep the long divide handlers inside of the dispatcher. This keeps the majority of the code bloat out of the code block itself, significantly reducing block size for something doing these divides. Also a fairly large icache improvement from this. Hard performance number improvements here are hard to get since it heavily depends on the application, also only occurs on x86-64. Seems to have helped FTL and Dead Cells performance quite a bit though.