On Wed Jul 2 17:20:59 2025 +0000, Paul Gofman wrote:
FWIW I have an example of game (Re-Volt) which depends on ddraw.dll having x87 math. A game has a bug leaking x87 FP stack (same on Windows), which is mitigated by some (inessential in game context) viewport_activate() call (it is probably the same between implementation that setting a viewport does some amount of math operation). Which call hits the overflow instead of game and saves critical operations in game code from that. Proton was building 32 bit dlls as sse2 since start and this way it was discovered. Is it maybe possible to keep select dlls as x87? (I only know about such issue with ddraw)
Is the game calling into ddraw with a nonempty x87 stack? That not legal under stdcall abi.
But it wouldn't be the first time some random app violates the ABI rules.
In my opinion, it'd make more sense to keep math as SSE, and explicitly clear the x87 stack with asm at some select entry points. For example something like ``` fstsw ax again: test ax, 0x3800 je done fstp st(0) add ax, 0x0800 jmp again done: ```