home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.3.3-src.lha / GNU / src / amiga / gcc-2.3.3 / config / crds.h < prev    next >
C/C++ Source or Header  |  1994-02-06  |  22KB  |  604 lines

  1. /* Definitions of target machine for GNU compiler.
  2.    Charles River Data Systems UNiverse/32
  3.  
  4.    Written by Gary E. Miller
  5.    bug reports to Gary_Edmunds_Miller@cup.portal.com
  6.  
  7.    Copyright (C) 1987 Free Software Foundation, Inc.
  8.  
  9. This file is part of GNU CC.
  10.  
  11. GNU CC is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2, or (at your option)
  14. any later version.
  15.  
  16. GNU CC is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. GNU General Public License for more details.
  20.  
  21. You should have received a copy of the GNU General Public License
  22. along with GNU CC; see the file COPYING.  If not, write to
  23. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  24.  
  25. #define MOTOROLA        /* Use Motorola syntax rather than "MIT" */
  26. #define SGS            /* Uses SGS assembler */
  27. #define SGS_SWITCH_TABLES    /* Different switch table handling */
  28. #define CRDS            /* Charles River Data Systems assembler */
  29.  
  30. #include "m68k.h"
  31.  
  32. /* Without STRUCTURE_SIZE_BOUNDARY, we can't ensure that structures are
  33.    aligned such that we can correctly extract bitfields from them.
  34.    Someone should check whether the usual compiler on the crds machine
  35.    provides the equivalent behavior of STRUCTURE_SIZE_BOUNDARY.  */
  36. #error This doesn't define STRUCTURE_SIZE_BOUNDARY
  37.  
  38. /* See m68k.h.  0 means 680[01]0 with no 68881.  */
  39.  
  40. #undef TARGET_DEFAULT
  41. #define    TARGET_DEFAULT 0
  42.  
  43. /* special flags to the unos assembler.  */
  44.  
  45. #undef ASM_SPEC
  46. #define ASM_SPEC "-g"
  47.  
  48. #undef LIB_SPEC
  49. #define LIB_SPEC "%{!p:%{!pg:-lunos}}%{p:-lc_p}%{pg:-lc_p}"
  50.  
  51. #undef STARTFILE_SPEC
  52. #define STARTFILE_SPEC  \
  53.   "%{pg:gcrt0.o%s}%{!pg:%{p:mc68rt0.o%s}%{!p:c68rt0.o%s}}"
  54.  
  55. /* CC1 spec */
  56. #if 0
  57. /* c.sac only used in _s_call_r() in libunos.a and malloc() in libmalloc.a */
  58. /* so we do not need to bother ! */
  59. #define CC1_SPEC "-fpcc-struct-return"
  60. #endif
  61.  
  62. /* -O2 for MAX optimization */
  63. #undef CC1_SPEC
  64. #define CC1_SPEC "%{O2:-fstrength-reduce}"
  65.  
  66. /* cpp has to support a #sccs directive for the /usr/include files */
  67.  
  68. #define SCCS_DIRECTIVE
  69.  
  70. /* Make output for SDB.  */
  71.  
  72. /* #define SDB_DEBUGGING_INFO UNOS casm has no debugging :-( */
  73.  
  74. /* UNOS has vprintf() */ 
  75.  
  76. #define HAVE_VPRINTF
  77.  
  78. /* UNOS need stack probe :-( */
  79.  
  80. #define HAVE_probe 1
  81. #define gen_probe()  gen_rtx(ASM_INPUT, VOIDmode, "tstb -2048(sp)\t;probe\n")
  82.  
  83. /* use memcpy, memset instead of bcopy, etc. */
  84.  
  85. #define TARGET_MEM_FUNCTIONS
  86.  
  87. /* Don't try to define `gcc_compiled.' since the assembler might not
  88.    accept symbols with periods and GDB doesn't run on this machine anyway.  */
  89. #define ASM_IDENTIFY_GCC(FILE)
  90.  
  91. /* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
  92.    This will control the use of inline 68881 insns in certain macros.  */
  93.  
  94. #undef CPP_SPEC
  95. #define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
  96.  
  97. /* Names to predefine in the preprocessor for this target machine.  */
  98.  
  99. #undef CPP_PREDEFINES
  100. #define CPP_PREDEFINES "-Dmc68k -DM68000 -Dmc68000 -Dunos -Dunix"
  101.  
  102. /* Register in which address to store a structure value
  103.    is passed to a function.  */
  104. /* unos uses ".comm c.sac" returns &c.sac in d0 */
  105. /* make pointer to c.sac ?
  106. #undef STRUCT_VALUE_REGNUM
  107. #define STRUCT_VALUE gen_rtx(MEM, Pmode, gen_rtx( , , ) )
  108. */
  109.  
  110. #define EXTRA_SECTIONS in_bss
  111.  
  112. #define EXTRA_SECTION_FUNCTIONS                        \
  113. void                                    \
  114. bss_section ()                                \
  115. {                                    \
  116.   if (in_section != in_bss)                        \
  117.     {                                    \
  118.       fprintf (asm_out_file, ".bss\n");                    \
  119.       in_section = in_bss;                        \
  120.     }                                    \
  121. }
  122.  
  123. /* Specify how to pad function arguments.
  124.    Value should be `upward', `downward' or `none'.
  125.    Same as the default, except no padding for large or variable-size args.  */
  126.  
  127. #define FUNCTION_ARG_PADDING(MODE, TYPE)                \
  128.   (((MODE) == BLKmode                            \
  129.     ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE))    == INTEGER_CST        \
  130.        && int_size_in_bytes (TYPE) < PARM_BOUNDARY / BITS_PER_UNIT)    \
  131.     : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY)                \
  132.    ? downward : none)
  133.  
  134. /* Override part of the obstack macros.  */
  135.  
  136. #define __PTR_TO_INT(P) ((int)(P))
  137. #define __INT_TO_PTR(P) ((char *)(P))
  138.  
  139. /* Override parts of m68k.h to fit the CRuDS assembler.  */
  140.  
  141. #undef TARGET_VERSION 
  142. #define TARGET_VERSION fprintf (stderr, " (68k, CRDS/UNOS)");
  143.  
  144. /* Specify extra dir to search for include files.  */
  145. #define SYSTEM_INCLUDE_DIR "/include"
  146.  
  147. /* Control the assembler format that we output.  */
  148.  
  149. /* Output at beginning of assembler file.  */
  150.  
  151. #undef ASM_FILE_START
  152. #define ASM_FILE_START(FILE)    \
  153.   fprintf (FILE, ";#NO_APP\n");
  154.  
  155. /* Output to assembler file text saying following lines
  156.    may contain character constants, extra white space, comments, etc.  */
  157.  
  158. #undef ASM_APP_ON
  159. #define ASM_APP_ON ";#APP\n"
  160.  
  161. /* Output to assembler file text saying following lines
  162.    no longer contain unusual constructs.  */
  163.  
  164. #undef ASM_APP_OFF 
  165. #define ASM_APP_OFF ";#NO_APP\n"
  166.  
  167. /* This is how to output an assembler line defining a `double' constant.  */
  168.  
  169. #undef ASM_OUTPUT_DOUBLE
  170. #define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \
  171. do { union { double f; long l[2];} tem;            \
  172.      tem.f = (VALUE);                    \
  173.      fprintf (FILE, "\t.long 0x%x, 0x%x\n", tem.l[0], tem.l[1]);    \
  174.    } while (0)
  175.  
  176. /*unos has no .skip :-( */
  177. #undef ASM_OUTPUT_SKIP
  178. #define ASM_OUTPUT_SKIP(FILE,SIZE)         \
  179.     fprintf (FILE, "\t. = . + %u\n", (SIZE));    
  180.  
  181. /* This says how to output an assembler line
  182.    to define a local common symbol.  */
  183. /* should use bss_section instead of data_section but this makes casm die ? */
  184.  
  185. #undef ASM_OUTPUT_LOCAL
  186. #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
  187. { data_section ();                \
  188.   if ((SIZE) > 1) fprintf (FILE, "\t.even\n");    \
  189.   assemble_name ((FILE), (NAME));        \
  190.   fprintf ((FILE), ":\t. = . + %u\n", (ROUNDED));}
  191.  
  192. /* This is how to output an insn to push a register on the stack.
  193.    It need not be very fast code.  */
  194.  
  195. #undef ASM_OUTPUT_REG_PUSH
  196. #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
  197.   fprintf (FILE, "\tmovel %s,-(sp)\n", reg_names[REGNO])
  198.  
  199. /* This is how to output an insn to pop a register from the stack.
  200.    It need not be very fast code.  */
  201.  
  202. #undef ASM_OUTPUT_REG_POP
  203. #define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
  204.   fprintf (FILE, "\tmovel (sp)+,%s\n", reg_names[REGNO])
  205.  
  206. #undef  ASM_OUTPUT_ASCII
  207. #define  ASM_OUTPUT_ASCII(FILE, P , SIZE)                \
  208. {  int i;                                \
  209.       fprintf ((FILE), "\t.ascii \"");                \
  210.       for (i = 0; i < (SIZE); i++)                    \
  211.         {                                \
  212.           register int c = (P)[i];                    \
  213.           if (i != 0 && (i / 200) * 200 == i)            \
  214.         fprintf ((FILE), "\"\n\t.ascii \"");            \
  215.           if (c >= ' ' && c < 0177) {                \
  216.             if (c != '\"' && c != '\\') {                \
  217.           putc (c, (FILE));                    \
  218.           continue;                        \
  219.             }                            \
  220.            }                            \
  221.            /* brain dead asm doesn't understand char escapes */  \
  222.            fprintf ((FILE), "\"\n\t.byte\t%d\n\t.ascii \"", c);    \
  223.         }                                \
  224.       fprintf ((FILE), "\"\n");                    \
  225.  }
  226.  
  227.  
  228. /* Change all JBxx to Bxx.  Also change all DBRA to DBF.
  229.    Also change divs.l, etc., to divs, etc.  But don't change divsl.l.  */
  230.  
  231. #define ASM_OUTPUT_OPCODE(FILE, PTR)            \
  232. { if ((PTR)[0] == 'j' && (PTR)[1] == 'b')        \
  233.     { ++(PTR); }                    \
  234.   else if ((PTR)[0] == 'd')                \
  235.     {                            \
  236.       if (!strncmp ((PTR), "dbra", 4))            \
  237.     { fprintf ((FILE), "dbf"); (PTR) += 4; }    \
  238.       else if (!strncmp ((PTR), "div", 3) && (PTR)[5] == ' ')  \
  239.     { fprintf ((FILE), "div%c", (PTR)[3]); (PTR) += 6; }   \
  240.     }                            \
  241. }
  242.  
  243.  
  244. /* Print operand X (an rtx) in assembler syntax to file FILE.
  245.    CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
  246.    For `%' followed by punctuation, CODE is the punctuation and X is null.
  247.  
  248.    On the 68000, we use several CODE characters:
  249.    '.' for dot needed in Motorola-style opcode names.
  250.    '-' for an operand pushing on the stack:
  251.        sp@-, -(sp) or -(%sp) depending on the style of syntax.
  252.    '+' for an operand pushing on the stack:
  253.        sp@+, (sp)+ or (%sp)+ depending on the style of syntax.
  254.    '@' for a reference to the top word on the stack:
  255.        sp@, (sp) or (%sp) depending on the style of syntax.
  256.    '#' for an immediate operand prefix (# in MIT and Motorola syntax
  257.