Date: 2019-10-15 10:12:39
> -----Original Message-----
> From: Boost <boost-bounces_at_[hidden]> On Behalf Of Phil Endecott via
> Sent: 14 October 2019 20:15
> To: boost_at_[hidden]
> Cc: Phil Endecott <spam_from_boost_dev_at_[hidden]>
> Subject: [boost] [Math] float16 on ARM
> There seems to be support for 16-bit floats on iOS, when using Apple's XCode
> clang. This seems to be a storage-only format with the only instruction set
> being conversions to and from 32- and 64-bit floats. Quick test:
> #if __ARM_FP & 2
> #warning "Have 16-bit FP"
> void test()
> __fp16 a = 1.234;
> __fp16 b = 2.345;
> auto sum = a+b;
> There doesn't seem to be a std::numeric_limits specialisation.
> I suspect that other platforms have something similar. It would be good to
> boost::float16_t typedef and a portable feature-test macro (and maybe a
> fallback). As far as I can see, boost/math/cstdfloat/cstdfloat_types.hpp
> sizes of float, double and long double, and checks for 128-bit floats provided
> the compiler. Can this be extended to check for __fp16 ?
> (P.S. it seems that gcc also has support, see
> https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html )
I:\boost\libs\math\include\boost\math\cstdfloat\cstdfloat_types.hpp has some
mention for 16-bit floating-point double.
Is this the only 16-bit floating-point format in use?
The storage-only nature of the type is another complication.
But in principle, yes, I support this (but am uncertain how to implement it in
Paul A. Bristow
LA8 8AB UK
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk