]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* i960.h (i960_maxbitalignment,
authorwehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Mar 2001 16:29:10 +0000 (16:29 +0000)
committerwehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Mar 2001 16:29:10 +0000 (16:29 +0000)
i960_last_maxbitalignment): Declare.
* i960.c (i960_maxbitalignment,
i960_last_maxbitalignment): Make global.
(process_pragma): Delete.
(i960_pr_align, i960_pr_noalign): Move from here ...
* i960-c.c: ... to this new file.
* t-960bare (i960-c.o): New rule.
* t-vxworks960 (i960-c.o): Likewise.
* config.gcc (i960-*-*): Define c_target_objs and
cxx_target_objs.

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

gcc/ChangeLog
gcc/config.gcc
gcc/config/i960/i960-c.c [new file with mode: 0644]
gcc/config/i960/i960.c
gcc/config/i960/i960.h
gcc/config/i960/t-960bare
gcc/config/i960/t-vxworks960

index 2e833b76406f941856fd96e119aa8a307c14d7bc..6dfc7a0a75d3cc4db17498e504ac27f3856ae874 100644 (file)
@@ -1,3 +1,17 @@
+Thu Mar 15 11:24:29 EST 2001  John Wehle  (john@feith.com)
+
+       * i960.h (i960_maxbitalignment,
+       i960_last_maxbitalignment): Declare.
+       * i960.c (i960_maxbitalignment,
+       i960_last_maxbitalignment): Make global.
+       (process_pragma): Delete.
+       (i960_pr_align, i960_pr_noalign): Move from here ...
+       * i960-c.c: ... to this new file.
+       * t-960bare (i960-c.o): New rule.
+       * t-vxworks960 (i960-c.o): Likewise.
+       * config.gcc (i960-*-*): Define c_target_objs and
+       cxx_target_objs.
+
 2001-03-15  Bernd Schmidt  <bernds@redhat.com>
 
        * cselib.c (hash_rtx): For REG and MEM, just use value of expression
index 830fa114c4e948e0f89f99147ccba71b389594b7..f3fe3bb88e86b7104aa399b3915b2950f23e3ce7 100644 (file)
@@ -1519,23 +1519,31 @@ i960-wrs-vxworks5 | i960-wrs-vxworks5.0*)
        tmake_file=i960/t-vxworks960
        use_collect2=yes
        thread_file='vxworks'
+       c_target_objs="i960-c.o"
+       cxx_target_objs="i960-c.o"
        ;;
 i960-wrs-vxworks5* | i960-wrs-vxworks)
        tm_file="${tm_file} dbxcoff.h i960/i960-coff.h i960/vx960-coff.h"
        tmake_file=i960/t-vxworks960
        use_collect2=yes
        thread_file='vxworks'
+       c_target_objs="i960-c.o"
+       cxx_target_objs="i960-c.o"
        ;;
 i960-wrs-vxworks*)
        tm_file="${tm_file} i960/vx960.h"
        tmake_file=i960/t-vxworks960
        use_collect2=yes
        thread_file='vxworks'
+       c_target_objs="i960-c.o"
+       cxx_target_objs="i960-c.o"
        ;;
 i960-*-coff*)
        tm_file="${tm_file} dbxcoff.h i960/i960-coff.h libgloss.h"
        tmake_file=i960/t-960bare
        use_collect2=yes
+       c_target_objs="i960-c.o"
+       cxx_target_objs="i960-c.o"
        ;;
 i960-*-rtems)
        tmake_file="i960/t-960bare t-rtems"
@@ -1544,9 +1552,13 @@ i960-*-rtems)
        if test x$enable_threads = xyes; then
          thread_file='rtems'
        fi
+       c_target_objs="i960-c.o"
+       cxx_target_objs="i960-c.o"
        ;;
 i960-*-*)                      # Default i960 environment.
        use_collect2=yes
+       c_target_objs="i960-c.o"
+       cxx_target_objs="i960-c.o"
        ;;
 ia64*-*-elf*)
        tm_file=ia64/elf.h
diff --git a/gcc/config/i960/i960-c.c b/gcc/config/i960/i960-c.c
new file mode 100644 (file)
index 0000000..66ff29c
--- /dev/null
@@ -0,0 +1,116 @@
+/* Intel 80960 specific, C compiler specific functions.
+   Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000
+   Free Software Foundation, Inc.
+   Contributed by Steven McGeady, Intel Corp.
+   Additional Work by Glenn Colon-Bonet, Jonathan Shapiro, Andy Wilson
+   Converted to GCC 2.0 by Jim Wilson and Michael Tiemann, Cygnus Support.
+
+This file is part of GNU CC.
+
+GNU CC 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.
+
+GNU CC 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 GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "config.h"
+#include "system.h"
+#include "cpplib.h"
+#include "tree.h"
+#include "c-pragma.h"
+#include "c-lex.h"
+#include "toplev.h"
+#include "ggc.h"
+#include "tm_p.h"
+
+/* Handle pragmas for compatibility with Intel's compilers.  */
+
+/* NOTE: ic960 R3.0 pragma align definition:
+
+   #pragma align [(size)] | (identifier=size[,...])
+   #pragma noalign [(identifier)[,...]]
+     
+   (all parens are optional)
+     
+   - size is [1,2,4,8,16]
+   - noalign means size==1
+   - applies only to component elements of a struct (and union?)
+   - identifier applies to structure tag (only)
+   - missing identifier means next struct
+     
+   - alignment rules for bitfields need more investigation.
+
+   This implementation only handles the case of no identifiers.  */
+
+void
+i960_pr_align (pfile)
+     cpp_reader *pfile ATTRIBUTE_UNUSED;
+{
+  tree number;
+  enum cpp_ttype type;
+  int align;
+
+  type = c_lex (&number);
+  if (type == CPP_OPEN_PAREN)
+    type = c_lex (&number);
+  if (type == CPP_NAME)
+    {
+      warning ("sorry, not implemented: #pragma align NAME=SIZE");
+      return;
+    }
+  if (type != CPP_NUMBER)
+    {
+      warning ("malformed #pragma align - ignored");
+      return;
+    }
+
+  align = TREE_INT_CST_LOW (number);
+  switch (align)
+    {
+    case 0:
+      /* Return to last alignment.  */
+      align = i960_last_maxbitalignment / 8;
+      /* Fall through.  */
+    case 16:
+    case 8:
+    case 4:
+    case 2:
+    case 1:
+      i960_last_maxbitalignment = i960_maxbitalignment;
+      i960_maxbitalignment = align * 8;
+      break;
+      
+    default:
+      /* Silently ignore bad values.  */
+      break;
+    }
+}
+
+void
+i960_pr_noalign (pfile)
+     cpp_reader *pfile ATTRIBUTE_UNUSED;
+{
+  enum cpp_ttype type;
+  tree number;
+
+  type = c_lex (&number);
+  if (type == CPP_OPEN_PAREN)
+    type = c_lex (&number);
+  if (type == CPP_NAME)
+    {
+      warning ("sorry, not implemented: #pragma noalign NAME");
+      return;
+    }
+
+  i960_last_maxbitalignment = i960_maxbitalignment;
+  i960_maxbitalignment = 8;
+}
index 1f885fe68b15a7782eb6b3bea2637ff2edd8a291..c56f2f7bb54b422e08849e42f9d9c537bb1df22e 100644 (file)
@@ -55,8 +55,8 @@ rtx i960_compare_op0, i960_compare_op1;
 /* Used to implement #pragma align/noalign.  Initialized by OVERRIDE_OPTIONS
    macro in i960.h.  */
 
-static int i960_maxbitalignment;
-static int i960_last_maxbitalignment;
+int i960_maxbitalignment;
+int i960_last_maxbitalignment;
 
 /* Used to implement switching between MEM and ALU insn types, for better
    C series performance.  */
@@ -89,135 +89,6 @@ static int ret_label = 0;
   && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (FNDECL)))) != void_type_node))    \
  || current_function_varargs)
 
-/* Handle pragmas for compatibility with Intel's compilers.  */
-
-/* NOTE: ic960 R3.0 pragma align definition:
-
-   #pragma align [(size)] | (identifier=size[,...])
-   #pragma noalign [(identifier)[,...]]
-     
-   (all parens are optional)
-     
-   - size is [1,2,4,8,16]
-   - noalign means size==1
-   - applies only to component elements of a struct (and union?)
-   - identifier applies to structure tag (only)
-   - missing identifier means next struct
-     
-   - alignment rules for bitfields need more investigation.
-
-   This implementation only handles the case of no identifiers.  */
-
-void
-i960_pr_align (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
-{
-  tree number;
-  enum cpp_ttype type;
-  int align;
-
-  type = c_lex (&number);
-  if (type == CPP_OPEN_PAREN)
-    type = c_lex (&number);
-  if (type == CPP_NAME)
-    {
-      warning ("sorry, not implemented: #pragma align NAME=SIZE");
-      return;
-    }
-  if (type != CPP_NUMBER)
-    {
-      warning ("malformed #pragma align - ignored");
-      return;
-    }
-
-  align = TREE_INT_CST_LOW (number);
-  switch (align)
-    {
-    case 0:
-      /* Return to last alignment.  */
-      align = i960_last_maxbitalignment / 8;
-      /* Fall through.  */
-    case 16:
-    case 8:
-    case 4:
-    case 2:
-    case 1:
-      i960_last_maxbitalignment = i960_maxbitalignment;
-      i960_maxbitalignment = align * 8;
-      break;
-      
-    default:
-      /* Silently ignore bad values.  */
-      break;
-    }
-}
-
-void
-i960_pr_noalign (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
-{
-  enum cpp_ttype type;
-  tree number;
-
-  type = c_lex (&number);
-  if (type == CPP_OPEN_PAREN)
-    type = c_lex (&number);
-  if (type == CPP_NAME)
-    {
-      warning ("sorry, not implemented: #pragma noalign NAME");
-      return;
-    }
-
-  i960_last_maxbitalignment = i960_maxbitalignment;
-  i960_maxbitalignment = 8;
-}
-
-int
-process_pragma (p_getc, p_ungetc, pname)
-     int (*  p_getc) PARAMS ((void));
-     void (* p_ungetc) PARAMS ((int));
-     const char *pname;
-{
-  register int c;
-  char buf[20];
-  char *s = buf;
-  int align;
-
-  /* Should be pragma 'far' or equivalent for callx/balx here.  */
-  if (strcmp (pname, "align") != 0)
-    return 0;
-  
-  do
-    {
-      c = p_getc ();
-    }
-  while (c == ' ' || c == '\t');
-
-  if (c == '(')
-    c = p_getc ();
-  
-  while (c >= '0' && c <= '9')
-    {
-      if (s < buf + sizeof buf - 1)
-       *s++ = c;
-      c = p_getc ();
-    }
-  
-  *s = '\0';
-
-  /* We had to read a non-numerical character to get out of the
-     while loop---often a newline.  So, we have to put it back to
-     make sure we continue to parse everything properly.  */
-  
-  p_ungetc (c);
-
-  align = atoi (buf);
-
-  
-  
-  return 1;
-}
-
 /* Initialize variables before compiling any files.  */
 
 void
index 4c85e95d8e8da921493376a027bba2140c5034ef..40480bf178c09aa447d8369ab46c8f777d3d04e2 100644 (file)
@@ -131,6 +131,10 @@ Boston, MA 02111-1307, USA.  */
   fprintf (asm_out_file, "\t.type\t0x%x;", A)
 
 /* Handle pragmas for compatibility with Intel's compilers.  */
+
+extern int i960_maxbitalignment;
+extern int i960_last_maxbitalignment;
+
 #define REGISTER_TARGET_PRAGMAS(PFILE) do {                    \
   cpp_register_pragma (PFILE, 0, "align", i960_pr_align);      \
   cpp_register_pragma (PFILE, 0, "noalign", i960_pr_noalign);  \
index 5c6b8274bb69807412214befef82bd90f0103348..17c99a1cef26cb61d5a08c5b5fc5667e24d7f799 100644 (file)
@@ -21,6 +21,9 @@ xp-bit.c: $(srcdir)/config/fp-bit.c
        echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c
        cat $(srcdir)/config/fp-bit.c >> xp-bit.c
 
+i960-c.o: $(srcdir)/config/i960/i960-c.c
+       $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
 MULTILIB_OPTIONS=mnumerics/msoft-float mlong-double-64
 MULTILIB_DIRNAMES=float soft-float ld64
 MULTILIB_MATCHES=mnumerics=msb mnumerics=msc mnumerics=mkb mnumerics=mkc mnumerics=mmc mnumerics=mcb mnumerics=mcc mnumerics=mjf msoft-float=msa msoft-float=mka msoft-float=mca msoft-float=mcf
index 43949fa4f84da0240fb21dfb57e9c6de835f553f..7878591764bca19fc739dd29dce6b9bda570f9e5 100644 (file)
@@ -24,6 +24,9 @@ xp-bit.c: $(srcdir)/config/fp-bit.c
        echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c
        cat $(srcdir)/config/fp-bit.c >> xp-bit.c
 
+i960-c.o: $(srcdir)/config/i960/i960-c.c
+       $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
 MULTILIB_OPTIONS=mnumerics/msoft-float mlong-double-64
 MULTILIB_DIRNAMES=float soft-float ld64
 MULTILIB_MATCHES=mnumerics=msb mnumerics=msc mnumerics=mkb mnumerics=mkc mnumerics=mmc mnumerics=mcb mnumerics=mcc msoft-float=msa msoft-float=mka msoft-float=mca msoft-float=mcf