* config.gcc (powerpc-*-eabispe*, powerpc-*-eabisimaltivec*,
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Jan 2007 13:08:01 +0000 (13:08 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Jan 2007 13:08:01 +0000 (13:08 +0000)
powerpc-*-eabisim*, powerpc-*-eabialtivec*, powerpc-*-eabi*,
powerpc-*-rtems*, powerpc-wrs-vxworks, powerpc-wrs-vxworksae,
powerpcle-*-eabisim*, powerpcle-*-eabi*): Add rs6000/e500.h to
tm_file.
* config/rs6000/e500.h: New.
* config/rs6000/eabi.h (TARGET_SPE_ABI, TARGET_SPE, TARGET_E500,
TARGET_ISEL, TARGET_FPRS, TARGET_E500_SINGLE, TARGET_E500_DOUBLE):
Remove.
* config/rs6000/linuxspe.h (TARGET_SPE_ABI, TARGET_SPE,
TARGET_E500, TARGET_ISEL, TARGET_FPRS, TARGET_E500_SINGLE,
TARGET_E500_DOUBLE): Remove.
* config/rs6000/vxworks.h (TARGET_SPE_ABI, TARGET_SPE,
TARGET_E500, TARGET_ISEL, TARGET_FPRS): Remove.
* config/rs6000/rs6000.h (CHECK_E500_OPTIONS): Define.
* config/rs6000/rs6000.c (rs6000_override_options): Use
CHECK_E500_OPTIONS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120340 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config.gcc
gcc/config/rs6000/e500.h [new file with mode: 0644]
gcc/config/rs6000/eabi.h
gcc/config/rs6000/linuxspe.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/vxworks.h

index 6dcf8ad..aab8e25 100644 (file)
@@ -1,5 +1,25 @@
 2007-01-02  Joseph Myers  <joseph@codesourcery.com>
 
+       * config.gcc (powerpc-*-eabispe*, powerpc-*-eabisimaltivec*,
+       powerpc-*-eabisim*, powerpc-*-eabialtivec*, powerpc-*-eabi*,
+       powerpc-*-rtems*, powerpc-wrs-vxworks, powerpc-wrs-vxworksae,
+       powerpcle-*-eabisim*, powerpcle-*-eabi*): Add rs6000/e500.h to
+       tm_file.
+       * config/rs6000/e500.h: New.
+       * config/rs6000/eabi.h (TARGET_SPE_ABI, TARGET_SPE, TARGET_E500,
+       TARGET_ISEL, TARGET_FPRS, TARGET_E500_SINGLE, TARGET_E500_DOUBLE):
+       Remove.
+       * config/rs6000/linuxspe.h (TARGET_SPE_ABI, TARGET_SPE,
+       TARGET_E500, TARGET_ISEL, TARGET_FPRS, TARGET_E500_SINGLE,
+       TARGET_E500_DOUBLE): Remove.
+       * config/rs6000/vxworks.h (TARGET_SPE_ABI, TARGET_SPE,
+       TARGET_E500, TARGET_ISEL, TARGET_FPRS): Remove.
+       * config/rs6000/rs6000.h (CHECK_E500_OPTIONS): Define.
+       * config/rs6000/rs6000.c (rs6000_override_options): Use
+       CHECK_E500_OPTIONS.
+
+2007-01-02  Joseph Myers  <joseph@codesourcery.com>
+
        * config/rs6000/rs6000.c (print_operand): Check (TARGET_SPE ||
        TARGET_E500_DOUBLE), not TARGET_E500, for %y.
        (rs6000_generate_compare, rs6000_emit_sCOND, output_cbranch,
index ebabf9e..e168a2e 100644 (file)
@@ -1,5 +1,5 @@
 # GCC target-specific configuration file.
-# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 # Free Software Foundation, Inc.
 
 #This file is part of GCC.
@@ -1780,17 +1780,17 @@ powerpc-*-chorusos*)
        use_fixproto=yes
        ;;
 powerpc-*-eabispe*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabispe.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/eabispe.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-spe rs6000/t-ppccomm"
        ;;
 powerpc-*-eabisimaltivec*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h rs6000/eabialtivec.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcendian rs6000/t-ppccomm"
        ;;
 powerpc-*-eabisim*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
        ;;
@@ -1801,17 +1801,17 @@ powerpc-*-elf*)
        use_fixproto=yes
        ;;
 powerpc-*-eabialtivec*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabialtivec.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/eabialtivec.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcendian rs6000/t-ppccomm"
        ;;
 powerpc-*-eabi*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
        ;;
 powerpc-*-rtems*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/rtems.h rtems.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-rtems t-rtems rs6000/t-ppccomm"
        ;;
