[PATCH] D35295: [docs] Add section 'Half-Precision Floating Point'

Sjoerd Meijer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 12 05:56:55 PDT 2017


SjoerdMeijer added a comment.

Good points. I am thinking about how to write this down.
I am not yet sure that `_Float16` can reduce portability. I think the behaviour will depend on FLT_EVAL_METHOD. I.e., if your architecture supports half-precision instructions, you would like to set FLT_EVAL_METHOD = 16, which would avoid evaluation in float and thus promotions/truncations. If your architecture does not support half-precision arithmetic, this will be FLT_EVAL_METHOD = 0 so that `_Float16` is evaluated in float. So, from that point of view `_Float16` can achieve the same things as '__fp16`, and it is more efficient when the hardware supports it and is indeed also more portable between entire architectures.


https://reviews.llvm.org/D35295





More information about the cfe-commits mailing list