handle systems that do not support denormalized floats

Bug #2002810 reported by Robert Schiele
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

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.

Revision history for this message
Robert Schiele (rschiele) wrote :
tags: added: arch-x86 floating-point
Revision history for this message
Robert Schiele (rschiele) wrote :

Updated the patch to fix the problem instead of just mark the tests as expected failure.

description: updated
summary: - tests incompatible with FTZ and DAZ
+ handle systems that do not support denormalized floats
tags: removed: arch-x86
Revision history for this message
Robert Schiele (rschiele) wrote :

New version of the patch including an automated test.

description: updated
Revision history for this message
Robert Schiele (rschiele) wrote :

Improved test to also include runtime library behavior into account besides the compiler behavior it tested before already.

Revision history for this message
Robert Schiele (rschiele) wrote :

The same patch can also be found on https://github.com/schiele/sbcl on the master branch. Patches in that location are always tested to build on x86-64 and pass the full test suite.

Revision history for this message
Robert Schiele (rschiele) wrote :

Updated patch to be compatible with recently added Android build.

Revision history for this message
Robert Schiele (rschiele) wrote :

Hi Christophe,

I added you to this one to give you a chance to review my patch to eventually merge it before the next freeze period or provide some feedback in case you want me to improve the patch in some way.

Unfortunately, I got no response to this yet despite having addressed this in this ticket, several times on the mailing list and created a pull request in GitHub.

It would be cool to finally have sbcl fixed again for machines that normalize floats automatically.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.