You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike the value-changing optimizations (-ffast-math), the -fno-math-errno is widely considered a good idea (see e.g. here for a nice write-up).
The C++ Standard doesn't even guarantee math functions set errno in the first place, and, as far as I can tell, PPSSPP does not check the math errno in any way (I'm surprised errno is used as much as it is, in other places).
The most obvious difference is that sqrtfcompiles to sqrtss xmm0, xmm0 rather than
pxor xmm1, xmm1
ucomiss xmm1, xmm0
ja .L10
sqrtss xmm0, xmm0
ret
.L10:
jmp sqrtf
but some other functions are also affected (lrintf, etc.). The example is x86, but ARM is similar.
Unfortunately, there does not seem to be a similar option for MSVC.
Adding -fno-math-errno to CMakeLists.txt did not cause any obvious problems, and seems to improve performance a bit, when tested in Ridge Racer on SoftGPU on my system (or it might have been noise).
Yeah, I don't really see a downside. In theory, we might someday want to more accurately (read: at all) update the fcr31 exception bits, but I don't think I've ever seen a game read them. Doesn't mean it can't happen, though...
-[Unknown]
fp64
added a commit
to fp64/ppsspp
that referenced
this issue
Sep 16, 2023
Platform
Linux / BSD
Compiler and build tool versions
GCC 10.2.1
Operating system version
GNU/Linux
Build commands used
./b.sh
What happens
Unlike the value-changing optimizations (
-ffast-math
), the-fno-math-errno
is widely considered a good idea (see e.g. here for a nice write-up).The C++ Standard doesn't even guarantee math functions set
errno
in the first place, and, as far as I can tell, PPSSPP does not check the math errno in any way (I'm surprisederrno
is used as much as it is, in other places).The most obvious difference is that
sqrtf
compiles tosqrtss xmm0, xmm0
rather thanbut some other functions are also affected (
lrintf
, etc.). The example is x86, but ARM is similar.Unfortunately, there does not seem to be a similar option for MSVC.
Adding
-fno-math-errno
to CMakeLists.txt did not cause any obvious problems, and seems to improve performance a bit, when tested in Ridge Racer on SoftGPU on my system (or it might have been noise).Planning to add it, if there are no objections.
Note: it apparently also messes with errno of malloc, which should not be problematic.
PPSSPP version affected
v1.16-4-gd4365c6ae
Last working version
No response
Checklist
git submodule update --init --recursive
before building.The text was updated successfully, but these errors were encountered: