From e68e1da8000c23efbbf0230ec84da77255b65232 Mon Sep 17 00:00:00 2001
From: rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 31 May 1991 19:49:13 +0000
Subject: [PATCH] Initial revision

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/config/m68k/3b1g.h    |  63 +++++++++++
 gcc/config/ns32k/merlin.h | 229 ++++++++++++++++++++++++++++++++++++++
 gcc/config/sparc/pbd.h    | 148 ++++++++++++++++++++++++
 3 files changed, 440 insertions(+)
 create mode 100644 gcc/config/m68k/3b1g.h
 create mode 100644 gcc/config/ns32k/merlin.h
 create mode 100644 gcc/config/sparc/pbd.h

diff --git a/gcc/config/m68k/3b1g.h b/gcc/config/m68k/3b1g.h
new file mode 100644
index 000000000000..25cd96b64535
--- /dev/null
+++ b/gcc/config/m68k/3b1g.h
@@ -0,0 +1,63 @@
+/* Definitions of target machine for GNU compiler, for a 3b1 using GAS.
+   Copyright (C) 1987, 1988 Free Software Foundation, Inc.
+
+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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#include "tm-m68k.h"
+
+/* See tm-m68k.h.  0 means 68000 with no 68881.  */
+#define TARGET_DEFAULT 0
+
+/* Define __HAVE_68881 in preprocessor only if -m68881 is specified.
+   This will control the use of inline 68881 insns in certain macros.
+   Also inform the program which CPU this is for.  */
+#define CPP_SPEC "%{m68881:-D__HAVE_68881__} \
+%{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}"
+
+/* -m68020 requires special flags to the assembler.  */
+#define ASM_SPEC \
+ "%{m68020:-mc68020}%{mc68020:-mc68020}%{!mc68020:%{!m68020:-mc68010}}"
+
+/* Names to predefine in the preprocessor for this target machine.  */
+#define CPP_PREDEFINES "-Dmc68000 -Dmc68k -Dunix -Dunixpc"
+
+/* This is (not really) BSD, so (but) it wants DBX format.  */
+#define DBX_DEBUGGING_INFO
+
+/* Brain damage. */
+#define SCCS_DIRECTIVE
+
+/* Specify how to pad function arguments.
+   Value should be `upward', `downward' or `none'.
+   Same as the default, except no padding for large or variable-size args.  */
+#define FUNCTION_ARG_PADDING(MODE, TYPE)				\
+  (((MODE) == BLKmode							\
+    ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE))	== INTEGER_CST		\
+       && int_size_in_bytes (TYPE) < PARM_BOUNDARY / BITS_PER_UNIT)	\
+    : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY)				\
+   ? downward : none)
+
+/* Override part of the obstack macros.  */
+#define __PTR_TO_INT(P) ((int)(P))
+#define __INT_TO_PTR(P) ((char *)(P))
+
+/* Every structure or union's size must be a multiple of 2 bytes.  */
+#define STRUCTURE_SIZE_BOUNDARY 16
+
+/* Generate calls to memcpy, memcmp and memset.  */
+#define TARGET_MEM_FUNCTIONS
+
diff --git a/gcc/config/ns32k/merlin.h b/gcc/config/ns32k/merlin.h
new file mode 100644
index 000000000000..d6fb5c341991
--- /dev/null
+++ b/gcc/config/ns32k/merlin.h
@@ -0,0 +1,229 @@
+/* Definitions of target machine for GNU compiler.  MERLIN NS32000 version.
+   Copyright (C) 1990 Free Software Foundation, Inc.
+   By Mark Mason (mason@reed.bitnet, pyramid!unify!mason@uunet.uu.net).
+
+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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+/* Two flags to control how addresses are printed in assembler insns.  */
+
+#define SEQUENT_ADDRESS_BUG 1
+#define SEQUENT_BASE_REGS
+
+#include "tm-ns32k.h"
+
+/* This is BSD, so it wants DBX format.  */
+#define DBX_DEBUGGING_INFO
+
+/* Sequent has some changes in the format of DBX symbols.  */
+#define DBX_NO_XREFS 1
+
+/* Don't split DBX symbols into continuations.  */
+#define DBX_CONTIN_LENGTH 0
+
+#define TARGET_DEFAULT 1
+
+/* Print subsidiary information on the compiler version in use.  */
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (32000, UTek syntax)");
+
+/* These control the C++ compiler somehow.  */
+#define FASCIST_ASSEMBLER
+#define USE_COLLECT
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+	"-Dns32000 -Dns32k -Dns16000 -Dmerlin -Dunix -DUtek -Dbsd"
+
+/* This is how to align the code that follows an unconditional branch.
+   Don't define it, since it confuses the assembler (we hear).  */
+
+#undef ASM_OUTPUT_ALIGN_CODE
+
+/* Assember pseudo-op for shared data segment. */
+#define SHARED_SECTION_ASM_OP ".shdata"
+
+/* %$ means print the prefix for an immediate operand. */
+
+#ifdef UTEK_ASM
+#undef PRINT_OPERAND
+#define PRINT_OPERAND(FILE, X, CODE)  \
+{ if (CODE == '$') putc('$', FILE);					\
+  else if (CODE == '?');						\
+  else if (GET_CODE (X) == CONST_INT)					\
+    fprintf(FILE, "$%d", INTVAL(X));					\
+  else if (GET_CODE (X) == REG)						\
+    fprintf (FILE, "%s", reg_names[REGNO (X)]);				\
+  else if (GET_CODE (X) == MEM)						\
+    {									\
+      rtx xfoo;								\
+      xfoo = XEXP (X, 0);						\
+      switch (GET_CODE (xfoo))						\
+	{								\
+	case MEM:							\
+	  if (GET_CODE (XEXP (xfoo, 0)) == REG)				\
+	    if (REGNO (XEXP (xfoo, 0)) == STACK_POINTER_REGNUM)		\
+	      fprintf (FILE, "0(0(sp))");				\
+	    else fprintf (FILE, "0(0(%s))",				\
+			  reg_names[REGNO (XEXP (xfoo, 0))]);		\
+	  else								\
+	    {								\
+	      if (GET_CODE (XEXP (xfoo, 0)) == SYMBOL_REF		\
+		  || GET_CODE (XEXP (xfoo, 0)) == CONST)		\
+	        {							\
+		  fprintf(FILE, "0(");					\
+		  output_address(xfoo);					\
+		  fprintf(FILE, "(sb))");				\
+		}							\
+	      else							\
+	        {							\
+		  fprintf (FILE, "0(");					\
+		  output_address (xfoo);				\
+		  putc (')', FILE);					\
+		}							\
+	    }								\
+	  break;							\
+	case REG:							\
+	  fprintf (FILE, "0(%s)", reg_names[REGNO (xfoo)]);		\
+	  break;							\
+	case PRE_DEC:							\
+	case POST_INC:							\
+	  fprintf (FILE, "tos");					\
+	  break;							\
+	case CONST_INT:							\
+	  fprintf (FILE, "$%d", INTVAL (xfoo));				\
+	  break;							\
+	default:							\
+	  output_address (xfoo);					\
+	  break;							\
+	}								\
+    }									\
+  else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != DImode)	\
+    if (GET_MODE (X) == DFmode)						\
+      { union { double d; int i[2]; } u;				\
+	u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X);	\
+	fprintf (FILE, "$0d%.20e", u.d); }				\
+    else { union { double d; int i[2]; } u;				\
+	   u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
+	   fprintf (FILE, "$0f%.20e", u.d); }				\
+  else output_addr_const (FILE, X); }
+
+#undef  FUNCTION_PROLOGUE
+
+/* This differs from the one in tm-ns32k.h in printing a bitmask
+   rather than a register list in the enter or save instruction.  */
+
+#define FUNCTION_PROLOGUE(FILE, SIZE)     \
+{ register int regno, g_regs_used = 0;				\
+  int used_regs_buf[8], *bufp = used_regs_buf;			\
+  int used_fregs_buf[8], *fbufp = used_fregs_buf;		\
+  extern char call_used_regs[];					\
+  MAIN_FUNCTION_PROLOGUE;					\
+  for (regno = 0; regno < 8; regno++)				\
+    if (regs_ever_live[regno]					\
+	&& ! call_used_regs[regno])				\
+    {								\
+      *bufp++ = regno; g_regs_used++;				\
+    }								\
+  *bufp = -1;							\
+  for (; regno < 16; regno++)					\
+    if (regs_ever_live[regno] && !call_used_regs[regno]) {	\
+      *fbufp++ = regno;						\
+    }								\
+  *fbufp = -1;							\
+  bufp = used_regs_buf;						\
+  if (frame_pointer_needed)					\
+    fprintf (FILE, "\tenter ");					\
+  else if (g_regs_used)						\
+    fprintf (FILE, "\tsave ");					\
+  if (frame_pointer_needed || g_regs_used)			\
+    {								\
+      char mask = 0;						\
+      while (*bufp >= 0)					\
+	mask |= 1 << *bufp++;					\
+      fprintf (FILE, "$0x%x", (int) mask & 0xff);		\
+    }								\
+  if (frame_pointer_needed)					\
+    fprintf (FILE, ",%d\n", SIZE);				\
+  else if (g_regs_used)						\
+    fprintf (FILE, "\n");					\
+  fbufp = used_fregs_buf;					\
+  while (*fbufp >= 0)						\
+    {								\
+      if ((*fbufp & 1) || (fbufp[0] != fbufp[1] - 1))		\
+	fprintf (FILE, "\tmovf f%d,tos\n", *fbufp++ - 8);	\
+      else							\
+	{							\
+	  fprintf (FILE, "\tmovl f%d,tos\n", fbufp[0] - 8);	\
+	  fbufp += 2;						\
+	}							\
+    }								\
+}
+
+#undef  FUNCTION_EPILOGUE
+
+/* This differs from the one in tm-ns32k.h in printing a bitmask
+   rather than a register list in the exit or restore instruction.  */
+
+#define FUNCTION_EPILOGUE(FILE, SIZE) \
+{ register int regno, g_regs_used = 0, f_regs_used = 0;		\
+  int used_regs_buf[8], *bufp = used_regs_buf;			\
+  int used_fregs_buf[8], *fbufp = used_fregs_buf;		\
+  extern char call_used_regs[];					\
+  *fbufp++ = -2;						\
+  for (regno = 8; regno < 16; regno++)				\
+    if (regs_ever_live[regno] && !call_used_regs[regno]) {	\
+       *fbufp++ = regno; f_regs_used++;				\
+    }								\
+  fbufp--;							\
+  for (regno = 0; regno < 8; regno++)				\
+    if (regs_ever_live[regno]					\
+	&& ! call_used_regs[regno])				\
+    {                                                         	\
+      *bufp++ = regno; g_regs_used++;				\
+    }                                                         	\
+  while (fbufp > used_fregs_buf)				\
+    {								\
+      if ((*fbufp & 1) && fbufp[0] == fbufp[-1] + 1)		\
+	{							\
+	  fprintf (FILE, "\tmovl tos,f%d\n", fbufp[-1] - 8);	\
+	  fbufp -= 2;						\
+	}							\
+      else fprintf (FILE, "\tmovf tos,f%d\n", *fbufp-- - 8);	\
+    }								\
+  if (frame_pointer_needed)					\
+    fprintf (FILE, "\texit ");					\
+  else if (g_regs_used)						\
+    fprintf (FILE, "\trestore ");				\
+  if (g_regs_used || frame_pointer_needed)			\
+    {								\
+      char mask = 0;						\
+								\
+      while (bufp > used_regs_buf)				\
+	{							\
+	  /* Utek assembler takes care of reversing this */	\
+	  mask |= 1 << *--bufp;					\
+	}							\
+      fprintf (FILE, "$0x%x\n", (int) mask & 0xff);		\
+    }								\
+  if (current_function_pops_args)				\
+    fprintf (FILE, "\tret %d\n", current_function_pops_args);	\
+  else fprintf (FILE, "\tret 0\n"); }
+
+#endif /* UTEK_ASM */
+
+#undef PRINT_OPERAND_ADDRESS
+#define PRINT_OPERAND_ADDRESS(FILE, ADDR)  print_operand_address(FILE, ADDR)
diff --git a/gcc/config/sparc/pbd.h b/gcc/config/sparc/pbd.h
new file mode 100644
index 000000000000..6c637ef7f328
--- /dev/null
+++ b/gcc/config/sparc/pbd.h
@@ -0,0 +1,148 @@
+/* Definitions of target machine for GNU compiler.
+
+   Citicorp/TTI Unicom PBD version
+   (using GAS and  COFF (encapsulated is unacceptable) )
+
+   Copyright (C) 1990 Free Software Foundation, Inc.
+
+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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#include "tm-sparc.h"
+
+/* Names to predefine in the preprocessor for this target machine.  */
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Dsparc -DUnicomPBD -Dunix"
+
+/* We want DBX format for use with gdb under COFF.  */
+
+#define DBX_DEBUGGING_INFO
+#define DBX_IN_COFF
+
+/* Generate calls to memcpy, memcmp and memset.  */
+
+#define TARGET_MEM_FUNCTIONS
+
+/* we use /lib/libp/lib*  when profiling */
+
+#undef LIB_SPEC
+#define LIB_SPEC "%{!shlib:%{p:-L/lib/libp} %{pg:-L/lib/libp} -lc} \
+   %{shlib:-lc_s crtn.o%s }"
+
+/* shared libraries need to use crt1.o  */
+
+#ifdef USE_GPLUS_IFILE
+#define STARTFILE_SPEC \
+  "g++.ifile%s %{!shlib:%{pg:mcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
+   %{shlib:crt1.o%s } "
+#else
+#define STARTFILE_SPEC \
+  "%{!shlib:%{pg:mcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
+   %{shlib:crt1.o%s } "
+#endif
+
+/* cpp has to support a #sccs directive for the /usr/include files */
+
+#define SCCS_DIRECTIVE
+
+#ifndef __GNUC__
+#define USE_C_ALLOCA
+#endif
+
+
+#undef  ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(FILE,NAME)	\
+  fprintf (FILE, "%s", NAME)
+
+/* fixes: */
+/*
+ *  Internal labels are prefixed with a period.
+ */
+
+/* This is how to store into the string LABEL
+   the symbol_ref name of an internal numbered label where
+   PREFIX is the class of label and NUM is the number within the class.
+   This is suitable for output with `assemble_name'.  */
+
+#undef ASM_GENERATE_INTERNAL_LABEL
+
+#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)                   \
+        sprintf (LABEL, "*.%s%d", PREFIX, NUM)
+
+
+/* This is how to output an internal numbered label where
+   PREFIX is the class of label and NUM is the number within the class.  */
+
+#undef  ASM_OUTPUT_INTERNAL_LABEL
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)                      \
+        fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
+
+/* This is how to output an element of a case-vector that is relative.  */
+
+#undef  ASM_OUTPUT_ADDR_DIFF_ELT
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
+  fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
+
+/* This is how to output an element of a case-vector that is absolute.
+   (The 68000 does not use such vectors,
+   but we must define this macro anyway.)  */
+
+#undef ASM_OUTPUT_ADDR_VEC_ELT
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
+  fprintf (FILE, "\t.word .L%d\n", VALUE)
+
+/* Underscores are not used on Unicom PBB coff systems. */
+#define NO_UNDERSCORES
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+   for profiling a function entry.  */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO)  \
+  fprintf (FILE, "\tsethi %%hi(.LP%d),%%o0\n\tcall mcount\n\tor %%lo(.LP%d),%%o0,%%o0\n", \
+	   (LABELNO), (LABELNO))
+
+/* Output assembler code to FILE to initialize this source file's
+   basic block profiling info, if that has not already been done.  */
+
+#undef FUNCTION_BLOCK_PROFILER
+#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO)  \
+  fprintf (FILE, "\tsethi %%hi(.LPBX0),%%o0\n\tld [%%lo(.LPBX0)+%%o0],%%o1\n\ttst %%o1\n\tbne .LPY%d\n\tnop\n\tcall ___bb_init_func\n\tnop\n.LPY%d:\n",  \
+	   (LABELNO), (LABELNO))
+
+/* Output assembler code to FILE to increment the entry-count for
+   the BLOCKNO'th basic block in this source file.  */
+
+#undef BLOCK_PROFILER
+#define BLOCK_PROFILER(FILE, BLOCKNO) \
+{								\
+  int blockn = (BLOCKNO);					\
+  fprintf (FILE, "\tsethi %%hi(.LPBX2+%d),%%g1\n\tld [%%lo(.LPBX2+%d)+%%g1],%%g2\n\
+\tadd %%g2,1,%%g2\n\tst %%g2,[%%lo(.LPBX2+%d)+%%g1]\n",		\
+	   4 * blockn, 4 * blockn, 4 * blockn);			\
+  CC_STATUS_INIT;  /* We have clobbered %g1.  Also %g2.  */	\
+}
+/*   This is needed for SunOS 4.0, and should not hurt for 3.2
+   versions either.  */
+#undef ASM_OUTPUT_SOURCE_LINE(file, line) 
+#define ASM_OUTPUT_SOURCE_LINE(file, line)		\
+  { static int sym_lineno = 1;				\
+    fprintf (file, ".stabn 68,0,%d,.LM%d\n.LM%d:\n",	\
+	     line, sym_lineno, sym_lineno);		\
+    sym_lineno += 1; }
+
+#define ASM_INT_OP ".long "
-- 
GitLab