@@ -1821,7 +1821,7 @@ powerpc-*-linux*altivec*)
        tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
        ;;
 powerpc-*-linux*spe*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h rs6000/e500.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
        ;;
@@ -1871,11 +1871,11 @@ powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
        extra_headers=ppc-asm.h
        case ${target} in
          *-vxworksae*)
-           tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksae.h"
+           tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/e500.h rs6000/vxworksae.h"
            tmake_file="${tmake_file} rs6000/t-vxworksae"
            ;;
          *-vxworks*)
-           tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h"
+           tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h rs6000/e500.h"
            ;;
        esac
        ;;
@@ -1910,12 +1910,12 @@ powerpcle-*-elf*)
        use_fixproto=yes
        ;;
 powerpcle-*-eabisim*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_options="${extra_options} rs6000/sysv4.opt"
        ;;
 powerpcle-*-eabi*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h"
        tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_options="${extra_options} rs6000/sysv4.opt"
        ;;
diff --git a/gcc/config/rs6000/e500.h b/gcc/config/rs6000/e500.h
new file mode 100644 (file)
index 0000000..8296f45
--- /dev/null
@@ -0,0 +1,48 @@
+/* Enable E500 support.
+   Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 2, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING.  If not, write to the
+   Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#undef TARGET_SPE_ABI
+#undef TARGET_SPE
+#undef TARGET_E500
+#undef TARGET_ISEL
+#undef TARGET_FPRS
+#undef TARGET_E500_SINGLE
+#undef TARGET_E500_DOUBLE
+#undef CHECK_E500_OPTIONS
+
+#define TARGET_SPE_ABI rs6000_spe_abi
+#define TARGET_SPE rs6000_spe
+#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
+#define TARGET_ISEL rs6000_isel
+#define TARGET_FPRS (rs6000_float_gprs == 0)
+#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1)
+#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2)
+#define CHECK_E500_OPTIONS                                             \
+  do {                                                                 \
+    if (TARGET_E500 || TARGET_SPE || TARGET_SPE_ABI || TARGET_ISEL     \
+       || TARGET_E500_SINGLE || TARGET_E500_DOUBLE)                    \
+      {                                                                        \
+       if (TARGET_ALTIVEC)                                             \
+         error ("AltiVec and E500 instructions cannot coexist");       \
+       if (TARGET_64BIT)                                               \
+         error ("64-bit E500 not supported");                          \
+       if (TARGET_HARD_FLOAT && TARGET_FPRS)                           \
+         error ("E500 and FPRs not supported");                        \
+      }                                                                        \
+  } while (0)
index 323e5ad..d485a4e 100644 (file)
@@ -1,6 +1,6 @@
 /* Core target definitions for GNU compiler
    for IBM RS/6000 PowerPC targeted to embedded ELF systems.
-   Copyright (C) 1995, 1996, 2000, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2000, 2003, 2004, 2007 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
    This file is part of GCC.
       TARGET_OS_SYSV_CPP_BUILTINS ();     \
     }                                     \
   while (0)
-
-#undef TARGET_SPE_ABI
-#undef TARGET_SPE
-#undef TARGET_E500
-#undef TARGET_ISEL
-#undef TARGET_FPRS
-#undef TARGET_E500_SINGLE
-#undef TARGET_E500_DOUBLE
-
-#define TARGET_SPE_ABI rs6000_spe_abi
-#define TARGET_SPE rs6000_spe
-#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
-#define TARGET_ISEL rs6000_isel
-#define TARGET_FPRS (rs6000_float_gprs == 0)
-#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1)
-#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2)
index fd7d20e..9b98616 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler,
    for PowerPC e500 machines running GNU/Linux.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Contributed by Aldy Hernandez (aldy@quesejoda.com).
 
    This file is part of GCC.
 #undef TARGET_DEFAULT
 #define        TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN)
 
-#undef TARGET_SPE_ABI
-#undef TARGET_SPE
-#undef TARGET_E500
-#undef TARGET_ISEL
-#undef TARGET_FPRS
-#undef TARGET_E500_SINGLE
-#undef TARGET_E500_DOUBLE
-
-#define TARGET_SPE_ABI rs6000_spe_abi
-#define TARGET_SPE rs6000_spe
-#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
-#define TARGET_ISEL rs6000_isel
-#define TARGET_FPRS (rs6000_float_gprs == 0)
-#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1)
-#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2)
-
 #undef  SUBSUBTARGET_OVERRIDE_OPTIONS
 #define SUBSUBTARGET_OVERRIDE_OPTIONS \
   if (rs6000_select[1].string == NULL) \
index 7401970..eaf3db6 100644 (file)
@@ -1446,9 +1446,6 @@ rs6000_override_options (const char *default_cpu)
 
   if (TARGET_E500)
     {
-      if (TARGET_ALTIVEC)
-       error ("AltiVec and E500 instructions cannot coexist");
-
       /* The e500 does not have string instructions, and we set
         MASK_STRING above when optimizing for size.  */
       if ((target_flags & MASK_STRING) != 0)
