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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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

Alex Denisov via cfe-dev

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<__fp16, true>' (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_'?



cfe-dev mailing list
[hidden email]