home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gcc-2.7.2.1-base.tgz / gcc-2.7.2.1-base.tar / fsf / gcc / config / i860 / sysv3.h < prev    next >
C/C++ Source or Header  |  1995-06-15  |  6KB  |  179 lines

  1. /* Target definitions for GNU compiler for Intel 80860 running System V.3
  2.    Copyright (C) 1991 Free Software Foundation, Inc.
  3.  
  4.    Written by Ron Guilmette (rfg@netcom.com).
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2, or (at your option)
  11. any later version.
  12.  
  13. GNU CC is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with GNU CC; see the file COPYING.  If not, write to
  20. the Free Software Foundation, 59 Temple Place - Suite 330,
  21. Boston, MA 02111-1307, USA.  */
  22.  
  23. #include "i860/i860.h"
  24. #include "svr3.h"
  25.  
  26. #undef TARGET_VERSION
  27. #define TARGET_VERSION fprintf (stderr, " (i860, System V Release 3)")
  28.  
  29. /* Provide a set of pre-definitions and pre-assertions appropriate for
  30.    the i860 running svr3.  */
  31. #define CPP_PREDEFINES "-Di860 -Dunix -D__svr3__ -Asystem(unix) -Asystem(svr3) -Acpu(i860) -Amachine(i860)"
  32.  
  33. /* Use crt1.o as a startup file and crtn.o as a closing file.  */
  34.  
  35. #define STARTFILE_SPEC  \
  36.   "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
  37.  
  38. #define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc crtn.o%s"
  39.  
  40. /* Special flags for the linker.  I don't know what they do.  */
  41.  
  42. #define LINK_SPEC "%{T*} %{z:-lm}"
  43.  
  44. /* The prefix to be used in assembler output for all names of registers.
  45.    None is needed in V.3.  */
  46.  
  47. #define I860_REG_PREFIX    ""
  48.  
  49. /* Delimiter that starts comments in the assembler code.  */
  50.  
  51. #define ASM_COMMENT_START "//"
  52.  
  53. /* Don't renumber the regusters for debugger output.  */
  54.  
  55. #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
  56.  
  57. /* Output the special word the System V SDB wants to see just before
  58.    the first word of each function's prologue code.  */
  59.  
  60. extern char *current_function_original_name;
  61.  
  62. /* This special macro is used to output a magic word just before the
  63.    first word of each function.  On some versions of UNIX running on
  64.    the i860, this word can be any word that looks like a NOP, however
  65.    under svr4, this neds to be an `shr r0,r0,r0' instruction in which
  66.    the normally unused low-order bits contain the length of the function
  67.    prologue code (in bytes).  This is needed to make the System V SDB
  68.    debugger happy.  */
  69.  
  70. #undef ASM_OUTPUT_FUNCTION_PREFIX
  71. #define ASM_OUTPUT_FUNCTION_PREFIX(FILE, FNNAME)            \
  72.   do {    ASM_OUTPUT_ALIGN (FILE, 2);                    \
  73.       fprintf ((FILE), "\t.long\t.ep.");                \
  74.     assemble_name (FILE, FNNAME);                    \
  75.     fprintf (FILE, "-");                        \
  76.     assemble_name (FILE, FNNAME);                    \
  77.     fprintf (FILE, "+0xc8000000\n");                \
  78.     current_function_original_name = (FNNAME);            \
  79.   } while (0)
  80.  
  81. /* Output the special label that must go just after each function's
  82.    prologue code to support svr4 SDB.  */
  83.  
  84. #define ASM_OUTPUT_PROLOGUE_SUFFIX(FILE)                \
  85.   do {    fprintf (FILE, ".ep.");                        \
  86.     assemble_name (FILE, current_function_original_name);        \
  87.     fprintf (FILE, ":\n");                        \
  88.   } while (0)
  89.  
  90. /* This says how to output an assembler line
  91.    to define a local common symbol.
  92.    The difference from svr3.h is we don't limit align to 2.  */
  93.  
  94. #undef ASM_OUTPUT_LOCAL
  95. #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)    \
  96.   do {                            \
  97.     int align = exact_log2 (ROUNDED);            \
  98.     data_section ();                    \
  99.     ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align);    \
  100.     ASM_OUTPUT_LABEL ((FILE), (NAME));            \
  101.     fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED));    \
  102.   } while (0)
  103.  
  104. /* The routine used to output string literals.
  105.  
  106. #define ASCII_DATA_ASM_OP    ".byte"
  107.  
  108. #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)                \
  109.   do                                    \
  110.     {                                    \
  111.       register unsigned char *str = (unsigned char *) (STR);        \
  112.       register unsigned char *limit = str + (LENGTH);            \
  113.       register unsigned bytes_in_chunk = 0;                \
  114.       for (; str < limit; str++)                    \
  115.         {                                \
  116.           register unsigned ch = *str;                    \
  117.           if (ch < 32 || ch == '\\' || ch == '"' || ch >= 127)        \
  118.         {                                \
  119.           if (bytes_in_chunk > 0)                    \
  120.             {                            \
  121.               fprintf ((FILE), "\"\n");                \
  122.               bytes_in_chunk = 0;                    \
  123.             }                            \
  124.           fprintf ((FILE), "\t%s\t%d\n", ASM_BYTE_OP, ch);        \
  125.         }                                \
  126.           else                                \
  127.         {                                \
  128.           if (bytes_in_chunk >= 60)                    \
  129.             {                            \
  130.               fprintf ((FILE), "\"\n");                \
  131.               bytes_in_chunk = 0;                    \
  132.             }                            \
  133.           if (bytes_in_chunk == 0)                    \
  134.             fprintf ((FILE), "\t%s\t\"", ASCII_DATA_ASM_OP);    \
  135.           putc (ch, (FILE));                    \
  136.           bytes_in_chunk++;                        \
  137.         }                                \
  138.         }                                \
  139.       if (bytes_in_chunk > 0)                        \
  140.         fprintf ((FILE), "\"\n");                    \
  141.     }                                    \
  142.   while (0)
  143.  
  144.  
  145. #undef CTORS_SECTION_ASM_OP
  146. #define CTORS_SECTION_ASM_OP    ".section\t.ctors,\"x\""
  147. #undef DTORS_SECTION_ASM_OP
  148. #define DTORS_SECTION_ASM_OP    ".section\t.dtors,\"x\""
  149.  
  150. /* Add definitions to support the .tdesc section as specified in the svr4
  151.    ABI for the i860.  */
  152.  
  153. #define TDESC_SECTION_ASM_OP    ".section\t.tdesc"
  154.  
  155. #undef EXTRA_SECTIONS
  156. #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_tdesc
  157.  
  158. #undef EXTRA_SECTION_FUNCTIONS
  159. #define EXTRA_SECTION_FUNCTIONS                        \
  160.   CONST_SECTION_FUNCTION                        \
  161.   CTORS_SECTION_FUNCTION                        \
  162.   DTORS_SECTION_FUNCTION                        \
  163.   TDESC_SECTION_FUNCTION
  164.  
  165. #define TDESC_SECTION_FUNCTION                        \
  166. void                                    \
  167. tdesc_section ()                            \
  168. {                                    \
  169.   if (in_section != in_tdesc)                        \
  170.     {                                    \
  171.       fprintf (asm_out_file, "%s\n", TDESC_SECTION_ASM_OP);        \
  172.       in_section = in_tdesc;                        \
  173.     }                                    \
  174. }
  175.  
  176. /* Enable the `const' section that svr3.h defines how to use.  */
  177. #undef USE_CONST_SECTION
  178. #define USE_CONST_SECTION    1
  179.