Commit 647d340d by Jason Thorpe Committed by Jason Thorpe

rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.

* config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Use
RS6000_CPU_CPP_ENDIAN_BUILTINS.
* config/rs6000/netbsd.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): Redefine.

From-SVN: r59518
parent 29742ba4
2002-11-26 Jason Thorpe <thorpej@wasabisystems.com>
* config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Use
RS6000_CPU_CPP_ENDIAN_BUILTINS.
* config/rs6000/netbsd.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): Redefine.
2002-11-26 Hartmut Penner <hpenner@de.ibm.com> 2002-11-26 Hartmut Penner <hpenner@de.ibm.com>
* config/s390/s390.md (literal_pool_64, literal_pool_31 ): New * config/s390/s390.md (literal_pool_64, literal_pool_31 ): New
......
...@@ -31,6 +31,26 @@ Boston, MA 02111-1307, USA. */ ...@@ -31,6 +31,26 @@ Boston, MA 02111-1307, USA. */
} \ } \
while (0) while (0)
/* Override the default from rs6000.h to avoid conflicts with macros
defined in NetBSD header files. */
#undef RS6000_CPU_CPP_ENDIAN_BUILTINS
#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
do \
{ \
if (BYTES_BIG_ENDIAN) \
{ \
builtin_define ("__BIG_ENDIAN__"); \
builtin_assert ("machine=bigendian"); \
} \
else \
{ \
builtin_define ("__LITTLE_ENDIAN__"); \
builtin_assert ("machine=littleendian"); \
} \
} \
while (0)
/* Make GCC agree with <machine/ansi.h>. */ /* Make GCC agree with <machine/ansi.h>. */
#undef SIZE_TYPE #undef SIZE_TYPE
......
...@@ -100,18 +100,10 @@ rs6000_cpu_cpp_builtins (pfile) ...@@ -100,18 +100,10 @@ rs6000_cpu_cpp_builtins (pfile)
/* Used by lwarx/stwcx. errata work-around. */ /* Used by lwarx/stwcx. errata work-around. */
if (rs6000_cpu == PROCESSOR_PPC405) if (rs6000_cpu == PROCESSOR_PPC405)
builtin_define ("__PPC405__"); builtin_define ("__PPC405__");
if (BYTES_BIG_ENDIAN)
{ /* May be overridden by target configuration. */
builtin_define ("__BIG_ENDIAN__"); RS6000_CPU_CPP_ENDIAN_BUILTINS();
builtin_define ("_BIG_ENDIAN");
builtin_assert ("machine=bigendian");
}
else
{
builtin_define ("__LITTLE_ENDIAN__");
builtin_define ("_LITTLE_ENDIAN");
builtin_assert ("machine=littleendian");
}
if (TARGET_LONG_DOUBLE_128) if (TARGET_LONG_DOUBLE_128)
builtin_define ("__LONG_DOUBLE_128__"); builtin_define ("__LONG_DOUBLE_128__");
......
...@@ -479,6 +479,26 @@ extern int rs6000_default_long_calls; ...@@ -479,6 +479,26 @@ extern int rs6000_default_long_calls;
/* Target #defines. */ /* Target #defines. */
#define TARGET_CPU_CPP_BUILTINS() \ #define TARGET_CPU_CPP_BUILTINS() \
rs6000_cpu_cpp_builtins (pfile) rs6000_cpu_cpp_builtins (pfile)
/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
we're compiling for. Some configurations may need to override it. */
#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
do \
{ \
if (BYTES_BIG_ENDIAN) \
{ \
builtin_define ("__BIG_ENDIAN__"); \
builtin_define ("_BIG_ENDIAN"); \
builtin_assert ("machine=bigendian"); \
} \
else \
{ \
builtin_define ("__LITTLE_ENDIAN__"); \
builtin_define ("_LITTLE_ENDIAN"); \
builtin_assert ("machine=littleendian"); \
} \
} \
while (0)
/* Target machine storage layout. */ /* Target machine storage layout. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment