]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cppbuiltin.c (define_builtin_macros_for_type_sizes): Define __BYTE_ORDER__...
authorNathan Froyd <froydnj@codesourcery.com>
Sat, 23 Oct 2010 03:05:47 +0000 (03:05 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Sat, 23 Oct 2010 03:05:47 +0000 (03:05 +0000)
gcc/
* cppbuiltin.c (define_builtin_macros_for_type_sizes): Define
__BYTE_ORDER__, __ORDER_LITTLE_ENDIAN__, __ORDER_BIG_ENDIAN__, and
__ORDER_PDP_ENDIAN__.
* libgcc2.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
(struct DWstruct): Define based on __BYTE_ORDER__.
* config/fixed-bit.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
(struct INTstruct): Define based on __BYTE_ORDER__.
* config/dfp-bit.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
(LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Test __BYTE_ORDER__.
* system.h (LIBGCC2_WORDS_BIG_ENDIAN): Poison identifier.
* config/arc/arc.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/arm/arm.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/ia64/ia64.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/iq2000/iq2000.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/lm32/lm32.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/m32r/m32r.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/mcore/mcore.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/mep/mep.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/mips/mips.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/rs6000/sysv4.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/rx/rx.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/score/score.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/sh/sh.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/sparc/sparc.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* config/xtensa/xtensa.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* doc/tm.texi.in (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
* doc/tm.texi: Regenerate.
* doc/cpp.texi (__BYTE_ORDER__, __ORDER_LITTLE_ENDIAN__): Document.
(__ORDER_BIG_ENDIAN__, __ORDER_PDP_ENDIAN__): Likewise.

libdecnumber/
* dconfig.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
(LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Test __BYTE_ORDER__.

libgcc/
* config/libbid/bid_gcc_intrinsics.h (LIBGCC2_WORDS_BIG_ENDIAN):
Delete.
(LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Test __BYTE_ORDER__.

From-SVN: r165881

28 files changed:
gcc/ChangeLog
gcc/config/arc/arc.h
gcc/config/arm/arm.h
gcc/config/dfp-bit.h
gcc/config/fixed-bit.h
gcc/config/ia64/ia64.h
gcc/config/iq2000/iq2000.h
gcc/config/lm32/lm32.h
gcc/config/m32r/m32r.h
gcc/config/mcore/mcore.h
gcc/config/mep/mep.h
gcc/config/mips/mips.h
gcc/config/rs6000/sysv4.h
gcc/config/rx/rx.h
gcc/config/score/score.h
gcc/config/sh/sh.h
gcc/config/sparc/sparc.h
gcc/config/xtensa/xtensa.h
gcc/cppbuiltin.c
gcc/doc/cpp.texi
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/libgcc2.h
gcc/system.h
libdecnumber/ChangeLog
libdecnumber/dconfig.h
libgcc/ChangeLog
libgcc/config/libbid/bid_gcc_intrinsics.h

index d42ef04abea0506069b2e8258efbda252a8866b4..53b43f020a9caf545fde75554a3e1d121d0e3da4 100644 (file)
@@ -1,3 +1,35 @@
+2010-10-23  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * cppbuiltin.c (define_builtin_macros_for_type_sizes): Define
+       __BYTE_ORDER__, __ORDER_LITTLE_ENDIAN__, __ORDER_BIG_ENDIAN__, and
+       __ORDER_PDP_ENDIAN__.
+       * libgcc2.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       (struct DWstruct): Define based on __BYTE_ORDER__.
+       * config/fixed-bit.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       (struct INTstruct): Define based on __BYTE_ORDER__.
+       * config/dfp-bit.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       (LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Test __BYTE_ORDER__.
+       * system.h (LIBGCC2_WORDS_BIG_ENDIAN): Poison identifier.
+       * config/arc/arc.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/arm/arm.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/ia64/ia64.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/iq2000/iq2000.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/lm32/lm32.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/m32r/m32r.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/mcore/mcore.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/mep/mep.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/mips/mips.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/rs6000/sysv4.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/rx/rx.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/score/score.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/sh/sh.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/sparc/sparc.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * config/xtensa/xtensa.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * doc/tm.texi.in (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       * doc/tm.texi: Regenerate.
+       * doc/cpp.texi (__BYTE_ORDER__, __ORDER_LITTLE_ENDIAN__): Document.
+       (__ORDER_BIG_ENDIAN__, __ORDER_PDP_ENDIAN__): Likewise.
+
 2010-10-23  Jie Zhang  <jie@codesourcery.com>
 
        PR rtl-optimization/37360
index ff7e5b73226fb03b0444adf71727b19570ce5c9d..93f5a7feccf8f08601ae878e161d567d3b815c18 100644 (file)
@@ -99,14 +99,6 @@ extern int arc_cpu_type;
    numbered.  */
 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
 
-/* Define this to set the endianness to use in libgcc2.c, which can
-   not depend on target_flags.  */
-#ifdef __big_endian__
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
 /* Width of a word, in units (bytes).  */
 #define UNITS_PER_WORD 4
 
index 4b6717f2c3ba9108e8f9ab3a214378a61e381eb7..c3dc3b911215f769d28527f824eeca861462bf0d 100644 (file)
@@ -556,14 +556,6 @@ extern int arm_arch_hwdiv;
    This is always false, even when in big-endian mode.  */
 #define WORDS_BIG_ENDIAN  (BYTES_BIG_ENDIAN && ! TARGET_LITTLE_WORDS)
 
-/* LIBGCC2_WORDS_BIG_ENDIAN has to be a constant, so we define this based
-   on processor pre-defineds when compiling libgcc2.c.  */
-#if defined(__ARMEB__) && !defined(__ARMWEL__)
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
 /* Define this if most significant word of doubles is the lowest numbered.
    The rules are different based on whether or not we use FPA-format,
    VFP-format or some other floating point co-processor's format doubles.  */
index f093785bf54faa752f193d28f24adb61752c9d75..20688b19a1e0216bf7542159d1dbe2b622bc132a 100644 (file)
@@ -33,12 +33,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "coretypes.h"
 #include "tm.h"
 
-#ifndef LIBGCC2_WORDS_BIG_ENDIAN
-#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
-#endif
-
 #ifndef LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
-#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN LIBGCC2_WORDS_BIG_ENDIAN
+#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN \
+  (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
 #endif
 
 #ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
index ce5b96e785067e88eb36967fd537a1dca6741507..9d53ce783b2d4d7719abce254b5ffda990e1ade5 100644 (file)
@@ -41,14 +41,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    Ex: If we define FROM_QQ and TO_SI, the conversion from QQ to SI is
    generated.  */
 
-/* Permit the tm.h file to select the endianness to use just for this
-   file.  This is used when the endianness is determined when the
-   compiler is run.  */
-
-#ifndef LIBGCC2_WORDS_BIG_ENDIAN
-#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
-#endif
-
 #ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
 #endif
@@ -428,7 +420,7 @@ typedef int word_type __attribute__ ((mode (__word__)));
 /* The following defines are based on the previous defines.  */
 
 #if defined (HINT_C_TYPE)
-#if LIBGCC2_WORDS_BIG_ENDIAN
+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
   struct INTstruct {HINT_C_TYPE high, low;};
 #else
   struct INTstruct {HINT_C_TYPE low, high;};
index b4c3758f996d45a220033139ed2ac0a148d3bbc4..6fdcb97bcd6b375806b8eaf5acab631982e2da47 100644 (file)
@@ -148,12 +148,6 @@ extern enum processor_type ia64_tune;
 
 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
 
-#if defined(__BIG_ENDIAN__)
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
 #define UNITS_PER_WORD 8
 
 #define POINTER_SIZE (TARGET_ILP32 ? 32 : 64)
index d07bf31a7557510117d237c7e62f8ba53b5ba4e8..91c5173416d6839bd35c6ee2efb6eccd4fc59c97 100644 (file)
@@ -74,7 +74,6 @@
 #define BITS_BIG_ENDIAN                0
 #define BYTES_BIG_ENDIAN               1 
 #define WORDS_BIG_ENDIAN               1
-#define LIBGCC2_WORDS_BIG_ENDIAN       1
 #define BITS_PER_WORD                  32
 #define MAX_BITS_PER_WORD              64
 #define UNITS_PER_WORD                         4
index 6800e0f0200bc0469f02982b2d309a0b4e9bf8e5..cec835106a9fde7ab60525179ff750c0f6233ebf 100644 (file)
@@ -84,7 +84,6 @@
 #define BITS_BIG_ENDIAN 0
 #define BYTES_BIG_ENDIAN 1
 #define WORDS_BIG_ENDIAN 1
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
 
 #define BITS_PER_UNIT 8
 #define BITS_PER_WORD 32
index 3c0c85d730265f016b57736cbf0584a70540435a..a645518cbc1a489c2cab5e16ad22e2654fe1363f 100644 (file)
@@ -319,12 +319,6 @@ extern enum m32r_sdata m32r_sdata;
    numbered.  */
 #define WORDS_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)
 
-/* Define this macro if WORDS_BIG_ENDIAN is not constant.  This must
-   be a constant value with the same meaning as WORDS_BIG_ENDIAN,
-   which will be used only when compiling libgcc2.c.  Typically the
-   value will be set based on preprocessor defines.  */
-/*#define LIBGCC2_WORDS_BIG_ENDIAN 1*/
-
 /* Width of a word, in units (bytes).  */
 #define UNITS_PER_WORD 4
 
index a149eb13e1dd655d68a00734a3c432d58baa6a38..8efe64f2bf0df8ebd7b9597865f10f44bc2fc85c 100644 (file)
@@ -106,12 +106,6 @@ extern char * mcore_current_function_name;
    numbered.  */
 #define WORDS_BIG_ENDIAN (! TARGET_LITTLE_END)
 
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#ifdef __MCORELE__
-#undef  LIBGCC2_WORDS_BIG_ENDIAN
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
 #define MAX_BITS_PER_WORD 32
 
 /* Width of a word, in units (bytes).  */
index b6a64995827997b271fcec9509ef3807a8f4f0e2..fa00098d7c40aa9f7b6fed8c98ac3fcce87f8541 100644 (file)
@@ -165,12 +165,6 @@ crtbegin.o%s"
 #define BYTES_BIG_ENDIAN (TARGET_LITTLE_ENDIAN ? 0 : 1)
 #define WORDS_BIG_ENDIAN (TARGET_LITTLE_ENDIAN ? 0 : 1)
 
-#ifdef __LITTLE_ENDIAN__
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#endif
-
 #define UNITS_PER_WORD 4
 
 #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE)    \
index 1b4747f7b59264f49985734f8fd87f36f9f09b3a..d6d909b775619e322ac6b2ac09bd4ac8ebe4a15d 100644 (file)
@@ -1287,14 +1287,6 @@ enum mips_code_readable_setting {
 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
 
-/* Define this to set the endianness to use in libgcc2.c, which can
-   not depend on target_flags.  */
-#if !defined(MIPSEL) && !defined(__MIPSEL__)
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
 #define MAX_BITS_PER_WORD 64
 
 /* Width of a word, in units (bytes).  */
index 25584b2f5023690d895ca6babc1df20ddb25729c..6d88e324e889bb6847852a8518fdfc37ccd6505b 100644 (file)
@@ -258,14 +258,6 @@ do {                                                                       \
 #define        BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
 #define        WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
 
-/* Define this to set the endianness to use in libgcc2.c, which can
-   not depend on target_flags.  */
-#if !defined(__LITTLE_ENDIAN__) && !defined(__sun__)
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
 /* Define cutoff for using external functions to save floating point.
    When optimizing for size, use external functions when profitable.  */
 #define FP_SAVE_INLINE(FIRST_REG) (optimize_size                       \
index b39c1e5abca3768f65509dd70009ecc3334db1ef..f320beb260ac87f37c07863d8c086e12ed3d55f6 100644 (file)
@@ -96,12 +96,6 @@ extern enum rx_cpu_types  rx_cpu_type;
 #define BYTES_BIG_ENDIAN               TARGET_BIG_ENDIAN_DATA
 #define WORDS_BIG_ENDIAN               TARGET_BIG_ENDIAN_DATA
 
-#ifdef __RX_BIG_ENDIAN__
-#define LIBGCC2_WORDS_BIG_ENDIAN       1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN       0
-#endif
-
 #define UNITS_PER_WORD                         4
 
 #define INT_TYPE_SIZE                  32
index 0db4c6c10c61bd8ba72bb399e93f49c39e18b25e..98f6d7dbe0336b288b54f585ab92f3371a25b3f3 100644 (file)
 #define BYTES_BIG_ENDIAN       (TARGET_LITTLE_ENDIAN == 0)
 #define WORDS_BIG_ENDIAN       (TARGET_LITTLE_ENDIAN == 0)
 
-/* Define this to set the endianness to use in libgcc2.c, which can
-   not depend on target_flags.  */
-#if defined(__scorele__)
-#define LIBGCC2_WORDS_BIG_ENDIAN       0
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN       1
-#endif
-
 /* Width of a word, in units (bytes).  */
 #define UNITS_PER_WORD                 4
 
index 969636822daff1044662bf3492893be09de135b9..0dfdd3a7b50466aaed4db218f729f406570cb943 100644 (file)
@@ -516,14 +516,6 @@ extern enum sh_divide_strategy_e sh_div_strategy;
    numbered.  */
 #define WORDS_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)
 
-/* Define this to set the endianness to use in libgcc2.c, which can
-   not depend on target_flags.  */
-#if defined(__LITTLE_ENDIAN__)
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#endif
-
 #define MAX_BITS_PER_WORD 64
 
 /* Width in bits of an `int'.  We want just 32-bits, even if words are
index 8919542e3150ef3159b86a2fb4ff9a24bb868e41..3df147218a15e789c9b6ab2a5ff104f4ca35bc5a 100644 (file)
@@ -582,14 +582,6 @@ extern struct sparc_cpu_select sparc_select[];
    numbered.  */
 #define WORDS_BIG_ENDIAN 1
 
-/* Define this to set the endianness to use in libgcc2.c, which can
-   not depend on target_flags.  */
-#if defined (__LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN_DATA__)
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#endif
-
 #define MAX_BITS_PER_WORD      64
 
 /* Width of a word, in units (bytes).  */
index 96173eebda3cdaa5af0df7b7e2fdadd73fc0e0b7..ee528efbac39a5d7771da79dc3fe04e4b3518b69 100644 (file)
@@ -94,13 +94,6 @@ extern unsigned xtensa_current_frame_size;
 #define EXTRA_SPECS                                                    \
   { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC },
 
-#ifdef __XTENSA_EB__
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-#else
-#define LIBGCC2_WORDS_BIG_ENDIAN 0
-#endif
-
-
 /* Target machine storage layout */
 
 /* Define this if most significant bit is lowest numbered
index 89b0f418be6e6f617e96e28b354f21e12a8d89ae..7ac4071c322e9d7f9fb7c3527d4233cc624b4ce8 100644 (file)
@@ -138,6 +138,24 @@ define_builtin_macros_for_type_sizes (cpp_reader *pfile)
   cpp_define_formatted (pfile, "__BIGGEST_ALIGNMENT__=%d",
                        BIGGEST_ALIGNMENT / BITS_PER_UNIT);
 
+  /* Define constants useful for implementing endian.h.  */
+  cpp_define (pfile, "__ORDER_LITTLE_ENDIAN__=1234");
+  cpp_define (pfile, "__ORDER_BIG_ENDIAN__=4321");
+  cpp_define (pfile, "__ORDER_PDP_ENDIAN__=3412");
+
+  if (WORDS_BIG_ENDIAN == BYTES_BIG_ENDIAN)
+    cpp_define_formatted (pfile, "__BYTE_ORDER__=%s",
+                         (WORDS_BIG_ENDIAN
+                          ? "__ORDER_BIG_ENDIAN__"
+                          : "__ORDER_LITTLE_ENDIAN__"));
+  else
+    {
+      /* Assert that we're only dealing with the PDP11 case.  */
+      gcc_assert (!BYTES_BIG_ENDIAN && WORDS_BIG_ENDIAN);
+
+      cpp_define (pfile, "__BYTE_ORDER__=__ORDER_PDP_ENDIAN__");
+    }
+
   /* ptr_type_node can't be used here since ptr_mode is only set when
      toplev calls backend_init which is not done with -E switch.  */
   cpp_define_formatted (pfile, "__SIZEOF_POINTER__=%d",
index a580e6108c8106d1029c113696820d43ab34f552..ddcf81467f6784a88bd9674fc8c46e883c2bd6cc 100644 (file)
@@ -2265,6 +2265,30 @@ Defined to the number of bytes of the C standard data types: @code{int},
 @code{double}, @code{long double}, @code{size_t}, @code{wchar_t}, @code{wint_t}
 and @code{ptrdiff_t}.
 
+@item __BYTE_ORDER__
+@itemx __ORDER_LITTLE_ENDIAN__
+@itemx __ORDER_BIG_ENDIAN__
+@itemx __ORDER_PDP_ENDIAN__
+@code{__BYTE_ORDER__} is defined to one of the values
+@code{__ORDER_LITTLE_ENDIAN__}, @code{__ORDER_BIG_ENDIAN__}, or
+@code{__ORDER_PDP_ENDIAN__} to reflect the layout of multi-byte and
+multi-word quantities in memory.  If @code{__BYTE_ORDER__} is equal to
+@code{__ORDER_LITTLE_ENDIAN__} or @code{__ORDER_BIG_ENDIAN__}, then
+multi-byte and multi-word quantities are laid out identically: the
+byte (word) at the lowest address is the least significant or most
+significant byte (word) of the quantity, respectively.  If
+@code{__BYTE_ORDER__} is equal to @code{__ORDER_PDP_ENDIAN__}, then
+bytes in 16-bit words are laid out in a little-endian fashion, whereas
+the 16-bit subwords of a 32-bit quantity are laid out in big-endian
+fashion.
+
+You should use these macros for testing like this:
+
+@smallexample
+/* @r{Test for a little-endian machine} */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+@end smallexample
+
 @item __DEPRECATED
 This macro is defined, with value 1, when compiling a C++ source file
 with warnings about deprecated constructs enabled.  These warnings are
index dd319e140697fbedcefae345d73194b16e852b1a..66a092fbc1a5f21cb0c6a4b8ffc58df615eeb5a9 100644 (file)
@@ -918,13 +918,6 @@ order of words in memory is the same as the order in registers.  This
 macro need not be a constant.
 @end defmac
 
-@defmac LIBGCC2_WORDS_BIG_ENDIAN
-Define this macro if @code{WORDS_BIG_ENDIAN} is not constant.  This must be a
-constant value with the same meaning as @code{WORDS_BIG_ENDIAN}, which will be
-used only when compiling @file{libgcc2.c}.  Typically the value will be set
-based on preprocessor defines.
-@end defmac
-
 @defmac FLOAT_WORDS_BIG_ENDIAN
 Define this macro to have the value 1 if @code{DFmode}, @code{XFmode} or
 @code{TFmode} floating point numbers are stored in memory with the word
index a0855c0c6e1003f3c3a3b7b29f173263f8b9a023..a5fb0007920ebee915828d196cc8096719a96a18 100644 (file)
@@ -912,13 +912,6 @@ order of words in memory is the same as the order in registers.  This
 macro need not be a constant.
 @end defmac
 
-@defmac LIBGCC2_WORDS_BIG_ENDIAN
-Define this macro if @code{WORDS_BIG_ENDIAN} is not constant.  This must be a
-constant value with the same meaning as @code{WORDS_BIG_ENDIAN}, which will be
-used only when compiling @file{libgcc2.c}.  Typically the value will be set
-based on preprocessor defines.
-@end defmac
-
 @defmac FLOAT_WORDS_BIG_ENDIAN
 Define this macro to have the value 1 if @code{DFmode}, @code{XFmode} or
 @code{TFmode} floating point numbers are stored in memory with the word
index d2d86ef8a2dc514b28ae5667a4c3f3a1b6e448c2..8b131a35e547debb22a3c52fe79269ab810e079d 100644 (file)
@@ -35,14 +35,6 @@ extern void __clear_cache (char *, char *);
 extern void __eprintf (const char *, const char *, unsigned int, const char *)
   __attribute__ ((__noreturn__));
 
-/* Permit the tm.h file to select the endianness to use just for this
-   file.  This is used when the endianness is determined when the
-   compiler is run.  */
-
-#ifndef LIBGCC2_WORDS_BIG_ENDIAN
-#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
-#endif
-
 #ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
 #endif
@@ -407,9 +399,9 @@ extern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype);
 #define int bogus_type
 
 /* DWstructs are pairs of Wtype values in the order determined by
-   LIBGCC2_WORDS_BIG_ENDIAN.  */
+   __BYTE_ORDER__.  */
 
-#if LIBGCC2_WORDS_BIG_ENDIAN
+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
   struct DWstruct {Wtype high, low;};
 #else
   struct DWstruct {Wtype low, high;};
index 7ca0c88bc5d932c1e595a4cd093436bffe8ea8b3..ef0c4628b437d830800ce3906c20d2b6972fd33c 100644 (file)
@@ -790,7 +790,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
        TARGET_HANDLE_OFAST TARGET_OPTION_OPTIMIZATION
 
 /* Hooks into libgcc2.  */
- #pragma GCC poison LIBGCC2_DOUBLE_TYPE_SIZE
+ #pragma GCC poison LIBGCC2_DOUBLE_TYPE_SIZE LIBGCC2_WORDS_BIG_ENDIAN
 
 /* Miscellaneous macros that are no longer used.  */
  #pragma GCC poison USE_MAPPED_LOCATION
index 0d7765ea18983c3eaaa008896a79e293b621aca1..d2d6d5947ec881a60263f9042450314828ab70b6 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-23  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * dconfig.h (LIBGCC2_WORDS_BIG_ENDIAN): Delete.
+       (LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Test __BYTE_ORDER__.
+
 2010-09-10  Kai Tietz  <kai.tietz@onevision.com>
 
        * configure: Regenerated.
index 91aa3341c6c5e9e577474841e1caa303e74c3eeb..26b963c9480f526d2842806599837bf0d74cf042 100644 (file)
@@ -28,12 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "coretypes.h"
 #include "tm.h"
 
-#ifndef LIBGCC2_WORDS_BIG_ENDIAN
-#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
-#endif
-
 #ifndef LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
-#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN LIBGCC2_WORDS_BIG_ENDIAN
+#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN \
+  (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
 #endif
 
 #if LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
index 1564feb2cd1546cdc4c5533f71e3d9fc37c6a1ce..ea864d33dcb2ac46e7ddd9583099427a160271d7 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-23  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * config/libbid/bid_gcc_intrinsics.h (LIBGCC2_WORDS_BIG_ENDIAN):
+       Delete.
+       (LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Test __BYTE_ORDER__.
+
 2010-10-14  Nathan Froyd  <froydnj@codesourcery.com>
 
        * config/arm/bpabi.h: New file.
index f5bd8d04a968e086278db69ba886977d26517ef3..f536e3b1bd4c2556f84a37912ad89d9d885685c1 100644 (file)
@@ -30,12 +30,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "coretypes.h"
 #include "tm.h"
 
-#ifndef LIBGCC2_WORDS_BIG_ENDIAN
-#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
-#endif
-
 #ifndef LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
-#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN LIBGCC2_WORDS_BIG_ENDIAN
+#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN \
+  (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
 #endif
 
 #ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE