[comp.sys.ncr] Patches to run GNU gcc 1.37.1 on Tower System V release 3.

ra@intsys.no (Robert Andersson) (10/21/90)

Again, this was posted rather than mailed due to popular demand.

Cheers, Robert.


#!/bin/sh
# This is a shell archive (shar 3.24)
# made 10/17/1990 19:24 UTC by ra@intsys.no
# Source directory /u/ra/gcc
#
# existing files will NOT be overwritten
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#    936 -rw-rw-rw- README
#   4137 -rw-rw-rw- patches
#  21994 -rw-rw-rw- tm-tower-as.h
#  17179 -rw-rw-rw- tm-tower-gc.h
#   3641 -rw-rw-rw- tm-tower.h
#    161 -rw-rw-rw- xm-tower.h
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= README ==============
if test X"$1" != X"-c" -a -f 'README'; then
	echo "File already exists: skipping 'README'"
else
echo "x - extracting README (Text)"
sed 's/^X//' << 'SHAR_EOF' > README &&
XChanges needed to bring gcc 1.37.1 up on an NCR Tower 32 running 
XSystem V release 3.
X
XThere is a total of four new files to be put in the config directory:
Xtm-tower.h
Xtm-tower-as.h
Xtm-tower-gc.h
Xxm-tower.h
X
XThe context diffs, patches, should be applied with Larry Wall's patch
Xprogram against a virgin 1.37.1 distribution.  They do the following:
Xa) Makefile has some comments added about porting to the Tower.
X   Two new configurable options to simplify having multiple gcc
X   versions is also added.
X   No changes that break other machines are done.
Xb) config.gcc has a section for the Tower added.
Xc) config/m68k.md has a small feature added.  This patch was lifted
X   from Michael Bloom's (mb@ttidca.tti.com) COFF patches.
X---
XRobert Andersson       Voice +47 2 371055       International Systems A/S
Xra@intsys.no           Fax   +47 2 356448       P.O. Box 3356
X...!{uunet,mcsun,nuug}!intsys.no!ra             0405 Oslo 4, NORWAY
SHAR_EOF
$TOUCH -am 1017202390 README &&
chmod 0666 README ||
echo "restore of README failed"
set `wc -c README`;Wc_c=$1
if test "$Wc_c" != "936"; then
	echo original size 936, current size $Wc_c
fi
fi
# ============= patches ==============
if test X"$1" != X"-c" -a -f 'patches'; then
	echo "File already exists: skipping 'patches'"
else
echo "x - extracting patches (Text)"
sed 's/^X//' << 'SHAR_EOF' > patches &&
X*** orig/Makefile	Fri Oct  5 21:00:57 1990
X--- Makefile	Wed Oct 17 19:46:15 1990
X***************
X*** 53,58 ****
X--- 53,66 ----
X  # Number to put in man-page filename.
X  manext = 1
X  
X+ # You only need to change these if you want to install multiple gcc versions
X+ # into $(libdir) and $(bindir).  An example would be one version making
X+ # output for the native as and another one for gas.
X+ # PREFIX = asgcc-
X+ # GCCBIN = asgcc
X+ PREFIX = gcc-
X+ GCCBIN = gcc
X+ 
X  # Additional system libraries to link with.
X  CLIB=
X  
X***************
X*** 87,92 ****
X--- 95,111 ----
X  # if you already have a prior version of gcc installed.
X  # CCLIBFLAGS = -B/usr/local/lib/gcc- -tp -Wp,-traditional
X  
X+ # On the NCR Tower 32 running SVR3, says ra@intsys.no :
X+ # Do *not* enable optimization in CFLAGS when using the native cc, because:
X+ # a) The optimizer seems to loop when invoked with -O2.
X+ # b) The -O1 level does stack/frame pointer optimizations that make the
X+ #    assembler alloca in libPW.a fail, and the C alloca eats *lots* of memory.
X+ # c) gcc will eventually be recompiled with itself, so all this doesn't matter.
X+ # CFLAGS = -g -O0
X+ # HARD_PARAMS_FLAGS = -O0
X+ # CCLIBFLAGS = -O2
X+ # CLIB = -lmalloc -lPW
X+ 
X  # If you are making gcc for the first time, and if you are compiling it with
X  # a non-gcc compiler, and if your system doesn't have a working alloca() in any
X  # of the standard libraries (as is true for HP/UX or Genix),
X***************
X*** 309,315 ****
X  gcc.o: gcc.c $(CONFIG_H)
X  	$(CC) $(CFLAGS) $(INCLUDES) \
X    -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
X!   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-\" -c \
X    `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
X  
X  version.o: version.c
X--- 328,334 ----
X  gcc.o: gcc.c $(CONFIG_H)
X  	$(CC) $(CFLAGS) $(INCLUDES) \
X    -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
X!   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/$(PREFIX)\" -c \
X    `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
X  
X  version.o: version.c
X***************
X*** 557,568 ****
X  # Copy the files into directories where they will be run.
X  install: all
X  	-mkdir $(libdir)
X! 	-if [ -f cc1 ] ; then $(INSTALL) cc1 $(libdir)/gcc-cc1 ;fi
X! 	-if [ -f cc1plus ] ; then $(INSTALL) cc1plus $(libdir)/gcc-cc1plus ;fi
X! 	$(INSTALL) gnulib $(libdir)/gcc-gnulib
X! 	-if [ -f /usr/bin/ranlib ] ; then (cd $(libdir); ranlib gcc-gnulib) ;fi
X! 	$(INSTALL) cpp $(libdir)/gcc-cpp
X! 	$(INSTALL) gcc $(bindir)
X  	-mkdir $(libdir)/gcc-include
X  	-chmod ugo+rx $(libdir)/gcc-include
X  	for file in $(USER_H); do \
X--- 576,587 ----
X  # Copy the files into directories where they will be run.
X  install: all
X  	-mkdir $(libdir)
X! 	-if [ -f cc1 ] ; then $(INSTALL) cc1 $(libdir)/$(PREFIX)cc1 ;fi
X! 	-if [ -f cc1plus ] ; then $(INSTALL) cc1plus $(libdir)/$(PREFIX)cc1plus ;fi
X! 	$(INSTALL) gnulib $(libdir)/$(PREFIX)gnulib
X! 	-if [ -f /usr/bin/ranlib ] ; then (cd $(libdir); ranlib $(PREFIX)gnulib) ;fi
X! 	$(INSTALL) cpp $(libdir)/$(PREFIX)cpp
X! 	$(INSTALL) gcc $(bindir)/$(GCCBIN)
X  	-mkdir $(libdir)/gcc-include
X  	-chmod ugo+rx $(libdir)/gcc-include
X  	for file in $(USER_H); do \
X*** orig/config.gcc	Fri Apr 27 16:21:00 1990
X--- config.gcc	Wed Oct 10 14:12:04 1990
X***************
X*** 261,266 ****
X--- 261,276 ----
X  	apollo68)
X  		cpu_type=m68k
X  		;;
X+ 	tower)        # NCR Tower 32 SVR3. as with sdb debugging.
X+ 		cpu_type=m68k
X+ 		target_machine=tm-tower-as.h
X+ 		configuration_file=xm-tower.h
X+ 		;;
X+ 	tower-gcoff)  # NCR Tower 32 SVR3. gas with gdb/stabs-in-COFF debugging.
X+ 		cpu_type=m68k
X+ 		target_machine=tm-tower-gc.h
X+ 		configuration_file=xm-tower.h
X+ 		;;
X  	pyr | pyramid)
X  		machine=pyr
X  		;;
X*** /dca/local/gnu/gcc/gcc-1.37.1/config/m68k.md	Mon May 28 19:32:18 1990
X--- ./config/m68k.md	Tue May 29 20:56:33 1990
X***************
X*** 3632,3637 ****
X--- 3632,3640 ----
X     (use (label_ref (match_operand 1 "" "")))]
X    ""
X    "*
X+ #ifdef ASM_RETURN_CASE_JUMP
X+  ASM_RETURN_CASE_JUMP;
X+ #else
X  #ifdef SGS
X  #ifdef ASM_OUTPUT_CASE_LABEL
X    return \"jmp 6(%%pc,%0.w)\";
X***************
X*** 3643,3648 ****
X--- 3646,3652 ----
X    return \"jmp (2,pc,%0.w)\";
X  #else
X    return \"jmp pc@(2,%0:w)\";
X+ #endif
X  #endif
X  #endif
X  ")
SHAR_EOF
$TOUCH -am 1017195690 patches &&
chmod 0666 patches ||
echo "restore of patches failed"
set `wc -c patches`;Wc_c=$1
if test "$Wc_c" != "4137"; then
	echo original size 4137, current size $Wc_c
fi
fi
# ============= tm-tower-as.h ==============
if test X"$1" != X"-c" -a -f 'tm-tower-as.h'; then
	echo "File already exists: skipping 'tm-tower-as.h'"
else
echo "x - extracting tm-tower-as.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > tm-tower-as.h &&
X/* Definitions of target machine for GNU compiler.
X   Copyright (C) 1990 Free Software Foundation, Inc.
X
X   Written by Robert Andersson, International Systems, Oslo, Norway.
X   Send bug reports, questions and improvements to ra@intsys.no.
X
X   For NCR Tower 32/4x0 and 32/6x0 running System V Release 3.
X   This file outputs assembler source suitable for the native Tower as
X   and with sdb debugging symbols.  See tm-tower.h for more comments.
X
X   This file was based on tm-m68k.h, tm-hp9k320.h and tm-3b1.h
X   as of the 1.37.1 version.
X
X
XThis file is part of GNU CC.
X
XGNU CC is free software; you can redistribute it and/or modify
Xit under the terms of the GNU General Public License as published by
Xthe Free Software Foundation; either version 1, or (at your option)
Xany later version.
X
XGNU CC is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
XGNU General Public License for more details.
X
XYou should have received a copy of the GNU General Public License
Xalong with GNU CC; see the file COPYING.  If not, write to
Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
X
X
X#include "tm-tower.h"
X
X
X/* Define __HAVE_68881 in preprocessor only if -m68881 is specified.
X   This will control the use of inline 68881 insns in certain macros.
X   Also, define special define used to identify the Tower assembler.  */
X
X#define CPP_SPEC "-D__TOWER_ASM__ %{m68881:-D__HAVE_68881__}"
X
X/* The startfiles and libraries depend on the -p and -m68881 options.
X   The Tower does not support the -pg option.  */
X
X#define STARTFILE_SPEC                                         \
X"%{p:%{m68881:/usr/lib/fp/mcrt1.o}%{!m68881:/lib/mcrt1.o}}     \
X %{!p:%{m68881:/usr/lib/fp/crt1.o}%{!m68881:/lib/crt1.o}}"
X
X/* These four macros control how m68k.md is expanded.  */
X
X#define MOTOROLA
X#define SGS
X#define SONY_ASM
X#define HPUX_ASM
X
X/* Turn on SDB debugging info.  */
X
X#define SDB_DEBUGGING_INFO
X
X/* This is only useful if gdb is changed, but doesn't harm anyway.  */
X
X#define ASM_IDENTIFY_GCC(FILE) \
X  fprintf (FILE, "gcc_compiled%%:\n")
X
X/* All the ASM_OUTPUT macros need to conform to the Tower as syntax.  */
X
X#define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
X  fprintf (FILE, "\tfile\t\"%s\"\n", FILENAME)
X
X#define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)	\
X  fprintf (FILE, "\tln\t%d\n",			\
X	   (sdb_begin_function_line		\
X	    ? last_linenum - sdb_begin_function_line : 1))
X
X#define ASM_OUTPUT_IDENT(FILE, NAME) \
X  fprintf (FILE, "\tident\t\"%s\" \n", NAME)
X
X#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
X  { register int sp = 0, lp = 0; \
X    fprintf (FILE, "\tbyte\t"); \
X  loop: \
X    if (PTR[sp] > ' ' && ! (PTR[sp] & 0x80) && PTR[sp] != '\\') \
X      { lp += 3; \
X	fprintf (FILE, "'%c", PTR[sp]); } \
X    else \
X      { lp += 5; \
X	fprintf (FILE, "0x%x", PTR[sp]); } \
X    if (++sp < LEN) \
X      {	if (lp > 60) \
X	  { lp = 0; \
X	    fprintf (FILE, "\n\tbyte\t"); }	\
X	else \
X	  putc (',', FILE); \
X	goto loop; } \
X    putc ('\n', FILE); }
X
X/* Translate Motorola opcodes such as `jbeq'
X   into SGS/Tower opcodes such as `beq.w'.
X   Change `move' to `mov'.
X   Change `cmpm' to `cmp'.
X   Change `divsl' to `tdivs'.
X   Change `divul' to `tdivu'.
X   Change `ftst' to `ftest'.
X   Change `fmove' to `fmov'.  */
X
X#define ASM_OUTPUT_OPCODE(FILE, PTR)			\
X{ if ((PTR)[0] == 'j' && (PTR)[1] == 'b')		\
X    { ++(PTR);						\
X      while (*(PTR) != ' ')				\
X	{ putc (*(PTR), (FILE)); ++(PTR); }		\
X      fprintf ((FILE), ".w"); }				\
X  else if ((PTR)[0] == 'm' && (PTR)[1] == 'o'		\
X	   && (PTR)[2] == 'v' && (PTR)[3] == 'e')	\
X    { fprintf ((FILE), "mov"); (PTR) += 4; }		\
X  else if ((PTR)[0] == 'c' && (PTR)[1] == 'm'		\
X	   && (PTR)[2] == 'p' && (PTR)[3] == 'm')	\
X    { fprintf ((FILE), "cmp"); (PTR) += 4; }		\
X  else if ((PTR)[0] == 'd' && (PTR)[1] == 'i'		\
X	   && (PTR)[2] == 'v' && (PTR)[3] == 's'	\
X	   && (PTR)[4] == 'l')				\
X    { fprintf ((FILE), "tdivs"); (PTR) += 5; }		\
X  else if ((PTR)[0] == 'd' && (PTR)[1] == 'i'		\
X	   && (PTR)[2] == 'v' && (PTR)[3] == 'u'	\
X	   && (PTR)[4] == 'l')				\
X    { fprintf ((FILE), "tdivu"); (PTR) += 5; }		\
X  else if ((PTR)[0] == 'f' && (PTR)[1] == 't'		\
X	   && (PTR)[2] == 's' && (PTR)[3] == 't')	\
X    { fprintf ((FILE), "ftest"); (PTR) += 4; }		\
X  else if ((PTR)[0] == 'f' && (PTR)[1] == 'm'		\
X	   && (PTR)[2] == 'o' && (PTR)[3] == 'v' 	\
X	   && (PTR)[4] == 'e')				\
X    { fprintf ((FILE), "fmov"); (PTR) += 5; }		\
X}
X
X
X
X/* Override parts of tm-m68k.h to fit the Tower assembler.
X   This section needs to track changes done to tm-m68k.h in the future.  */
X
X#undef TARGET_VERSION
X#define TARGET_VERSION fprintf (stderr, " (68k, Motorola/SGS/Tower32 syntax)");
X
X#undef BLOCK_PROFILER
X#undef FUNCTION_BLOCK_PROFILER
X#undef FUNCTION_PROFILER
X#define FUNCTION_PROFILER(FILE, LABEL_NO)	\
X    fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount%%\n", (LABEL_NO))
X
X/* The prologue is identical to the one in tm-m68k.h except that the
X   assembler syntax is different.  */
X
X#undef FUNCTION_PROLOGUE
X#define FUNCTION_PROLOGUE(FILE, SIZE)     \
X{ register int regno;						\
X  register int mask = 0;					\
X  extern char call_used_regs[];					\
X  int fsize = ((SIZE) + 3) & -4;				\
X  if (frame_pointer_needed)					\
X    { if (TARGET_68020 || fsize < 0x8000)			\
X        fprintf (FILE, "\tlink %%a6,&%d\n", -fsize);		\
X      else							\
X	fprintf (FILE, "\tlink %%a6,&0\n\tsub.l &%d,%%sp\n", fsize); }  \
X  for (regno = 24; regno < 56; regno++)                         \
X    if (regs_ever_live[regno] && ! call_used_regs[regno])       \
X      fprintf(FILE, "\tfpmoved %s,-(%%sp)\n",                   \
X	      reg_names[regno]);                                \
X  for (regno = 16; regno < 24; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X       mask |= 1 << (regno - 16);				\
X  if ((mask & 0xff) != 0)					\
X    fprintf (FILE, "\tfmovm &0x%x,-(%%sp)\n", mask & 0xff);     \
X  mask = 0;							\
X  for (regno = 0; regno < 16; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X       mask |= 1 << (15 - regno);				\
X  if (frame_pointer_needed)					\
X    mask &= ~ (1 << (15-FRAME_POINTER_REGNUM));			\
X  if (exact_log2 (mask) >= 0)					\
X    fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[15 - exact_log2 (mask)]); \
X  else if (mask) fprintf (FILE, "\tmovm.l &0x%x,-(%%sp)\n", mask); }
X
X/* The epilogue is identical to the one in tm-m68k.h except that:
X   a) The assembler syntax is different.
X   b) Pointers are returned both in %d0 and %a0.
X   c) FUNCTION_EXTRA_EPILOGUE is not needed.  */
X
X#undef FUNCTION_EPILOGUE
X#define FUNCTION_EPILOGUE(FILE, SIZE) \
X{ register int regno;						\
X  register int mask, fmask;					\
X  register int nregs;						\
X  int offset, foffset, fpoffset;   	                        \
X  extern char call_used_regs[];					\
X  extern int current_function_pops_args;			\
X  extern int current_function_args_size;			\
X  extern int current_function_returns_pointer;                  \
X  int fsize = ((SIZE) + 3) & -4;				\
X  int big = 0;							\
X  nregs = 0;  fmask = 0; fpoffset = 0;  			\
X  for (regno = 24 ; regno < 56 ; regno++)			\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X      nregs++;							\
X  fpoffset = nregs*8;						\
X  nregs = 0;							\
X  for (regno = 16; regno < 24; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X      { nregs++; fmask |= 1 << (23 - regno); }			\
X  foffset = fpoffset + nregs * 12;				\
X  nregs = 0;  mask = 0;						\
X  if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
X  for (regno = 0; regno < 16; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X      { nregs++; mask |= 1 << regno; }				\
X  offset = foffset + nregs * 4;					\
X  if (offset + fsize >= 0x8000 					\
X      && frame_pointer_needed 					\
X      && (mask || fmask || fpoffset)) 				\
X    { fprintf (FILE, "\tmov.l &%d,%%a0\n", -fsize);		\
X      fsize = 0, big = 1; }					\
X  if (exact_log2 (mask) >= 0) {					\
X    if (big)							\
X      fprintf (FILE, "\tmov.l -%d(%%a6,%%a0.l),%s\n",		\
X	       offset + fsize, reg_names[exact_log2 (mask)]);	\
X    else if (! frame_pointer_needed)				\
X      fprintf (FILE, "\tmov.l (%%sp)+,%s\n",			\
X	       reg_names[exact_log2 (mask)]);			\
X    else							\
X      fprintf (FILE, "\tmov.l -%d(%%a6),%s\n",			\
X	       offset + fsize, reg_names[exact_log2 (mask)]); }	\
X  else if (mask) {						\
X    if (big)							\
X      fprintf (FILE, "\tmovm.l -%d(%%a6,%%a0.l),&0x%x\n",	\
X	       offset + fsize, mask);				\
X    else if (! frame_pointer_needed)				\
X      fprintf (FILE, "\tmovm.l (%%sp)+,&0x%x\n", mask);		\
X    else							\
X      fprintf (FILE, "\tmovm.l -%d(%%a6),&0x%x\n",		\
X	       offset + fsize, mask); }				\
X  if (fmask) {							\
X    if (big)							\
X      fprintf (FILE, "\tfmovm -%d(%%a6,%%a0.l),&0x%x\n",	\
X	       foffset + fsize, fmask);				\
X    else if (! frame_pointer_needed)				\
X      fprintf (FILE, "\tfmovm (%%sp)+,&0x%x\n", fmask);		\
X    else							\
X      fprintf (FILE, "\tfmovm -%d(%%a6),&0x%x\n",		\
X	       foffset + fsize, fmask); }			\
X  if (fpoffset != 0)						\
X    for (regno = 55; regno >= 24; regno--)			\
X      if (regs_ever_live[regno] && ! call_used_regs[regno]) {	\
X	if (big)						\
X	  fprintf(FILE, "\tfpmoved -%d(%%a6,%%a0.l),%s\n",	\
X		  fpoffset + fsize, reg_names[regno]);		\
X	else if (! frame_pointer_needed)			\
X	  fprintf(FILE, "\tfpmoved (%%sp)+,%s\n",		\
X		  reg_names[regno]);				\
X	else							\
X	  fprintf(FILE, "\tfpmoved -%d(%%a6),%s\n",		\
X		  fpoffset + fsize, reg_names[regno]);		\
X	fpoffset -= 8;						\
X      }								\
X  if (current_function_returns_pointer)                         \
X    fprintf (FILE, "\tmov.l %%d0,%%a0\n");                      \
X  if (frame_pointer_needed)					\
X    fprintf (FILE, "\tunlk %%a6\n");				\
X  if (current_function_pops_args && current_function_args_size)	\
X    fprintf (FILE, "\trtd &%d\n", current_function_args_size);	\
X  else fprintf (FILE, "\trts\n"); }
X
X/* This is how to output an insn to push a register on the stack.
X   It need not be very fast code.  */
X
X#undef ASM_OUTPUT_REG_PUSH
X#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
X  fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
X
X/* This is how to output an insn to pop a register from the stack.
X   It need not be very fast code.  */
X
X#undef ASM_OUTPUT_REG_POP
X#define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
X  fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
X
X#undef ASM_FILE_START
X#define ASM_FILE_START(FILE) \
X( fprintf (FILE, "#NO_APP\n"), \
X  sdbout_filename ((FILE), main_input_filename))
X
X#undef TEXT_SECTION_ASM_OP
X#define TEXT_SECTION_ASM_OP "\ttext"
X
X#undef DATA_SECTION_ASM_OP
X#define DATA_SECTION_ASM_OP "\tdata"
X
X/* This says how to output an assembler line to define a global common symbol.
X   We use SIZE rather than ROUNDED, as this is what the native cc does.  */
X
X#undef ASM_OUTPUT_COMMON
X#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
X( fputs ("\tcomm ", (FILE)),			\
X  assemble_name ((FILE), (NAME)),		\
X  fprintf ((FILE), ",%d\n", ((SIZE) == 0) ? (ROUNDED) : (SIZE)))
X
X/* This says how to output an assembler line to define a local common symbol.
X   We use SIZE rather than ROUNDED, as this is what the native cc does.  */
X
X#undef ASM_OUTPUT_LOCAL
X#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
X( fputs ("\tlcomm ", (FILE)),			\
X  assemble_name ((FILE), (NAME)),		\
X  fprintf ((FILE), ",%d\n", ((SIZE) == 0) ? (ROUNDED) : (SIZE)))
X
X/* Store in OUTPUT a string (made with alloca) containing
X   an assembler-name for a local static variable named NAME.
X   LABELNO is an integer which is different for each call.  */
X
X#undef ASM_FORMAT_PRIVATE_NAME
X#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)	\
X( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 11),	\
X  sprintf ((OUTPUT), "%s%%%%%d", (NAME), (LABELNO)))
X
X/* This is how to output a command to make the user-level label named NAME
X   defined for reference from other files.  */
X
X#undef ASM_GLOBALIZE_LABEL
X#define ASM_GLOBALIZE_LABEL(FILE,NAME)	\
Xdo { fputs ("\tglobal ", FILE);         \
X     assemble_name (FILE, NAME);        \
X     fputs ("\n", FILE);                \
X   } while (0)
X
X#undef ASM_GENERATE_INTERNAL_LABEL
X#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)	\
X  sprintf ((LABEL), "%s%%%d", (PREFIX), (NUM))
X
X#undef ASM_OUTPUT_INTERNAL_LABEL
X#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
X  fprintf ((FILE), "%s%%%d:\n", (PREFIX), (NUM))
X
X#undef ASM_OUTPUT_CASE_LABEL
X#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE)			\
X  fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n",				\
X           XVECLEN (PATTERN (TABLE), 1), (PREFIX), (NUM));		\
X
X#undef ASM_OUTPUT_DOUBLE
X#define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \
Xdo { union { double d; long l[2]; } tem;		\
X     tem.d = (VALUE);					\
X     fprintf(FILE, "\tlong 0x%x,0x%x\n", tem.l[0], tem.l[1]); \
X   } while (0)
X
X#undef ASM_OUTPUT_FLOAT
X#define ASM_OUTPUT_FLOAT(FILE,VALUE)  \
Xdo { union { float f; long l;} tem;			\
X     tem.f = (VALUE);					\
X     fprintf (FILE, "\tlong 0x%x\n", tem.l);	\
X   } while (0)
X
X/* This is how to output an assembler line defining an `int' constant.  */
X
X#undef ASM_OUTPUT_INT
X#define ASM_OUTPUT_INT(FILE,VALUE)  \
X( fprintf (FILE, "\tlong "),			\
X  output_addr_const (FILE, (VALUE)),		\
X  fprintf (FILE, "\n"))
X
X/* Likewise for `char' and `short' constants.  */
X
X#undef ASM_OUTPUT_SHORT
X#define ASM_OUTPUT_SHORT(FILE,VALUE)  \
X( fprintf (FILE, "\tshort "),			\
X  output_addr_const (FILE, (VALUE)),		\
X  fprintf (FILE, "\n"))
X
X#undef ASM_OUTPUT_CHAR
X#define ASM_OUTPUT_CHAR(FILE,VALUE)  \
X( fprintf (FILE, "\tbyte "),			\
X  output_addr_const (FILE, (VALUE)),		\
X  fprintf (FILE, "\n"))
X
X/* This is how to output an assembler line for a numeric constant byte.  */
X
X#undef ASM_OUTPUT_BYTE
X#define ASM_OUTPUT_BYTE(FILE,VALUE)  \
X  fprintf (FILE, "\tbyte 0x%x\n", (VALUE))
X
X#undef ASM_OUTPUT_ADDR_VEC_ELT
X#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
X  fprintf (FILE, "\tlong L%%%d\n", (VALUE))
X
X#undef ASM_OUTPUT_ADDR_DIFF_ELT
X#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
X  fprintf (FILE, "\tshort L%%%d-L%%%d\n", (VALUE), (REL))
X
X#undef ASM_OUTPUT_ALIGN
X#define ASM_OUTPUT_ALIGN(FILE,LOG)	\
X  if ((LOG) == 1)			\
X    fprintf (FILE, "\teven\n");	        \
X  else if ((LOG) != 0)			\
X    abort ();
X
X#undef ASM_OUTPUT_SKIP
X#define ASM_OUTPUT_SKIP(FILE,SIZE)  \
X  fprintf (FILE, "\tspace %d\n", (SIZE))
X
X#undef PRINT_OPERAND
X#define PRINT_OPERAND(FILE, X, CODE)  \
X{ if (CODE == '.') fprintf (FILE, ".");					\
X  else if (CODE == '#') fprintf (FILE, "&");				\
X  else if (CODE == '-') fprintf (FILE, "-(%%sp)");			\
X  else if (CODE == '+') fprintf (FILE, "(%%sp)+");			\
X  else if (CODE == '@') fprintf (FILE, "(%%sp)");			\
X  else if (CODE == '!') fprintf (FILE, "%%cc");				\
X  else if (GET_CODE (X) == REG)						\
X    fprintf (FILE, "%s", reg_names[REGNO (X)]);				\
X  else if (GET_CODE (X) == MEM)						\
X    output_address (XEXP (X, 0));					\
X  else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode)	\
X    { union { double d; int i[2]; } u;					\
X      union { float f; int i; } u1;					\
X      u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X);	\
X      u1.f = u.d;							\
X      fprintf (FILE, "&0x%x", u1.i); }				        \
X  else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode)	\
X      fprintf (FILE, "&0x%x%08x", CONST_DOUBLE_LOW (X), CONST_DOUBLE_HIGH (X));\
X  else { putc ('&', FILE); output_addr_const (FILE, X); }}
X
X/* Note that this contains a kludge that knows that the only reason
X   we have an address (plus (label_ref...) (reg...))
X   is in the insn before a tablejump, and we know that the table is
X   exactly 10 bytes away.  */
X
X#undef PRINT_OPERAND_ADDRESS
X#define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
X{ register rtx reg1, reg2, breg, ireg;					\
X  register rtx addr = ADDR;						\
X  rtx offset;								\
X  switch (GET_CODE (addr))						\
X    {									\
X    case REG:								\
X      fprintf (FILE, "(%s)", reg_names[REGNO (addr)]);			\
X      break;								\
X    case PRE_DEC:							\
X      fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]);	\
X      break;								\
X    case POST_INC:							\
X      fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]);	\
X      break;								\
X    case PLUS:								\
X      reg1 = 0;	reg2 = 0;						\
X      ireg = 0;	breg = 0;						\
X      offset = 0;							\
X      if (CONSTANT_ADDRESS_P (XEXP (addr, 0)))				\
X	{								\
X	  offset = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (CONSTANT_ADDRESS_P (XEXP (addr, 1)))			\
X	{								\
X	  offset = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      if (GET_CODE (addr) != PLUS) ;					\
X      else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND)		\
X	{								\
X	  reg1 = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND)		\
X	{								\
X	  reg1 = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 0)) == MULT)			\
X	{								\
X	  reg1 = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 1)) == MULT)			\
X	{								\
X	  reg1 = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 0)) == REG)			\
X	{								\
X	  reg1 = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 1)) == REG)			\
X	{								\
X	  reg1 = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT		\
X	  || GET_CODE (addr) == SIGN_EXTEND)				\
X	{ if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; }	\
X/*  for OLD_INDEXING							\
X      else if (GET_CODE (addr) == PLUS)					\
X	{								\
X	  if (GET_CODE (XEXP (addr, 0)) == REG)				\
X	    {								\
X	      reg2 = XEXP (addr, 0);					\
X	      addr = XEXP (addr, 1);					\
X	    }								\
X	  else if (GET_CODE (XEXP (addr, 1)) == REG)			\
X	    {								\
X	      reg2 = XEXP (addr, 1);					\
X	      addr = XEXP (addr, 0);					\
X	    }								\
X	}								\
X  */									\
X      if (offset != 0) { if (addr != 0) abort (); addr = offset; }	\
X      if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND			\
X		    || GET_CODE (reg1) == MULT))			\
X	  || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2))))		\
X	{ breg = reg2; ireg = reg1; }					\
X      else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1)))		\
X	{ breg = reg1; ireg = reg2; }					\
X      if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF)	\
X        { int scale = 1;						\
X	  if (GET_CODE (ireg) == MULT)					\
X	    { scale = INTVAL (XEXP (ireg, 1));				\
X	      ireg = XEXP (ireg, 0); }					\
X	  if (GET_CODE (ireg) == SIGN_EXTEND)				\
X	    fprintf (FILE, "10(%%pc,%s.w",				\
X		     reg_names[REGNO (XEXP (ireg, 0))]); 		\
X	  else								\
X	    fprintf (FILE, "10(%%pc,%s.l",				\
X		     reg_names[REGNO (ireg)]);				\
X	  if (scale != 1) fprintf (FILE, "*%d", scale);			\
X	  putc (')', FILE);						\
X	  break; }							\
X      if (ireg != 0 || breg != 0)					\
X	{ int scale = 1;						\
X	  if (breg == 0)						\
X	    abort ();							\
X	  if (addr != 0)						\
X	    output_addr_const (FILE, addr);				\
X	  fprintf (FILE, "(%s", reg_names[REGNO (breg)]);		\
X	  if (ireg != 0)						\
X	    putc (',', FILE);						\
X	  if (ireg != 0 && GET_CODE (ireg) == MULT)			\
X	    { scale = INTVAL (XEXP (ireg, 1));				\
X	      ireg = XEXP (ireg, 0); }					\
X	  if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND)		\
X	    fprintf (FILE, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]);	\
X	  else if (ireg != 0)						\
X	    fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]);		\
X	  if (scale != 1) fprintf (FILE, "*%d", scale);			\
X	  putc (')', FILE);						\
X	  break;							\
X	}								\
X      else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF)		\
X	{ fprintf (FILE, "10(%%pc,%s.w)",				\
X		   reg_names[REGNO (reg1)]);				\
X	  break; }							\
X    default:								\
X        output_addr_const (FILE, addr);					\
X    }}
X
X
X
X/* Override usual definitions of SDB output macros.
X   These definitions differ only in the absence of the period
X   at the beginning of the name of the directive
X   and in the use of `~' as the symbol for the current location.  */
X
X#define PUT_SDB_SCL(a) fprintf(asm_out_file, "\tscl\t%d;", (a))
X#define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\tval\t%d;", (a))
X#define PUT_SDB_VAL(a)				\
X( fputs ("\tval\t", asm_out_file),		\
X  output_addr_const (asm_out_file, (a)),	\
X  fputc (';', asm_out_file))
X
X#define PUT_SDB_DEF(a)				\
Xdo { fprintf (asm_out_file, "\tdef\t");	\
X     ASM_OUTPUT_LABELREF (asm_out_file, a); 	\
X     fprintf (asm_out_file, ";"); } while (0)
X
X#define PUT_SDB_PLAIN_DEF(a) fprintf(asm_out_file,"\tdef\t~%s;",a)
X#define PUT_SDB_ENDEF fputs("\tendef\n", asm_out_file)
X#define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\ttype\t0%o;", a)
X#define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\tsize\t%d;", a)
X#define PUT_SDB_DIM(a) fprintf(asm_out_file, "\tdim\t%d;", a)
X
X#define PUT_SDB_TAG(a)				\
Xdo { fprintf (asm_out_file, "\ttag\t");	\
X     ASM_OUTPUT_LABELREF (asm_out_file, a);	\
X     fprintf (asm_out_file, ";"); } while (0)
X
X#define PUT_SDB_BLOCK_START(LINE)		\
X  fprintf (asm_out_file,			\
X	   "\tdef\t~bb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n",	\
X	   (LINE))
X
X#define PUT_SDB_BLOCK_END(LINE)			\
X  fprintf (asm_out_file,			\
X	   "\tdef\t~eb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n",	\
X	   (LINE))
X
X#define PUT_SDB_FUNCTION_START(LINE)		\
X  fprintf (asm_out_file,			\
X	   "\tdef\t~bf;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n",	\
X	   (LINE))
X
X#define PUT_SDB_FUNCTION_END(LINE)		\
X  fprintf (asm_out_file,			\
X	   "\tdef\t~ef;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n",	\
X	   (LINE))
X
X#define PUT_SDB_EPILOGUE_END(NAME)		\
X  fprintf (asm_out_file,			\
X	   "\tdef\t%s;\tval\t~;\tscl\t-1;\tendef\n",	\
X	   (NAME))
X
X#define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
X  sprintf ((BUFFER), "~%dfake", (NUMBER));
SHAR_EOF
$TOUCH -am 1017201990 tm-tower-as.h &&
chmod 0666 tm-tower-as.h ||
echo "restore of tm-tower-as.h failed"
set `wc -c tm-tower-as.h`;Wc_c=$1
if test "$Wc_c" != "21994"; then
	echo original size 21994, current size $Wc_c
