Earlier quoted context omitted.
It's not a successor, it's a derivative. And yes, if you're only targeting specific known hardware than you can and probably should optimize for it, but most distributions fully intend to be usable on very nearly any x86(_64) hardware so they can't do that.
It's also a bit less relevant when everything is so fast. I used Gentoo on a cheap-for-the-time Pentium 133MHz. Gentoo was basically the difference between a modestly pleasant system and an unusably slow system if I tried to run a standard still-compiled-for-386 distro on it. I've long since stopped worrying about it because on the systems I run, which are not top-of-the-line but aren't RPis either, it's not worth wo…
Someone’s Been Messing with My Subnormals
51–60 of 132 posts
Re: Someone’s Been Messing with My Subnormals
#52-Ofast isn't a good name for the option, but in GCC's defense the manual is pretty clear about all this, and there's no excuse for blindly turning on compiler options - they literally change the semantics of your code.
It's a quirk of language, that for compiler writers and other algorithmic people "fast" often means "ballpark, but damn quick". It's hard to come up with a similar name that isn't long.
The suggestion given elsewhere in these comments to call it "unsafe math" instead of "fast math" sounds good. It's nearly as short, and properly conveys the "you must know what you're doing" aspect of these flags. It's even better if you're used to Rust.
Re: Someone’s Been Messing with My Subnormals
#53Earlier quoted context omitted.
I wholeheartedly disagree. -Ofast Disregard strict standards compliance. ... There's strict standards compliance and then there's the crazy grab bag of code changes that is `-ffast-math`. Further, I'd say gevent can defensibly say that -ffast-math is okay for them given what the manual says: -ffast-math ... it can result in incorrect output for programs that depend on an exact implementation of IEEE or ISO rules/spec…
Well, how would you improve the docs? Both documentation entries seem reasonable to me. That said, I don't see why the -Ofast option even needs to exist, except backwards compatibility, as -ffast-math and the others can (and should IMO) be specified explicitly.
Re: Someone’s Been Messing with My Subnormals
#54Earlier quoted context omitted.
I wholeheartedly disagree. -Ofast Disregard strict standards compliance. ... There's strict standards compliance and then there's the crazy grab bag of code changes that is `-ffast-math`. Further, I'd say gevent can defensibly say that -ffast-math is okay for them given what the manual says: -ffast-math ... it can result in incorrect output for programs that depend on an exact implementation of IEEE or ISO rules/spec…
Well, how would you improve the docs? Both documentation entries seem reasonable to me. That said, I don't see why the -Ofast option even needs to exist, except backwards compatibility, as -ffast-math and the others can (and should IMO) be specified explicitly.
> -cl-unsafe-math-optimizations
> Allow optimizations for floating-point arithmetic that (a) assume that arguments and results are valid, (b) may violate IEEE 754 standard and (c) may violate the OpenCL numerical compliance requirements as defined in section 7.4 for single-precision floating-point, section 9.3.9 for double-precision floating-point, and edge case behavior in section 7.5. This option includes the -cl-no-signed-zeros and -cl-mad-enable options.
While it stops short of saying "this will likely break your code" (maybe because it doesn't have the nonlocal effects of -ffast-math), it makes it much more clear that this flag is generally unsafe and fragile, except under rather specific circumstances. Also, it is reasonably exact about what those circumstances are. I'm not sure -ffast-math is documented with enough precision for a programmer to even know whether it will break their code. Best you can do is try and see if the program still works.
Re: Someone’s Been Messing with My Subnormals
#55Re: Someone’s Been Messing with My Subnormals
#56[1] https://clang.llvm.org/docs/UsersManual.html#cmdoption-ffast...
Re: Someone’s Been Messing with My Subnormals
#57Earlier quoted context omitted.
What's missing is that it also affects linking, and results in this strange action-at-a-distance. Maybe disabling the linker part with -shared would be a reasonable compromise.
You're wrong, both the doc entry for -Ofast and the one for -ffast-math say that they can result in incorrect programs . Programs are produced by linking, so I don't see what other way to interpret this is possible.
Re: Someone’s Been Messing with My Subnormals
#58At a previous company I worked at, we had an issue with our software (Windows-based, written in a proprietary language) randomly crashing. After some debugging, we found that this happened whenever the user made some specific actions, but only if, in that session, the user had previously printed something or opened a file picker. The culprit was either a printer driver or a shell extension which, when loaded, changed…
Had to deal with this same issue when I had a program supporting plugins, DLLs compiled with Delphi would turn on all the floating point traps. Took a while to track down what was causing FP faults in comctl32.dll. It got so bad that I had to put in a popup dialog that would name and shame the offending DLL so the authors would fix their broken plugins. It's an ABI violation in Windows since the ABI specifically defi…
It is nice that diverse vendor-specific calling conventions and ABIs are less common these days.
Re: Someone’s Been Messing with My Subnormals
#59Earlier quoted context omitted.
I wholeheartedly disagree. -Ofast Disregard strict standards compliance. ... There's strict standards compliance and then there's the crazy grab bag of code changes that is `-ffast-math`. Further, I'd say gevent can defensibly say that -ffast-math is okay for them given what the manual says: -ffast-math ... it can result in incorrect output for programs that depend on an exact implementation of IEEE or ISO rules/spec…
Well, how would you improve the docs? Both documentation entries seem reasonable to me. That said, I don't see why the -Ofast option even needs to exist, except backwards compatibility, as -ffast-math and the others can (and should IMO) be specified explicitly.
Re: Someone’s Been Messing with My Subnormals
#60At a previous company I worked at, we had an issue with our software (Windows-based, written in a proprietary language) randomly crashing. After some debugging, we found that this happened whenever the user made some specific actions, but only if, in that session, the user had previously printed something or opened a file picker. The culprit was either a printer driver or a shell extension which, when loaded, changed…
Had to deal with this same issue when I had a program supporting plugins, DLLs compiled with Delphi would turn on all the floating point traps. Took a while to track down what was causing FP faults in comctl32.dll. It got so bad that I had to put in a popup dialog that would name and shame the offending DLL so the authors would fix their broken plugins. It's an ABI violation in Windows since the ABI specifically defi…