@@ -1471,6 +1468,9 @@ rs6000_override_options (const char *default_cpu)
        rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE;
     }
 
+  /* Detect invalid option combinations with E500.  */
+  CHECK_E500_OPTIONS;
+
   rs6000_always_hint = (rs6000_cpu != PROCESSOR_POWER4
                        && rs6000_cpu != PROCESSOR_POWER5
                         && rs6000_cpu != PROCESSOR_POWER6
index 0795e6e..17a2298 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler, for IBM RS/6000.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
 
@@ -341,6 +341,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define TARGET_FPRS 1
 #define TARGET_E500_SINGLE 0
 #define TARGET_E500_DOUBLE 0
+#define CHECK_E500_OPTIONS do { } while (0)
 
 /* E500 processors only support plain "sync", not lwsync.  */
 #define TARGET_NO_LWSYNC TARGET_E500
index 273a435..f15369c 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler.  Vxworks PowerPC version.
-   Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005
+   Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
    Contributed by CodeSourcery, LLC.
 
@@ -117,19 +117,6 @@ VXWORKS_ADDITIONAL_CPP_SPEC
 /* Override sysv4.h, reset to the default.  */
 #undef  PREFERRED_STACK_BOUNDARY
 
-/* Enable SPE */
-#undef TARGET_SPE_ABI
-#undef TARGET_SPE
-#undef TARGET_E500
-#undef TARGET_ISEL
-#undef TARGET_FPRS
-
-#define TARGET_SPE_ABI rs6000_spe_abi
-#define TARGET_SPE rs6000_spe
-#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
-#define TARGET_ISEL rs6000_isel
-#define TARGET_FPRS (!rs6000_float_gprs)
-
 /* Make -mcpu=8540 imply SPE.  ISEL is automatically enabled, the
    others must be done by hand.  Handle -mrtp.  Disable -fPIC
    for -mrtp - the VxWorks PIC model is not compatible with it.  */