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 / 3b1.h next >
C/C++ Source or Header  |  1994-02-06  |  17KB  |  499 lines

  1. /* Definitions of target machine for GNU compiler.
  2.    AT&T UNIX PC version (pc7300, 3b1)
  3.  
  4.    Written by Alex Crain
  5.    bug reports to alex@umbc3.umd.edu
  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 SGS_SWITCH_TABLES    /* Different switch table handling */
  26.  
  27. #include "hp320.h"
  28.  
  29. /* See m68k.h.  0 means 680[01]0 with no 68881.  */
  30.  
  31. #undef TARGET_DEFAULT
  32. #define    TARGET_DEFAULT 0
  33.  
  34. /* -m68020 requires special flags to the assembler.  */
  35.  
  36. #undef ASM_SPEC
  37. #define ASM_SPEC "%{m68020:-68020}%{!m68020:-68010} %{m68881:-68881}"
  38.  
  39. /* we use /lib/libp/lib*  when profiling */
  40.  
  41. #undef LIB_SPEC
  42. #define LIB_SPEC "%{!shlib:%{p:-L/lib/libp} %{pg:-L/lib/libp} -lc}"
  43.  
  44. /* shared libraries need to use crt0s.o  */
  45.  
  46. #undef STARTFILE_SPEC
  47. #define STARTFILE_SPEC \
  48.   "%{!shlib:%{pg:mcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
  49.    %{shlib:crt0s.o%s shlib.ifile%s} "
  50.  
  51. /* cpp has to support a #sccs directive for the /usr/include files */
  52.  
  53. #define SCCS_DIRECTIVE
  54.  
  55. /* Make output for SDB.  */
  56.  
  57. #define SDB_DEBUGGING_INFO
  58.  
  59. /* The .file command should always begin the output.  */
  60.  
  61. #undef ASM_FILE_START
  62. #define ASM_FILE_START(FILE) \
  63. output_file_directive ((FILE), main_input_filename)
  64.  
  65. /* Don't try to define `gcc_compiled.' since the assembler might not
  66.    accept symbols with periods and GDB doesn't run on this machine anyway.  */
  67. #define ASM_IDENTIFY_GCC(FILE)
  68.  
  69. /* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
  70.    This will control the use of inline 68881 insns in certain macros.  */
  71.  
  72. #undef CPP_SPEC
  73. #define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
  74.  
  75. /* Names to predefine in the preprocessor for this target machine.  */
  76. /* ihnp4!lmayk!lgm@eddie.mit.edu says mc68000 and m68k should not be here.  */
  77.  
  78. #undef CPP_PREDEFINES
  79. #define CPP_PREDEFINES "-Dmc68k -Dunix -Dunixpc"
  80.  
  81. #undef REGISTER_NAMES
  82. #define REGISTER_NAMES \
  83. {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",    \
  84.  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",    \
  85.  "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7"}
  86.  
  87. /* Specify how to pad function arguments.
  88.    Value should be `upward', `downward' or `none'.
  89.    Same as the default, except no padding for large or variable-size args.  */
  90.  
  91. #define FUNCTION_ARG_PADDING(MODE, TYPE)                \
  92.   (((MODE) == BLKmode                            \
  93.     ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST        \
  94.        && int_size_in_bytes (TYPE) < PARM_BOUNDARY / BITS_PER_UNIT)    \
  95.     : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY)                \
  96.    ? downward : none)
  97.  
  98. /* Override part of the obstack macros.  */
  99.  
  100. #define __PTR_TO_INT(P) ((int)(P))
  101. #define __INT_TO_PTR(P) ((char *)(P))
  102.  
  103. /* The 3b1 does not have `atexit'.  */
  104.  
  105. #undef HAVE_ATEXIT
  106.  
  107. /* Override parts of m68k.h to fit the SGS-3b1 assembler.  */
  108.  
  109. #undef TARGET_VERSION
  110. #undef ASM_FORMAT_PRIVATE_NAME
  111. #undef ASM_OUTPUT_DOUBLE
  112. #undef ASM_OUTPUT_FLOAT
  113. #undef ASM_OUTPUT_ALIGN
  114. #undef ASM_OUTPUT_SOURCE_FILENAME
  115. #undef ASM_OUTPUT_SOURCE_LINE
  116. #undef PRINT_OPERAND_ADDRESS
  117. #undef ASM_GENERATE_INTERNAL_LABEL
  118. #undef FUNCTION_PROFILER
  119. #undef ASM_OUTPUT_ADDR_VEC_ELT
  120. #undef ASM_OUTPUT_ADDR_DIFF_ELT
  121. #undef ASM_OUTPUT_INTERNAL_LABEL
  122. #undef ASM_OUTPUT_OPCODE
  123. #undef ASM_OUTPUT_LOCAL
  124. #undef ASM_OUTPUT_LABELREF
  125. #undef ASM_OUTPUT_ASCII
  126.  
  127. #define TARGET_VERSION fprintf (stderr, " (68k, SGS/AT&T unixpc syntax)");
  128.  
  129. /* Store in OUTPUT a string (made with alloca) containing
  130.    an assembler-name for a local static variable named NAME.
  131.    LABELNO is an integer which is different for each call.  */
  132.  
  133. #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)    \
  134. ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12),    \
  135.   sprintf ((OUTPUT), "%s_%%%d", (NAME), (LABELNO)))
  136.  
  137. /* The unixpc doesn't know about double's and float's */
  138.  
  139. #define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \
  140. do { union { double d; long l[2]; } tem;        \
  141.      tem.d = (VALUE);                    \
  142.      fprintf(FILE, "\tlong 0x%x,0x%x\n", tem.l[0], tem.l[1]); \
  143.    } while (0)
  144.  
  145. #define ASM_OUTPUT_FLOAT(FILE,VALUE)  \
  146. do { union { float f; long l;} tem;            \
  147.      tem.f = (VALUE);                    \
  148.      fprintf (FILE, "\tlong 0x%x\n", tem.l);    \
  149.    } while (0)
  150.  
  151. #define ASM_OUTPUT_ALIGN(FILE,LOG)    \
  152.   if ((LOG) == 1)            \
  153.     fprintf (FILE, "\teven\n");    \
  154.   else if ((LOG) != 0)            \
  155.     abort ();
  156.  
  157. /* This is how to output an assembler line
  158.    that says to advance the location counter by SIZE bytes.  */
  159.  
  160. #undef ASM_OUTPUT_SKIP
  161. #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
  162.   fprintf (FILE, "\tspace %d\n", (SIZE))
  163.  
  164. /* Can't use ASM_OUTPUT_SKIP in text section; it doesn't leave 0s.  */
  165.  
  166. #define ASM_NO_SKIP_IN_TEXT 1
  167.  
  168. /* The beginnings of sdb support... */
  169.  
  170. #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
  171.   fprintf (FILE, "\tfile\t\"%s\"\n", FILENAME)
  172.  
  173. #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)    \
  174.   fprintf (FILE, "\tln\t%d\n",            \
  175.        (sdb_begin_function_line        \
  176.         ? last_linenum - sdb_begin_function_line : 1))
  177.  
  178. /* Yet another null terminated string format. */
  179.  
  180. #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
  181.   { register int sp = 0, lp = 0; \
  182.     fprintf ((FILE), "\tbyte\t"); \
  183.   loop: \
  184.     if ((PTR)[sp] > ' ' && ! ((PTR)[sp] & 0x80) && (PTR)[sp] != '\\') \
  185.       { lp += 3; \
  186.     fprintf ((FILE), "'%c", (PTR)[sp]); } \
  187.     else \
  188.       { lp += 5; \
  189.     fprintf ((FILE), "0x%x", (PTR)[sp]); } \
  190.     if (++sp < (LEN)) \
  191.       {    if (lp > 60) \
  192.       { lp = 0; \
  193.         fprintf ((FILE), "\n\t%s ", ASCII_DATA_ASM_OP); }    \
  194.     else \
  195.       putc (',', (FILE)); \
  196.     goto loop; } \
  197.     putc ('\n', (FILE)); }
  198.  
  199. /* Note that in the case of the movhi which fetches an element of
  200.    an ADDR_DIFF_VEC the offset output is too large by 2.
  201.    This is because the 3b1 assembler refuses to subtract 2.
  202.    ASM_OUTPUT_CASE_LABEL, below, compensates for this.  */
  203.  
  204. #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
  205. { register rtx reg1, reg2, breg, ireg;                    \
  206.   register rtx addr = ADDR;                        \
  207.   rtx offset;                                \
  208.   switch (GET_CODE (addr))                        \
  209.     {                                    \
  210.     case REG:                                \
  211.       fprintf (FILE, "(%s)", reg_names[REGNO (addr)]);            \
  212.       break;                                \
  213.     case PRE_DEC:                            \
  214.       fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]);    \
  215.       break;                                \
  216.     case POST_INC:                            \
  217.       fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]);    \
  218.       break;                                \
  219.     case PLUS:                                \
  220.       reg1 = 0;    reg2 = 0;                        \
  221.       ireg = 0;    breg = 0;                        \
  222.       offset = 0;                            \
  223.       if (CONSTANT_ADDRESS_P (XEXP (addr, 0)))                \
  224.     {                                \
  225.       offset = XEXP (addr, 0);                    \
  226.       addr = XEXP (addr, 1);                    \
  227.     }                                \
  228.       else if (CONSTANT_ADDRESS_P (XEXP (addr, 1)))            \
  229.     {                                \
  230.       offset = XEXP (addr, 1);                    \
  231.       addr = XEXP (addr, 0);                    \
  232.     }                                \
  233.       if (GET_CODE (addr) != PLUS) ;                    \
  234.       else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND)        \
  235.     {                                \
  236.       reg1 = XEXP (addr, 0);                    \
  237.       addr = XEXP (addr, 1);                    \
  238.     }                                \
  239.       else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND)        \
  240.     {                                \
  241.       reg1 = XEXP (addr, 1);                    \
  242.       addr = XEXP (addr, 0);                    \
  243.     }                                \
  244.       else if (GET_CODE (XEXP (addr, 0)) == MULT)            \
  245.     {                                \
  246.       reg1 = XEXP (addr, 0);                    \
  247.       addr = XEXP (addr, 1);                    \
  248.     }                                \
  249.       else if (GET_CODE (XEXP (addr, 1)) == MULT)            \
  250.     {                                \
  251.       reg1 = XEXP (addr, 1);                    \
  252.       addr = XEXP (addr, 0);                    \
  253.     }                                \
  254.       else if (GET_CODE (XEXP (addr, 0)) == REG)            \
  255.     {                                \
  256.       reg1 = XEXP (addr, 0);                    \
  257.       addr = XEXP (addr, 1);                    \
  258.     }                                \
  259.       else if (GET_CODE (XEXP (addr, 1)) == REG)            \
  260.     {                                \
  261.       reg1 = XEXP (addr, 1);                    \
  262.       addr = XEXP (addr, 0);                    \
  263.     }                                \
  264.       if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT        \
  265.