Am Montag, 31. Jänner 2022, 01:14:25 EAT schrieb Fabian Maurer:
Hello wine-devel,
attaching a patch that works around a floating point issue, this is how they do it on otya128/winevdm, the win16 wine fork. Is this the correct way to do it, or why does Wine code do what it does?
A while back (circa 2019 I think) I spent some spare time learning about Win16 and came across floating point exceptions. Wine has pretty much no handling of float exceptions. To make matters worse, new-ish CPUs have bugs / features that break things. I think Sandy Bridge and newer Intel CPUs set the %cs segment to 0 in fxrstor. That breaks a pile of Win16 applications even when run inside a virtual machine (but not when run inside a full CPU emulator).
Netscape 4 is the application where I came across the problem. Microsoft has some floating point sample applications that also show the issue.
So to answer your question: I don't really know, but I suspect the patch just hides the real problem by luck. The correct thing would be to bring the Win16 float exception handling code from winevdm back to Wine. I don't know how correct it is though. And on top of that try to find workarounds for whatever CPU errata there are nowadays :-/