--- gcc/config/m68k/crds.h 2018/04/24 18:10:24 1.1.1.1 +++ gcc/config/m68k/crds.h 2018/04/24 18:28:15 1.1.1.4 @@ -1,10 +1,7 @@ -/* Definitions of target machine for GNU compiler. - Charles River Data Systems UNiverse/32 - - Written by Gary E. Miller - bug reports to Gary_Edmunds_Miller@cup.portal.com - - Copyright (C) 1987, 1993 Free Software Foundation, Inc. +/* Definitions of target machine for GNU compiler; + Charles River Data Systems UNiverse/32. + Copyright (C) 1987, 1993, 1994 Free Software Foundation, Inc. + Contributed by Gary E. Miller (Gary_Edmunds_Miller@cup.portal.com) This file is part of GNU CC. @@ -20,7 +17,8 @@ GNU General Public License for more deta 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. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #define MOTOROLA /* Use Motorola syntax rather than "MIT" */ #define SGS /* Uses SGS assembler */ @@ -33,7 +31,7 @@ the Free Software Foundation, 675 Mass A aligned such that we can correctly extract bitfields from them. Someone should check whether the usual compiler on the crds machine provides the equivalent behavior of STRUCTURE_SIZE_BOUNDARY. */ -#error This doesn't define STRUCTURE_SIZE_BOUNDARY +#error This does not define STRUCTURE_SIZE_BOUNDARY /* See m68k.h. 0 means 680[01]0 with no 68881. */ @@ -75,10 +73,6 @@ the Free Software Foundation, 675 Mass A /* #define SDB_DEBUGGING_INFO UNOS casm has no debugging :-( */ -/* UNOS has vprintf() */ - -#define HAVE_VPRINTF - /* UNOS need stack probe :-( */ #define HAVE_probe 1 @@ -101,7 +95,7 @@ the Free Software Foundation, 675 Mass A /* Names to predefine in the preprocessor for this target machine. */ #undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dmc68k -DM68000 -Dmc68000 -Dunos -Dunix" +#define CPP_PREDEFINES "-Dmc68k -DM68000 -Dmc68000 -Dunos -Dunix -D__motorola__ -Asystem(unix) -Acpu(m68k) -Amachine(m68k)" /* Register in which address to store a structure value is passed to a function. */ @@ -135,11 +129,6 @@ bss_section () \ : 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)) - /* Override parts of m68k.h to fit the CRuDS assembler. */ #undef TARGET_VERSION @@ -209,7 +198,7 @@ do { long l[2]; \ #undef ASM_OUTPUT_ASCII #define ASM_OUTPUT_ASCII(FILE, P , SIZE) \ -{ int i; \ +do { int i; \ fprintf ((FILE), "\t.ascii \""); \ for (i = 0; i < (SIZE); i++) \ { \ @@ -222,11 +211,11 @@ do { long l[2]; \ continue; \ } \ } \ - /* brain dead asm doesn't understand char escapes */ \ + /* brain dead asm doesn't understand char escapes */ \ fprintf ((FILE), "\"\n\t.byte\t%d\n\t.ascii \"", c); \ } \ fprintf ((FILE), "\"\n"); \ - } + } while (0) /* Change all JBxx to Bxx. Also change all DBRA to DBF. @@ -313,14 +302,14 @@ do { long l[2]; \ else \ { REAL_VALUE_TO_TARGET_SINGLE (r, l); \ fprintf (FILE, "$0x%x", l); } } \ - else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == XFmode) \ + else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode) \ { REAL_VALUE_TYPE r; \ REAL_VALUE_FROM_CONST_DOUBLE (r, X); \ - ASM_OUTPUT_LONG_DOUBLE_OPERAND (FILE, r); } \ - else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != DImode) \ + ASM_OUTPUT_DOUBLE_OPERAND (FILE, r); } \ + else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == XFmode) \ { REAL_VALUE_TYPE r; \ REAL_VALUE_FROM_CONST_DOUBLE (r, X); \ - ASM_OUTPUT_DOUBLE_OPERAND (FILE, r); } \ + ASM_OUTPUT_LONG_DOUBLE_OPERAND (FILE, r); } \ else { putc ('$', FILE); output_addr_const (FILE, X); }} /* Note that this contains a kludge that knows that the only reason @@ -460,7 +449,10 @@ do { long l[2]; \ }} #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \ - fprintf (FILE, "\t; file\t\"%s\"\n", FILENAME) + do { fprintf (FILE, "\t; file\t"); \ + output_quoted_string (FILE, FILENAME); \ + fprintf (FILE, "\n"); \ + } while (0) #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO) \ fprintf (FILE, "\t; ln\t%d\n", \ @@ -497,6 +489,18 @@ do { long l[2]; \ fprintf (FILE, "\tlink a6,$%d\n", -fsize); \ else \ fprintf (FILE, "\tlink a6,$0\n\tsubl $%d,sp\n", fsize); } \ + else if (fsize) \ + { \ + /* Adding negative number is faster on the 68040. */ \ + if (fsize + 4 < 0x8000) \ + { \ + fprintf (FILE, "\tadd.w #%d,sp\n", - (fsize + 4)); \ + } \ + else \ + { \ + fprintf (FILE, "\tadd.l #%d,sp\n", - (fsize + 4)); \ + } \ + } \ for (regno = 24; regno < 56; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ fprintf(FILE, "\tfpmoved %s, sp@-\n", \ @@ -606,6 +610,17 @@ do { long l[2]; \ } \ if (frame_pointer_needed) \ fprintf (FILE, "\tunlk a6\n"); \ + else if (fsize) \ + { \ + if (fsize + 4 < 0x8000) \ + { \ + fprintf (FILE, "\tadd.w #%d,sp\n", fsize + 4); \ + } \ + else \ + { \ + fprintf (FILE, "\tadd.l #%d,sp\n", fsize + 4); \ + } \ + } \ if (current_function_pops_args) \ fprintf (FILE, "\trtd $%d\n", current_function_pops_args); \ else fprintf (FILE, "\trts\n"); }