[cfe-dev] [RFC] implementation of _Float16

Stephen Canon via cfe-dev cfe-dev at lists.llvm.org
Wed May 10 14:26:36 PDT 2017


Note that ISO/IEC TS 18661-3 (linked in the first email on this thread) already defines a standard suffix for math functions operating on _Float16, in section 12.3:

	_Float16 acosf16(_Float16 x);
	_Float16 asinf16(_Float16 x);
	…

There’s no need to invent something new for this.

– Steve

> On May 10, 2017, at 5:22 PM, Hubert Tong via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
>> On Wed, May 10, 2017 at 9:13 AM, Martin J. O'Riordan via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>> More controversially we also added a “synonym” for this using ‘short float’ rather than ‘_Float16’ (or OpenCL’s ‘half’), and created a parallel set of the ISO C library functions using ‘s’ to suffix the usual names (e.g. ‘tan’, ‘tanf’, ‘tanl’ plus ‘tans’).
> 
> Perhaps a bit of a tangent here with regards to language semantics. I am going to guess that, in general, short float is not necessarily the same format as _Float16. So it follows that if both are present, then _Float16 and short float are types which are not compatible (e.g., for _Generic) with each other. This would be consistent with _Float32 and "plain" float.



More information about the cfe-dev mailing list