View Single Post
Re: using -ffast-math for bot
Old
  (#4)
tschumann
Moderator
 
tschumann's Avatar
 
Status: Offline
Posts: 273
Join Date: Apr 2011
Location: Australia
Default Re: using -ffast-math for bot - 11-03-2022

Quote:
Originally Posted by RoboCop View Post
Personally...no and also
Code:
-O3
can be risky as well.

Also have you used
Code:
-static-libstdc++
to resolve the CXX ABI issue?
Hm okay - I haven't tested -O3
And not yet - I was having some trouble with VirtualBox continually corrupting my VM but not I have it sorted so I should reinstall Steam and try it.

Quote:
Originally Posted by The Storm View Post
The flag fast-math is breaking standard compliance regarding floating point calculations and some other mathematical operations. Basically you should get pretty close results regarding floating point numbers, but they will not be 100% correct. Depending on the code, this might not be a problem.

Other thing which is disabled are traps(unix/linux) and async exceptions(Windows) when you try to do some architecture specific invalid math operation like division by zero. In that case the program will directly crash(you will not be able to trap/catch the signal). So it really depends on your code and use cases.

About -O3. This optimization flag does not break the compliance, on the contrary it will follow it more strictly regarding undefined behavior stuff. I.e. if your code is well written and does not rely on undefined behavior working in "specific" way then you will get a free performance boost. However, in large codebases that do not use linters and high warning levels, this is usually not the case so it may seems like -O3 is breaking your code.
Ah I see - it did seem a little risky but I didn't know about the traps/exceptions bit.

Anyway, not that the extra speed is needed but I thought it was worth investigating.
  
Reply With Quote