[PATCH] D37302: [Headers] Define *_HAS_SUBNORM for FLT, DBL, LDBL

enh via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 10:20:41 PDT 2017


It's supposed to tell you whether the target arch supports it. So it's
definitely something the compiler knows better than the C library, which is
why I didn't just work around this myself 😀

Clang may not be correct right now, but if that's true, (a) it's already
lying to us through the other macro and (b) it's still in a better position
to know the truth.

On Sep 15, 2017 10:12, "Pirama Arumuga Nainar via Phabricator" <
reviews at reviews.llvm.org> wrote:

pirama added a comment.

In https://reviews.llvm.org/D37302#871794, @joerg wrote:

> 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).


https://reviews.llvm.org/D37302
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170915/29f88b9e/attachment.html>


More information about the cfe-commits mailing list