fi
fi
# ============= tm-tower-gc.h ==============
if test X"$1" != X"-c" -a -f 'tm-tower-gc.h'; then
	echo "File already exists: skipping 'tm-tower-gc.h'"
else
echo "x - extracting tm-tower-gc.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > tm-tower-gc.h &&
X/* Definitions of target machine for GNU compiler.
X   Copyright (C) 1990 Free Software Foundation, Inc.
X
X   Written by Robert Andersson, International Systems, Oslo, Norway.
X   Send bug reports, questions and improvements to ra@intsys.no.
X
X   For NCR Tower 32/4x0 and 32/6x0 running System V Release 3.
X   This file outputs assembler source suitable for the GNU gas assembler
X   and with stabs in COFF debugging symbols.  See tm-tower.h for more comments.
X
X   For the gcc 1.37.1 and gas 1.36 distributions you need Michael Bloom's 
X   (mb@ttidca.tti.com) COFF patches for this to work.  These patches might
X   be merged into future gcc and gas releases?
X   You must at least see to the following:
X   a) m68k.md must recognize the ASM_RETURN_CASE_JUMP macro.
X   b) gas is configured to output COFF files as a default, and to accept
X      a leading % character in register names and a leading . in local labels.
X
X   This file was based on tm-m68k.h as of the 1.37.1 version, and tm-pbb.h
X   from the COFF patches.
X
X
XThis file is part of GNU CC.
X
XGNU CC is free software; you can redistribute it and/or modify
Xit under the terms of the GNU General Public License as published by
Xthe Free Software Foundation; either version 1, or (at your option)
Xany later version.
X
XGNU CC is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
XGNU General Public License for more details.
X
XYou should have received a copy of the GNU General Public License
Xalong with GNU CC; see the file COPYING.  If not, write to
Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
X
X
X#include "tm-tower.h"
X
X
X/* Define __HAVE_68881 in preprocessor only if -m68881 is specified.
X   This will control the use of inline 68881 insns in certain macros.  */
X
X#define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
X
X/* -m68000 requires special flag to the assembler.  */
X
X#define ASM_SPEC "%{m68000:-mc68010}%{mc68000:-mc68010}"
X
X/* The startfiles and libraries depend on the -p and -m68881 options.
X   The Tower does not support the -pg option.  */
X
X#ifdef USE_GPLUS_IFILE
X#define STARTFILE_SPEC                                                     \
X"g++.ifile%s %{p:%{m68881:/usr/lib/fp/mcrt1.o}%{!m68881:/lib/mcrt1.o}}     \
X %{!p:%{m68881:/usr/lib/fp/crt1.o}%{!m68881:/lib/crt1.o}}"
X#else
X#define STARTFILE_SPEC                                         \
X"%{p:%{m68881:/usr/lib/fp/mcrt1.o}%{!m68881:/lib/mcrt1.o}}     \
X %{!p:%{m68881:/usr/lib/fp/crt1.o}%{!m68881:/lib/crt1.o}}"
X#endif
X
X/* Turn on DBX debugging info.  */
X
X#define DBX_DEBUGGING_INFO
X
X/* This is only used in g++.  */
X
X#define DBX_IN_COFF
X
X/* gas doesn't support ident.  */
X
X#define ASM_OUTPUT_IDENT(FILE, NAME)
X
X/* Override m68k.md, use %pc rather than pc.  */
X
X#define ASM_RETURN_CASE_JUMP	return "jmp %%pc@(2,%0:w)"
X
X
X
X/* Override parts of tm-m68k.h to fit the COFF gas.
X   This section needs to track changes done to tm-m68k.h in the future.  */
X
X#undef BLOCK_PROFILER
X#undef FUNCTION_BLOCK_PROFILER
X#undef FUNCTION_PROFILER
X#define FUNCTION_PROFILER(FILE, LABEL_NO)	\
X  fprintf (FILE, "\tlea .LP%d,%%a0\n\tjbsr mcount%%\n", (LABEL_NO))
X
X/* The prologue is identical to the one in tm-m68k.h except that the
X   assembler syntax is different.  */
X
X#undef FUNCTION_PROLOGUE
X#define FUNCTION_PROLOGUE(FILE, SIZE)     \
X{ register int regno;						\
X  register int mask = 0;					\
X  extern char call_used_regs[];					\
X  int fsize = ((SIZE) + 3) & -4;				\
X  if (frame_pointer_needed)					\
X    { if (TARGET_68020 || fsize < 0x8000)			\
X        fprintf (FILE, "\tlink %%a6,#%d\n", -fsize);		\
X      else							\
X	fprintf (FILE, "\tlink %%a6,#0\n\tsubl #%d,%%sp\n", fsize); }  \
X  for (regno = 24; regno < 56; regno++)                         \
X    if (regs_ever_live[regno] && ! call_used_regs[regno])       \
X      fprintf(FILE, "\tfpmoved %s,%%sp@-\n",                    \
X	      reg_names[regno]);                                \
X  for (regno = 16; regno < 24; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X       mask |= 1 << (regno - 16);				\
X  if ((mask & 0xff) != 0)					\
X    fprintf (FILE, "\tfmovem #0x%x,%%sp@-\n", mask & 0xff);     \
X  mask = 0;							\
X  for (regno = 0; regno < 16; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X       mask |= 1 << (15 - regno);				\
X  if (frame_pointer_needed)					\
X    mask &= ~ (1 << (15-FRAME_POINTER_REGNUM));			\
X  if (exact_log2 (mask) >= 0)					\
X    fprintf (FILE, "\tmovel %s,%%sp@-\n", reg_names[15 - exact_log2 (mask)]); \
X  else if (mask) fprintf (FILE, "\tmoveml #0x%x,%%sp@-\n", mask); }
X
X/* The epilogue is identical to the one in tm-m68k.h except that:
X   a) The assembler syntax is different.
X   b) Pointers are returned both in %d0 and %a0.
X   c) FUNCTION_EXTRA_EPILOGUE is not needed.  */
X
X#undef FUNCTION_EPILOGUE
X#define FUNCTION_EPILOGUE(FILE, SIZE) \
X{ register int regno;						\
X  register int mask, fmask;					\
X  register int nregs;						\
X  int offset, foffset, fpoffset;   	                        \
X  extern char call_used_regs[];					\
X  extern int current_function_pops_args;			\
X  extern int current_function_args_size;			\
X  extern int current_function_returns_pointer;                  \
X  int fsize = ((SIZE) + 3) & -4;				\
X  int big = 0;							\
X  nregs = 0;  fmask = 0; fpoffset = 0;  			\
X  for (regno = 24 ; regno < 56 ; regno++)			\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X      nregs++;							\
X  fpoffset = nregs*8;						\
X  nregs = 0;							\
X  for (regno = 16; regno < 24; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X      { nregs++; fmask |= 1 << (23 - regno); }			\
X  foffset = fpoffset + nregs * 12;				\
X  nregs = 0;  mask = 0;						\
X  if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
X  for (regno = 0; regno < 16; regno++)				\
X    if (regs_ever_live[regno] && ! call_used_regs[regno])	\
X      { nregs++; mask |= 1 << regno; }				\
X  offset = foffset + nregs * 4;					\
X  if (offset + fsize >= 0x8000 					\
X      && frame_pointer_needed 					\
X      && (mask || fmask || fpoffset)) 				\
X    { fprintf (FILE, "\tmovel #%d,%%a0\n", -fsize);		\
X      fsize = 0, big = 1; }					\
X  if (exact_log2 (mask) >= 0) {					\
X    if (big)							\
X      fprintf (FILE, "\tmovel %%a6@(-%d,%%a0:l),%s\n",		\
X	       offset + fsize, reg_names[exact_log2 (mask)]);	\
X    else if (! frame_pointer_needed)				\
X      fprintf (FILE, "\tmovel %%sp@+,%s\n",			\
X	       reg_names[exact_log2 (mask)]);			\
X    else							\
X      fprintf (FILE, "\tmovel %%a6@(-%d),%s\n",			\
X	       offset + fsize, reg_names[exact_log2 (mask)]); }	\
X  else if (mask) {						\
X    if (big)							\
X      fprintf (FILE, "\tmoveml %%a6@(-%d,%%a0:l),#0x%x\n",	\
X	       offset + fsize, mask);				\
X    else if (! frame_pointer_needed)				\
X      fprintf (FILE, "\tmoveml %%sp@+,#0x%x\n", mask);		\
X    else							\
X      fprintf (FILE, "\tmoveml %%a6@(-%d),#0x%x\n",		\
X	       offset + fsize, mask); }				\
X  if (fmask) {							\
X    if (big)							\
X      fprintf (FILE, "\tfmovem %%a6@(-%d,%%a0:l),#0x%x\n",	\
X	       foffset + fsize, fmask);				\
X    else if (! frame_pointer_needed)				\
X      fprintf (FILE, "\tfmovem %%sp@+,#0x%x\n", fmask);		\
X    else							\
X      fprintf (FILE, "\tfmovem %%a6@(-%d),#0x%x\n",		\
X	       foffset + fsize, fmask); }			\
X  if (fpoffset != 0)						\
X    for (regno = 55; regno >= 24; regno--)			\
X      if (regs_ever_live[regno] && ! call_used_regs[regno]) {	\
X	if (big)						\
X	  fprintf(FILE, "\tfpmoved %%a6@(-%d,%%a0:l),%s\n",	\
X		  fpoffset + fsize, reg_names[regno]);		\
X	else if (! frame_pointer_needed)			\
X	  fprintf(FILE, "\tfpmoved %%sp@+,%s\n",		\
X		  reg_names[regno]);				\
X	else							\
X	  fprintf(FILE, "\tfpmoved %%a6@(-%d),%s\n",		\
X		  fpoffset + fsize, reg_names[regno]);		\
X	fpoffset -= 8;						\
X      }								\
X  if (current_function_returns_pointer)                         \
X    fprintf (FILE, "\tmovl %%d0,%%a0\n");                       \
X  if (frame_pointer_needed)					\
X    fprintf (FILE, "\tunlk %%a6\n");				\
X  if (current_function_pops_args && current_function_args_size)	\
X    fprintf (FILE, "\trtd #%d\n", current_function_args_size);	\
X  else fprintf (FILE, "\trts\n"); }
X
X/* This is how to output an insn to push a register on the stack.
X   It need not be very fast code.  */
X
X#undef ASM_OUTPUT_REG_PUSH
X#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
X  fprintf (FILE, "\tmovel %s,%%sp@-\n", reg_names[REGNO])
X
X/* This is how to output an insn to pop a register from the stack.
X   It need not be very fast code.  */
X
X#undef ASM_OUTPUT_REG_POP
X#define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
X  fprintf (FILE, "\tmovel %%sp@+,%s\n", reg_names[REGNO])
X
X/* This says how to output an assembler line to define a global common symbol.
X   We use SIZE rather than ROUNDED, as this is what the native cc does.  */
X
X#undef ASM_OUTPUT_COMMON
X#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
X( fputs (".comm ", (FILE)),			\
X  assemble_name ((FILE), (NAME)),		\
X  fprintf ((FILE), ",%d\n", ((SIZE) == 0) ? (ROUNDED) : (SIZE)))
X
X/* This says how to output an assembler line to define a local common symbol.
X   We use SIZE rather than ROUNDED, as this is what the native cc does.  */
X
X#undef ASM_OUTPUT_LOCAL
X#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
X( fputs (".lcomm ", (FILE)),			\
X  assemble_name ((FILE), (NAME)),		\
X  fprintf ((FILE), ",%d\n", ((SIZE) == 0) ? (ROUNDED) : (SIZE)))
X
X#undef ASM_GENERATE_INTERNAL_LABEL
X#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)	\
X  sprintf ((LABEL), ".%s%d", (PREFIX), (NUM))
X
X#undef ASM_OUTPUT_INTERNAL_LABEL
X#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
X  fprintf ((FILE), ".%s%d:\n", (PREFIX), (NUM))
X
X#undef ASM_OUTPUT_ADDR_VEC_ELT
X#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
X  fprintf (FILE, "\t.long .L%d\n", (VALUE))
X
X#undef ASM_OUTPUT_ADDR_DIFF_ELT
X#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
X  fprintf (FILE, "\t.word .L%d-.L%d\n", (VALUE), (REL))
X
X#undef PRINT_OPERAND
X#define PRINT_OPERAND(FILE, X, CODE)  \
X{ int i;								\
X  if (CODE == '.') ;							\
X  else if (CODE == '#') fprintf (FILE, "#");				\
X  else if (CODE == '-') fprintf (FILE, "%%sp@-");			\
X  else if (CODE == '+') fprintf (FILE, "%%sp@+");			\
X  else if (CODE == '@') fprintf (FILE, "%%sp@");			\
X  else if (CODE == '!') fprintf (FILE, "%%cc");				\
X  else if (GET_CODE (X) == REG)						\
X    { if (REGNO (X) < 16 && (CODE == 'y' || CODE == 'x') && GET_MODE (X) == DFmode)	\
X        fprintf (FILE, "%s:%s", reg_names[REGNO (X)], reg_names[REGNO (X)+1]); \
X      else								\
X        fprintf (FILE, "%s", reg_names[REGNO (X)]);			\
X    }									\
X  else if (GET_CODE (X) == MEM)						\
X    {									\
X      output_address (XEXP (X, 0));					\
X      if (CODE == 'd' && ! TARGET_68020					\
X	  && CONSTANT_ADDRESS_P (XEXP (X, 0))				\
X	  && !(GET_CODE (XEXP (X, 0)) == CONST_INT			\
X	       && INTVAL (XEXP (X, 0)) < 0x8000				\
X	       && INTVAL (XEXP (X, 0)) >= -0x8000))			\
X	fprintf (FILE, ":l");						\
X    }									\
X  else if ((CODE == 'y' || CODE == 'w')					\
X	   && GET_CODE(X) == CONST_DOUBLE				\
X	   && (i = standard_sun_fpa_constant_p (X)))			\
X    fprintf (FILE, "%%%d", i & 0x1ff);					\
X  else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode)	\
X    { union { double d; int i[2]; } u;					\
X      union { float f; int i; } u1;					\
X      u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X);	\
X      u1.f = u.d;							\
X      if (CODE == 'f')							\
X	ASM_OUTPUT_FLOAT_OPERAND (FILE, u1.f);				\
X      else								\
X        fprintf (FILE, "#0x%x", u1.i); }				\
X  else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != DImode)	\
X    { union { double d; int i[2]; } u;					\
X      u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X);	\
X      ASM_OUTPUT_DOUBLE_OPERAND (FILE, u.d); }				\
X  else { putc ('#', FILE); output_addr_const (FILE, X); }}
X
X#undef PRINT_OPERAND_ADDRESS
X#define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
X{ register rtx reg1, reg2, breg, ireg;					\
X  register rtx addr = ADDR;						\
X  rtx offset;								\
X  switch (GET_CODE (addr))						\
X    {									\
X    case REG:								\
X      fprintf (FILE, "%s@", reg_names[REGNO (addr)]);			\
X      break;								\
X    case PRE_DEC:							\
X      fprintf (FILE, "%s@-", reg_names[REGNO (XEXP (addr, 0))]);	\
X      break;								\
X    case POST_INC:							\
X      fprintf (FILE, "%s@+", reg_names[REGNO (XEXP (addr, 0))]);	\
X      break;								\
X    case PLUS:								\
X      reg1 = 0;	reg2 = 0;						\
X      ireg = 0;	breg = 0;						\
X      offset = 0;							\
X      if (CONSTANT_ADDRESS_P (XEXP (addr, 0)))				\
X	{								\
X	  offset = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (CONSTANT_ADDRESS_P (XEXP (addr, 1)))			\
X	{								\
X	  offset = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      if (GET_CODE (addr) != PLUS) ;					\
X      else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND)		\
X	{								\
X	  reg1 = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND)		\
X	{								\
X	  reg1 = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 0)) == MULT)			\
X	{								\
X	  reg1 = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 1)) == MULT)			\
X	{								\
X	  reg1 = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 0)) == REG)			\
X	{								\
X	  reg1 = XEXP (addr, 0);					\
X	  addr = XEXP (addr, 1);					\
X	}								\
X      else if (GET_CODE (XEXP (addr, 1)) == REG)			\
X	{								\
X	  reg1 = XEXP (addr, 1);					\
X	  addr = XEXP (addr, 0);					\
X	}								\
X      if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT		\
X	  || GET_CODE (addr) == SIGN_EXTEND)				\
X	{ if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; }	\
X/*  for OLD_INDEXING							\
X      else if (GET_CODE (addr) == PLUS)					\
X	{								\
X	  if (GET_CODE (XEXP (addr, 0)) == REG)				\
X	    {								\
X	      reg2 = XEXP (addr, 0);					\
X	      addr = XEXP (addr, 1);					\
X	    }								\
X	  else if (GET_CODE (XEXP (addr, 1)) == REG)			\
X	    {								\
X	      reg2 = XEXP (addr, 1);					\
X	      addr = XEXP (addr, 0);					\
X	    }								\
X	}								\
X  */									\
X      if (offset != 0) { if (addr != 0) abort (); addr = offset; }	\
X      if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND			\
X		    || GET_CODE (reg1) == MULT))			\
X	  || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2))))		\
X	{ breg = reg2; ireg = reg1; }					\
X      else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1)))		\
X	{ breg = reg1; ireg = reg2; }					\
X      if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF)	\
X        { int scale = 1;						\
X	  if (GET_CODE (ireg) == MULT)					\
X	    { scale = INTVAL (XEXP (ireg, 1));				\
X	      ireg = XEXP (ireg, 0); }					\
X	  if (GET_CODE (ireg) == SIGN_EXTEND)				\
X	    fprintf (FILE, "%%pc@(.L%d-.LI%d-2:b,%s:w",			\
X		     CODE_LABEL_NUMBER (XEXP (addr, 0)),		\
X		     CODE_LABEL_NUMBER (XEXP (addr, 0)),		\
X		     reg_names[REGNO (XEXP (ireg, 0))]); 		\
X	  else								\
X	    fprintf (FILE, "%%pc@(.L%d-.LI%d-2:b,%s:l",			\
X		     CODE_LABEL_NUMBER (XEXP (addr, 0)),		\
X		     CODE_LABEL_NUMBER (XEXP (addr, 0)),		\
X		     reg_names[REGNO (ireg)]);				\
X	  if (scale != 1) fprintf (FILE, ":%d", scale);			\
X	  putc (')', FILE);						\
X	  break; }							\
X      if (breg != 0 && ireg == 0 && GET_CODE (addr) == LABEL_REF)	\
X        { fprintf (FILE, "%%pc@(.L%d-.LI%d-2:b,%s:l",			\
X		   CODE_LABEL_NUMBER (XEXP (addr, 0)),			\
X		   CODE_LABEL_NUMBER (XEXP (addr, 0)),			\
X		   reg_names[REGNO (breg)]);				\
X	  putc (')', FILE);						\
X	  break; }							\
X      if (ireg != 0 || breg != 0)					\
X	{ int scale = 1;						\
X	  if (breg == 0)						\
X	    abort ();							\
X	  if (addr && GET_CODE (addr) == LABEL_REF) abort ();		\
X	  fprintf (FILE, "%s@(", reg_names[REGNO (breg)]);		\
X	  if (addr != 0)						\
X	    output_addr_const (FILE, addr);				\
X	  if (addr != 0 && ireg != 0)					\
X	    putc (',', FILE);						\
X	  if (ireg != 0 && GET_CODE (ireg) == MULT)			\
X	    { scale = INTVAL (XEXP (ireg, 1));				\
X	      ireg = XEXP (ireg, 0); }					\
X	  if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND)		\
X	    fprintf (FILE, "%s:w", reg_names[REGNO (XEXP (ireg, 0))]);	\
X	  else if (ireg != 0)						\
X	    fprintf (FILE, "%s:l", reg_names[REGNO (ireg)]);		\
X	  if (scale != 1) fprintf (FILE, ":%d", scale);			\
X	  putc (')', FILE);						\
X	  break;							\
X	}								\
X      else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF)		\
X	{ fprintf (FILE, "%%pc@(.L%d-.LI%d-2:b,%s:l)",			\
X		   CODE_LABEL_NUMBER (XEXP (addr, 0)),			\
X		   CODE_LABEL_NUMBER (XEXP (addr, 0)),			\
X		   reg_names[REGNO (reg1)]);				\
X	  break; }							\
X    default:								\
X      if (GET_CODE (addr) == CONST_INT					\
X	  && INTVAL (addr) < 0x8000					\
X	  && INTVAL (addr) >= -0x8000)					\
X	fprintf (FILE, "%d:w", INTVAL (addr));				\
X      else								\
X        output_addr_const (FILE, addr);					\
X    }}
SHAR_EOF
$TOUCH -am 1017201990 tm-tower-gc.h &&
chmod 0666 tm-tower-gc.h ||
echo "restore of tm-tower-gc.h failed"
set `wc -c tm-tower-gc.h`;Wc_c=$1
if test "$Wc_c" != "17179"; then
	echo original size 17179, current size $Wc_c
