handle systems that do not support denormalized floats #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A feature of gcc on Intel platforms is to enable the FTZ and DAZ features available on modern Intel CPUs. Those features convert denormal floating point values to zero to avoid expensive and slow exception handling inside the CPU. Details can be found at https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/floating-point-operations/set-the-ftz-and-daz-flags.html
Some Linux distributions now started to make this flag the compiler default and build the standard runtime libraries with this switch turned on. On those systems the definition of least---float evaluates to zero, no longer adhering to their specification, and as such failing test cases relying on them. Compiling sbcl with this compiler feature explicitly turned off is not preventing this problem from happening since we use functions from libm that is built with this switch turned on and as such will apply the conversions nevertheless to our surprise.
Therefore this introduces a new feature "normalize-float" for systems with that behavior. This automatically gets switched on by an automated test. The test is designed to detect similar behavior also on non-Intel systems. The definitions of least---float are adapted accordingly.
This can be found at https://bugs.launchpad.net/sbcl/+bug/2002810 as well.