[cfe-dev] [CLang & LibC++] '<limits> and predefined constants for FP16

via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 21 05:38:58 PDT 2017


 Hi CFE-Devs,

I have updated my out-of-tree sources to CLang/LLVM v5.0 and I am
running into problems with the revised implementation of '' to do with
16-bit Floating-Point values.

The issue is the specialisation of '__libcpp_numeric_limits' (perhaps
'_FLOAT16' in the future) which does not exist in LibC++ v5.0, but
which I need to add to tie-in with other changes I have for
'type_traits', etc. for FP16.

The compiler defines a load of predefined macros for '__FLT_*',
'__DBL_*' and '__LDBL_*' that are used in the definitions for the
other specialisations of '__libcpp_numeric_limits', and what I want is
to get some FP16 analogues to these.

While I can work out many of these, I don't know how to calculate
'DENORM_MIN__', 'EPSILON__', 'MAX__' and 'MIN__' for FP16.

Also, I am wondering whether you would recommend that I added
predefined macros for this values to CLang to supplement the usual
set, and if so, what prefix should I use?  For example '__F16_',
'__FP16_' or even '__HLF_'?

Thanks,

    MartinO


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170921/46903ec5/attachment.html>


More information about the cfe-dev mailing list