2002-07-15 Jeff Johnston <jjohnstn@redhat.com>

* libc/include/machine/ieeefp.h: Change to only define
        floating point defines (e.g one of __IEEE_BIG_ENDIAN or
        __IEEE_LITTLE_ENDIAN must be defined for each platform).
        * libc/include/sys/config.h: Include <machine/ieeefp.h> and
        remove redundant floating point definitions.
This commit is contained in:
Jeff Johnston 2002-07-15 21:35:44 +00:00
parent 8cb61a96e6
commit 38b5dc59ab
3 changed files with 58 additions and 161 deletions

View File

@ -1,3 +1,11 @@
2002-07-15 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/machine/ieeefp.h: Change to only define
floating point defines (e.g one of __IEEE_BIG_ENDIAN or
__IEEE_LITTLE_ENDIAN must be defined for each platform).
* libc/include/sys/config.h: Include <machine/ieeefp.h> and
remove redundant floating point definitions.
2002-07-15 Jeff Johnston <jjohnstn@redhat.com>
* libc/sys/linux/callocr.c: Fix so code references

View File

@ -15,9 +15,40 @@
Defined if the float format does not support IEEE denormals. Every
float with a zero exponent is taken to be a zero representation.
??? At the moment, there are no equivalent macros above for doubles and
the macros are not fully supported by --enable-newlib-hw-fp.
??? At the moment, there are no equivalent macros for doubles and
the macros are not fully supported by --enable-newlib-hw-fp. */
__IEEE_BIG_ENDIAN
Defined if the float format is big endian. This is mutually exclusive
with __IEEE_LITTLE_ENDIAN.
__IEEE_LITTLE_ENDIAN
Defined if the float format is little endian. This is mutually exclusive
with __IEEE_BIG_ENDIAN.
Note that one of __IEEE_BIG_ENDIAN or __IEEE_LITTLE_ENDIAN must be specified for a
platform or error will occur.
__IEEE_BYTES_LITTLE_ENDIAN
This flag is used in conjunction with __IEEE_BIG_ENDIAN to describe a situation
whereby multiple words of an IEEE floating point are in big endian order, but the
words themselves are little endian with respect to the bytes.
_DOUBLE_IS_32_BITS
This is used on platforms that support double by using the 32-bit IEEE
float type.
_FLOAT_ARG
This represents what type a float arg is passed as. It is used when the type is
not promoted to double.
*/
#if defined(__arm__) || defined(__thumb__)
/* ARM always has big-endian words. Within those words the byte ordering
@ -44,15 +75,9 @@
#define __IEEE_BIG_ENDIAN
#endif
#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__)
#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) || defined (__H8500__)
#define __IEEE_BIG_ENDIAN
#define __SMALL_BITFIELDS
#define _DOUBLE_IS_32BITS
#endif
#ifdef __H8500__
#define __IEEE_BIG_ENDIAN
#define __SMALL_BITFIELDS
#define _FLOAT_ARG float
#define _DOUBLE_IS_32BITS
#endif
@ -102,11 +127,14 @@
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __D30V__
#define __IEEE_BIG_ENDIAN
#endif
/* necv70 was __IEEE_LITTLE_ENDIAN. */
#ifdef __W65__
#define __IEEE_LITTLE_ENDIAN
#define __SMALL_BITFIELDS
#define _DOUBLE_IS_32BITS
#endif
@ -124,7 +152,6 @@
#ifdef __mn10200__
#define __IEEE_LITTLE_ENDIAN
#define __SMALL_BITFIELDS
#define _DOUBLE_IS_32BITS
#endif
@ -141,7 +168,6 @@
#if __DOUBLE__ == 32
#define _DOUBLE_IS_32BITS
#endif
#define __SMALL_BITFIELDS
#endif
#ifdef __PPC__
@ -154,6 +180,10 @@
#endif
#endif
#ifdef __xstormy16__
#define __IEEE_LITTLE_ENDIAN
#endif
#ifdef __arc__
#ifdef __big_endian__
#define __IEEE_BIG_ENDIAN
@ -184,7 +214,6 @@
#ifdef __AVR__
#define __IEEE_LITTLE_ENDIAN
#define __SMALL_BITFIELDS
#define _DOUBLE_IS_32BITS
#endif
@ -192,11 +221,6 @@
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __xstormy16__
#define __IEEE_LITTLE_ENDIAN
#define __SMALL_BITFIELDS
#endif
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
#error Endianess not declared!!

View File