fi
fi
# ============= tm-tower.h ==============
if test X"$1" != X"-c" -a -f 'tm-tower.h'; then
	echo "File already exists: skipping 'tm-tower.h'"
else
echo "x - extracting tm-tower.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > tm-tower.h &&
X/* Definitions of target machine for GNU compiler.
X   Copyright (C) 1990 Free Software Foundation, Inc.
X
X   Written by Robert Andersson, International Systems, Oslo, Norway.
X   Please send bug reports, questions and improvements to ra@intsys.no.
X
X   For NCR Tower 32/4x0 and 32/6x0 running System V Release 3.
X   I don't have access to 200/700/800/850 machines, so I don't know if it
X   works on those as well.  It shouldn't be far from it however.
X   The hardware floating point support is completely untested, as I do
X   not have access to a machine with a 6888x FPU in it.
X   It does not work on the System V Release 2 based OS releases.  Making it
X   work will not be easy, due to the silly way in which stack expansion is
X   implemented in the OS.
X
X   This file is included in both tm-tower-as.h and tm-tower-gc.h, and contains
X   definitions common to both of them.  Do *NOT* include this file directly.
X
X
XThis file is part of GNU CC.
X
XGNU CC is free software; you can redistribute it and/or modify
Xit under the terms of the GNU General Public License as published by
Xthe Free Software Foundation; either version 1, or (at your option)
Xany later version.
X
XGNU CC is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
XGNU General Public License for more details.
X
XYou should have received a copy of the GNU General Public License
Xalong with GNU CC; see the file COPYING.  If not, write to
Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
X
X
X#include "tm-m68k.h"
X
X
X/* See tm-m68k.h.  5 means 68020 with no 68881.  */
X
X#define TARGET_DEFAULT 5
X
X/* Names to predefine in the preprocessor for this target machine.  */
X
X#ifdef tower32_200
X#define CPP_PREDEFINES "-Dunix -Dtower32 -Dtower32_200"
X#endif
X#ifdef tower32_600
X#define CPP_PREDEFINES "-Dunix -Dtower32 -Dtower32_600"
X#endif
X#ifdef tower32_700
X#define CPP_PREDEFINES "-Dunix -Dtower32 -Dtower32_700"
X#endif
X#ifdef tower32_800
X#define CPP_PREDEFINES "-Dunix -Dtower32 -Dtower32_800"
X#endif
X#ifdef tower32_850
X#define CPP_PREDEFINES "-Dunix -Dtower32 -Dtower32_850"
X#endif
X
X/* The startfiles and libraries depend on the -p and -m68881 options.
X   The Tower does not support the -pg option.  */
X
X#define LINK_SPEC                                              \
X"%{p:%{m68881:-L/usr/lib/fp/libp} -L/usr/lib/libp}             \
X %{m68881:-L/usr/lib/fp}"
X
X#define LIB_SPEC "-lc %{m68881:/usr/lib/fp/crtn.o}%{!m68881:/lib/crtn.o}"
X
X/* Use mem* functions, recognize #ident lines.  */
X
X#define TARGET_MEM_FUNCTIONS
X#define IDENT_DIRECTIVE
X
X/* This is only used in g++, don't prepend underscore.  */
X
X#define NO_UNDERSCORES
X
X/* Every structure and union's size must be a multiple of two bytes.  */
X
X#define STRUCTURE_SIZE_BOUNDARY 16
X
X/* All register names should have a leading % character.  */
X
X#undef REGISTER_NAMES
X#define REGISTER_NAMES \
X{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",                      \
X "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp",                      \
X "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7",              \
X "%fpa0", "%fpa1", "%fpa2", "%fpa3", "%fpa4", "%fpa5", "%fpa6", "%fpa7",      \
X "%fpa8", "%fpa9", "%fpa10", "%fpa11", "%fpa12", "%fpa13", "%fpa14", "%fpa15",\
X "%fpa16","%fpa17", "%fpa18", "%fpa19", "%fpa20", "%fpa21", "%fpa22","%fpa23",\
X "%fpa24","%fpa25", "%fpa26", "%fpa27", "%fpa28", "%fpa29", "%fpa30","%fpa31"}
X
X/* We do not want leading underscores.  */
X
X#undef ASM_OUTPUT_LABELREF
X#define ASM_OUTPUT_LABELREF(FILE,NAME)  \
X  fprintf (FILE, "%s", NAME)
SHAR_EOF
$TOUCH -am 1017201990 tm-tower.h &&
chmod 0666 tm-tower.h ||
echo "restore of tm-tower.h failed"
set `wc -c tm-tower.h`;Wc_c=$1
if test "$Wc_c" != "3641"; then
	echo original size 3641, current size $Wc_c
fi
fi
# ============= xm-tower.h ==============
if test X"$1" != X"-c" -a -f 'xm-tower.h'; then
	echo "File already exists: skipping 'xm-tower.h'"
else
echo "x - extracting xm-tower.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > xm-tower.h &&
X#include "xm-m68k.h"
X
X#define USG
X#define HAVE_VPRINTF
X
X#define bcopy(a,b,c) memcpy (b,a,c)
X#define bzero(a,b) memset (a,0,b)
X#define bcmp(a,b,c) memcmp (a,b,c)
SHAR_EOF
$TOUCH -am 1017201990 xm-tower.h &&
chmod 0666 xm-tower.h ||
echo "restore of xm-tower.h failed"
set `wc -c xm-tower.h`;Wc_c=$1
if test "$Wc_c" != "161"; then
	echo original size 161, current size $Wc_c
fi
fi
exit 0
-- 
Robert Andersson       Voice +47 2 371055       International Systems A/S
ra@intsys.no           Fax   +47 2 356448       P.O. Box 3356
...!{uunet,mcsun,nuug}!intsys.no!ra             0405 Oslo 4, NORWAY