Compiler User GuidePreface Overview of the Compiler Getting Started with the Compiler Compiler Features Compiler Coding Practices The compiler as an optimizing compiler Compiler optimization for code size versus speed Compiler optimization levels and the debug view Selecting the target processor at compile time Enabling FPU for bare-metal Optimization of loop termination in C code Loop unrolling in C code Compiler optimization and the volatile keyword Code metrics Code metrics for measurement of code size and data Stack use in C and C++ Benefits of reducing debug information in objects Methods of reducing debug information in objects a Guarding against multiple inclusion of header file Methods of minimizing function parameter passing o Returning structures from functions through regist Functions that return the same result when called Comparison of pure and impure functions Recommendation of postfix syntax when qualifying f Inline functions Compiler decisions on function inlining Automatic function inlining and static functions Inline functions and removal of unused out-of-line Automatic function inlining and multifile compilat Restriction on overriding compiler decisions about Compiler modes and inline functions Inline functions in C++ and C90 mode Inline functions in C99 mode Inline functions and debugging Types of data alignment Advantages of natural data alignment Compiler storage of data objects by natural byte a Relevance of natural data alignment at compile tim Unaligned data access in C and C++ code The __packed qualifier and unaligned data access i Unaligned fields in structures Performance penalty associated with marking whole Unaligned pointers in C and C++ code Unaligned Load Register (LDR) instructions generat Comparisons of an unpacked struct, a __packed stru Compiler support for floating-point arithmetic Default selection of hardware or software floating Example of hardware and software support differenc Vector Floating-Point (VFP) architectures Limitations on hardware handling of floating-point Implementation of Vector Floating-Point (VFP) supp Compiler and library support for half-precision fl Half-precision floating-point number format Compiler support for floating-point computations a Types of floating-point linkage Compiler options for floating-point linkage and co Floating-point linkage and computational requireme Processors and their implicit Floating-Point Units Integer division-by-zero errors in C code Software floating-point division-by-zero errors in About trapping software floating-point division-by Identification of software floating-point division Software floating-point division-by-zero debugging New language features of C99 New library features of C99 // comments in C99 and C90 Compound literals in C99 Designated initializers in C99 Hexadecimal floating-point numbers in C99 Flexible array members in C99 __func__ predefined identifier in C99 inline functions in C99 long long data type in C99 and C90 Macros with a variable number of arguments in C99 Mixed declarations and statements in C99 New block scopes for selection and iteration state _Pragma preprocessing operator in C99 Restricted pointers in C99 Additional
Half-precision floating-point number format
4.48 Half-precision floating-point number format
The half-precision floating-point formats available are
The half-precision floating-point format is as follows:
Figure 4-1 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 depend on the format that is selected.
The IEEE half-precision format is 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))
The alternative half-precision format is as follows:
IF 0<E<32: 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))
of your data.