Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

4.2.1.  IEEE Floating Point

The floating point format is specified within the newlib directory in libc/include/machine/ieeefp.h. Details of how the IEEE 754 format is implemented, and variations from the standard, are specified by defining a number of C macros.

[Caution]Caution

Two of these macros (_FLT_LARGEST_EXPONENT_IS_NORMAL and _FLT_NO_DENORMALS) specify deviations from IEEE 754. These macros only work with single-precision floating point and may not work correctly if hardware floating point support is used (enabled by configuring with --enable-newlib-hw-fp).

For most targets it is sufficient to define just one of __IEEE_BIG_ENDIAN or __IEEE_LITTLE_ENDIAN. The definitions should always be surrounded by a conditional, so they are only used when the target architecture is selected. For example the OpenRISC 1000  is big-endian, so we add the following to the header file.

#if defined(__or32__)
#define __IEEE_BIG_ENDIAN
#endif
	  
Embecosm divider strip