@ -1,29 +1,15 @@
#ifndef __SYS_CONFIG_H__
#define __SYS_CONFIG_H__
#include <machine/ieeefp.h> /* floating point macros */
/* exceptions first */
/* ??? Why is much of this stuff duplicated with machine/ieeefp.h? */
#if defined(__H8300__) || defined(__H8500__) || defined (__H8300H__) || defined(__W65__) || defined (__H8300S__)
#define _FLOAT_ARG float
#define __SMALL_BITFIELDS
#define _DOUBLE_IS_32BITS
#define __IEEE_BIG_ENDIAN
/* ??? This conditional is true for the h8500 and the w65, defining H8300
in those cases probably isn't the right thing to do. */
#define H8300 1
#endif
#ifdef __W65__
#define _DOUBLE_IS_32BITS
#define __SMALL_BITFIELDS
#define __IEEE_BIG_ENDIAN
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX 32767
#define UINT_MAX 65535
#endif
/* 16 bit integer machines */
#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__) || defined (__AVR__)
@ -33,27 +19,17 @@
#define UINT_MAX 65535
#endif
#ifdef __W65__
#define __SMALL_BITFIELDS
#endif
#if defined(__D10V__)
#define __SMALL_BITFIELDS
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX __INT_MAX__
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#if __DOUBLE__ == 32
#define _DOUBLE_IS_32BITS
#endif
#define _POINTER_INT short
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __sh__
#ifdef __LITTLE_ENDIAN__
#define __IEEE_LITTLE_ENDIAN
#else
#define __IEEE_BIG_ENDIAN
#endif
#if defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__)
#define _DOUBLE_IS_32BITS
#endif
#endif
#ifdef ___AM29K__
@ -61,7 +37,6 @@
#endif
#ifdef __i386__
#define __IEEE_LITTLE_ENDIAN
#ifndef __unix__
/* in other words, go32 */
#define _FLOAT_RET double
@ -75,114 +50,27 @@
#endif
#endif
#ifdef __M32R__
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __m68k__
/* This is defined in machine/ieeefp.h; need to check is it redundant here? */
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __mn10300__
#define __IEEE_LITTLE_ENDIAN
#endif
#ifdef __mn10200__
#define _DOUBLE_IS_32BITS
#define __SMALL_BITFIELDS
#define __IEEE_LITTLE_ENDIAN
#endif
#ifdef __MIPSEL__
#define __IEEE_LITTLE_ENDIAN
#endif
#ifdef __MIPSEB__
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __MMIX__
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __AVR__
#define _DOUBLE_IS_32BITS
#define __SMALL_BITFIELDS
#define __IEEE_LITTLE_ENDIAN
#define _POINTER_INT short
#endif
#ifdef __TIC80__
#define __IEEE_LITTLE_ENDIAN
#endif
#ifdef __v800
#define __IEEE_LITTLE_ENDIAN
#endif
#ifdef __v850
#define __IEEE_LITTLE_ENDIAN
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
#endif
#ifdef __ia64__
#ifdef __BIG_ENDIAN__
#define __IEEE_BIG_ENDIAN
#else
#define __IEEE_LITTLE_ENDIAN
#endif
#endif
#ifdef __D30V__
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __m88k__
#define __IEEE_BIG_ENDIAN
#endif
/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
#if defined(__PPC__)
#if defined(_CALL_SYSV)
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
#endif
#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX)
#define __IEEE_BIG_ENDIAN
#else
#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32)
#define __IEEE_LITTLE_ENDIAN
#endif
#endif
#endif
#if defined(__arm__) || defined(__thumb__)
/* ARM always has big-endian words. Within those words the byte ordering
will be big or little endian depending upon the target. */
#define __IEEE_BIG_ENDIAN
#ifdef __ARMEL__
#define __IEEE_BYTES_LITTLE_ENDIAN
#endif
#endif
#ifdef __hppa__
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __sparc__
#ifdef __LITTLE_ENDIAN_DATA__
#define __IEEE_LITTLE_ENDIAN
#else
#define __IEEE_BIG_ENDIAN
#endif
#endif
#if defined(__or32__) || defined(__or1k__) || defined(__or16__)
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __xstormy16__
#define __IEEE_LITTLE_ENDIAN
#define __SMALL_BITFIELDS
#undef INT_MAX
#undef UINT_MAX
@ -226,24 +114,7 @@
#define _POINTER_INT long
#endif
#ifdef __arc__
#ifdef __big_endian__
#define __IEEE_BIG_ENDIAN
#else
#define __IEEE_LITTLE_ENDIAN
#endif
#endif
#ifdef __fr30__
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __mcore__
#define __IEEE_BIG_ENDIAN
#endif
#ifdef __frv__
#define __IEEE_BIG_ENDIAN
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
#endif
#undef __RAND_MAX
@ -280,10 +151,4 @@
#define _READ_WRITE_RETURN_TYPE int
#endif
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
#error Endianess not declared!!
#endif /* not __IEEE_LITTLE_ENDIAN */
#endif /* not __IEEE_BIG_ENDIAN */
#endif /* __SYS_CONFIG_H__ */