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

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’?

Thanks,

MartinO