Hacker News new | past | comments | ask | show | jobs | submit login

I'm not aware of any time GCC does that except due to C++'s promotion rules (e.g. float + double -> double), which is a problem with C++, not the compiler. I write deterministic software using floating point in C++.



See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35488/ https://github.com/numpy/numpy/issues/15237. I slightly misremembered what was happening. It's that on 32 bit systems, it wil replace 64 bit math with 80 bit math and double rounding which can produce non IEEE compliant results.


Yes, it's not replacing 64-bit math with 80-bit math, x87 just doesn't have proper 64-bit floats with correctly sized exponent-field and the flags here interpret float literals as "long double" if I remember correctly. It's just the 80-bit x87 problem referred to earlier in the thread. The workarounds mentioned in the github aren't actually enough. Compilers cannot do IEEE-compliant computation on x87 without relatively large performance penalties (I made a library that did it).

Fortunately that isn't a problem since SSE2.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: