Compiler Reference GuidePreface armclang Command-line Options Compiler-specific Keywords and Operators Compiler-specific Function, Variable, and Type Att Compiler-specific Intrinsics Compiler-specific Pragmas Other Compiler-specific Features ACLE support Predefined macros Inline functions Half-precision floating-point data types Half-precision floating-point number format Half-precision floating-point intrinsics Library support for _Float16 data type TT instruction intrinsics Non-secure function pointer intrinsics Standard C Implementation Definition Standard C++ Implementation Definition armclang Integrated Assembler armclang Inline Assembler
Half-precision floating-point number format
6.5 Half-precision floating-point number format
Arm® Compiler supports the half-precision floating-point
Half-precision is a floating-point format that occupies 16 bits. Architectures that support half-precision floating-point values include:
If the target hardware does not support half-precision floating-point values, the compiler uses the floating-point library
Half-precision floating-point format
Arm Compiler uses the half-precision binary floating-point format defined by IEEE 754r, a revision to the IEEE 754 standard:
Figure 6-1 IEEE half-precision floating-point format
S (bit): Sign bit E (bits[14:10]): Biased exponent T (bits[9:0]): Mantissa.
The meanings of these fields are as follows:
IF E==31: IF T==0: Value = Signed infinity IF T!=0: Value = Nan T determines Quiet or Signalling: 0: Quiet NaN 1: Signalling NaN IF 0<E<31: Value = (-1)^S x 2^(E-15) x (1 + (2^(-10) x T)) IF E==0: IF T==0: Value = Signed zero IF T!=0: Value = (-1)^S x 2^(-14) x (0 + (2^(-10) x T))
Note:See the Arm® C Language Extensions for more information.
of your data.