These macros are defined in the C11 standard and can be defined based on
the *_HAS_DENORM default macros.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
It looks like all architectures that Clang supports have denorm support. AFAICT, none of them have the "indeterminable" behavior. So it seems safe to define these macros here.
@bruno The test lib/Headers/darwin.c will now pass even if the include_next for Darwin fails. If there are more definitions in the Darwin float.h, I can update to test that definition instead of FLT_HAS_SUBNORM.
@bruno Any suggestion on how to update test/Headers/float-darwin,c* so make it check the include_next? I am unable to find the darwin-specific float.h inside an XCode installation directory.
- Oops, my earlier comment had the wrong test name
So what about targets that don't support subnormals? I'm moderately sure ARM falls into this category given the right phase of the moon.
Clang defines __FLT_HAS_DENORM__ and friends unconditionally, so I thought we could do this for FLT_HAS_SUBNORM as well, considering that gcc did the same. But that might be misleading because gcc's float.h was just for the target of that particular gcc build.
Am I right to understand that __FLT_HAS_DENORM__ signifies *compiler* support for denorms as opposed to support on the *platforms* supported? If so, it might support our alternative consideration of defining these macros in the bionic/libc headers for Android (and rely on the include_next similar to Windows and Darwin).
Sorry this fell of my radar. I've rebased the patch.
Since this has been inactive for a while, lets wait for a couple of days to see if there are any other comments. If there are no objections, I'll submit this on Wednesday.
Ok. FWIW, I was about to submit exactly the same patch when I found yours. This solves a problem for me.