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 / fx2800.h < prev    next >
C/C++ Source or Header  |  1994-02-06  |  11KB  |  339 lines

  1. /* Target definitions for GNU compiler for Alliant FX/2800
  2.    running Concentrix 2.2
  3.  
  4.    Copyright (C) 1991 Free Software Foundation, Inc.
  5.  
  6.    Written by Howard Chu (hyc@hanauma.jpl.nasa.gov).
  7.  
  8. This file is part of GNU CC.
  9.  
  10. GNU CC is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14.  
  15. GNU CC is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. GNU General Public License for more details.
  19.  
  20. You should have received a copy of the GNU General Public License
  21. along with GNU CC; see the file COPYING.  If not, write to
  22. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  23.  
  24. #define OUTPUT_TDESC
  25.  
  26. #include "i860v4.h"
  27.  
  28. /* The Alliant fx2800 running Concentrix 2.x is weird.  This is basically
  29.    a BSD 4.3 based operating system, but it uses svr4 ELF format object
  30.    files and it somehow puts BSD stabs records into the ELF files for
  31.    symbolic debug information.  The assembler is "mostly an SVR4 assembler
  32.    with some Alliant additions. We based it on the `Intel 80860 Assembly
  33.    Language Specification' from AT&T." */
  34.  
  35. /* This file consists of three sections. The first section establishes
  36.    definitions unique to the Alliant FX/2800. The next section reconciles
  37.    differences between Alliant and i860v4.h, and the last overrides the
  38.    remaining differences with svr4.h */
  39.  
  40. #undef TARGET_VERSION
  41. #define TARGET_VERSION fprintf (stderr, " (i860 Alliant)");
  42.  
  43. /* atexit is not present prior to Concentrix 2.2. Uncomment the following
  44.    if you're on 2.1 or older. */
  45.  
  46. /* #undef HAVE_ATEXIT */
  47.  
  48. #define I860_STRICT_ABI_PROLOGUES
  49. #define LINK_LIBGCC_SPECIAL 1
  50.  
  51. /* Most of the Alliant-specific definitions here are to get stab info that
  52.    Alliant's dbx can understand. */
  53.  
  54. #define DBX_DEBUGGING_INFO
  55. #define DEFAULT_GDB_EXTENSIONS 0
  56. #define DBX_NO_XREFS
  57. #define DBX_NO_EXTRA_TAGS
  58.  
  59. /* Alliant dbx also needs to see the function stab before anything
  60.    else in the function. */
  61.  
  62. #define DBX_FUNCTION_FIRST
  63. #define DBX_LBRAC_FIRST
  64.  
  65. /* Alliant dbx also needs to see the end of a function somewhere. */
  66.  
  67. #define DBX_OUTPUT_FUNCTION_END(file,decl)    \
  68.     fprintf (file, ".stab \"\",.,0x%x,0,0\n", N_EFUN)
  69.  
  70. /* Alliant dbx has predefined types, so they must be emitted with the
  71.    proper type numbers. The defined types are:
  72.  
  73.      Type #    C, Fortran, Pascal Types
  74.     --    ------------------------
  75.      1    char, integer*1
  76.      2    short,     integer*2
  77.      3    int, long, integer*4, integer
  78.      4    logical*1, byte
  79.      5    logical*2
  80.      6    logical*4, logical
  81.      7    float, real*4,     real
  82.      8    double, real*8,    double
  83.      9    single complex, complex*8, complex
  84.     10    double complex, doublecomplex
  85.     11    character
  86.     12    void
  87.     13    nil
  88.     14    boolean
  89.     15    unsigned char, ubyte
  90.     16    unsigned short, uword
  91.     17    unsigned, unsigned int, unsigned long, ulong
  92.     18    quad, logical*8
  93.     19    long long, integer*8
  94.     20    unsigned long long, uquad*8
  95.     21-100    reserved for future predefined types
  96.     100    long redefine same as 3
  97.     101    unsigned long same as 17
  98.     --    --------------------
  99.     102    First user program type
  100.  
  101.    Since long and unsigned long are int references, they must be handled
  102.    as special cases. The Alliant compiler doesn't use types 18-20, so it
  103.    sets long & unsigned long in 18 & 19, not in 100 & 101 as shown above. */
  104.  
  105. #define DBX_OUTPUT_STANDARD_TYPES(syms)    \
  106. { char *dtyps[]={"", "char", "short int", "int", "logical*1",        \
  107.     "logical*2", "logical*4", "float", "double", "complex",        \
  108.     "doublecomplex", "character", "void", "nil", "boolean",        \
  109.     "unsigned char", "short unsigned int", "unsigned int",        \
  110.     "logical*8", "long long int", "long long unsigned int",""};    \
  111.                                     \
  112.   tree decl;                                \
  113.   int i;                                \
  114.                                     \
  115.   for (i=1;*dtyps[i];i++)                        \
  116.     for (decl = syms; decl; decl = TREE_CHAIN(decl))            \
  117.     if ((TREE_CODE (decl) == TYPE_DECL) && DECL_NAME(decl) &&    \
  118.         !strcmp(IDENTIFIER_POINTER(DECL_NAME(decl)), dtyps[i])) {    \
  119.         TYPE_SYMTAB_ADDRESS (TREE_TYPE (decl)) = i;        \
  120.         typevec[i] = TYPE_DEFINED;                \
  121.         dbxout_symbol (decl, 0);                \
  122.         break;                            \
  123.     }                                \
  124.                                     \
  125.   for (decl = syms; decl; decl = TREE_CHAIN(decl))            \
  126.     if ((TREE_CODE (decl) == TYPE_DECL) && DECL_NAME(decl) &&        \
  127.     !strcmp(IDENTIFIER_POINTER(DECL_NAME(decl)),"long int")) {    \
  128.       TYPE_SYMTAB_ADDRESS (TREE_TYPE (decl)) = i;            \
  129.       typevec[i] = TYPE_DEFINED;                    \
  130.       fprintf(asmfile,".stab \"long int:t%d=3\",0,0x%x,0,0\n",        \
  131.         i++,N_LSYM);                        \
  132.       TREE_ASM_WRITTEN (decl) = 1;                    \
  133.       break;                                \
  134.     }                                    \
  135.                                     \
  136.   for (decl = syms; decl; decl = TREE_CHAIN(decl))            \
  137.     if ((TREE_CODE (decl) == TYPE_DECL) && DECL_NAME(decl) && !strcmp(    \
  138.     IDENTIFIER_POINTER(DECL_NAME(decl)),"long unsigned int")) {    \
  139.       TYPE_SYMTAB_ADDRESS (TREE_TYPE (decl)) = i;            \
  140.       typevec[i] = TYPE_DEFINED;                    \
  141.       fprintf(asmfile,".stab \"long unsigned int:t%d=17\",0,0x%x,0,0\n",\
  142.         i++,N_LSYM);                        \
  143.       TREE_ASM_WRITTEN (decl) = 1;                    \
  144.       break;                                \
  145.     }                                    \
  146.   next_type_number = i; };
  147.  
  148. /* Alliant dbx doesn't understand split names... */
  149.  
  150. #define DBX_CONTIN_LENGTH 0
  151.  
  152. /* The syntax for stabs records is also different; there is only a single
  153.    ".stab" directive instead of the 3 directives in BSD, and the order of
  154.    arguments is slightly changed. */
  155.  
  156. #define ASM_STABS_OP    ".stab"
  157. #define ASM_STABN_OP    ".stab"
  158. #define ASM_STABD_OP    ".stab"
  159.  
  160. #define DBX_MEMPARM_STABS_LETTER 'k'
  161. #define DBX_REGPARM_STABS_LETTER 'r'
  162.  
  163. #define ASM_OUTPUT_SOURCE_LINE(file,num)        \
  164.     fprintf (file, "\t.stab \"\",.,0x%x,0,%d\n",    \
  165.         N_SLINE,num)
  166.  
  167. #if 0    /* Alliant dbx only reads first N_SO, so it
  168.        ignores the filename if dir is present. */
  169. #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(file,name)        \
  170.     fprintf (file, ".stab \"%s/\",.Ltext0,0x%x,0,0\n",    \
  171.         name, N_SO)
  172. #else
  173. #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(file,name)
  174. #endif
  175.  
  176. #define DBX_OUTPUT_MAIN_SOURCE_FILENAME(file,name)        \
  177.     fprintf (file, ".stab \"%s\",.Ltext0,0x%x,0,0\n",    \
  178.         name, N_SO);                    \
  179.     text_section ();                    \
  180.     ASM_OUTPUT_INTERNAL_LABEL (file, "Ltext", 0)
  181.  
  182. #define DBX_OUTPUT_SOURCE_FILENAME(file,name)            \
  183.     fprintf (file, ".stab \"%s\",.Ltext0,0x%x,0,0\n",    \
  184.         name, N_SOL);
  185.  
  186. #define DBX_OUTPUT_CONSTANT_SYMBOL(file,name,ival)        \
  187.     fprintf (file, ".stab \"%s:c=i%d\",0,0x%x,0,0\n",    \
  188.         name, ival, N_LSYM)
  189.  
  190. #define DBX_FINISH_SYMBOL(decl)    \
  191.     int line = 0;                        \
  192.     fprintf (asmfile, "\",");                \
  193.     if (current_sym_addr)                    \
  194.       output_addr_const (asmfile, current_sym_addr);    \
  195.     else                            \
  196.       fprintf (asmfile, "%d", current_sym_value);        \
  197.     if (decl != 0 && TREE_CODE(decl) == FUNCTION_DECL)    \
  198.       line=DECL_SOURCE_LINE (decl);                \
  199.     fprintf (asmfile, ",0x%x,%d,%d\n", current_sym_code,    \
  200.       line!=0?64:0,line)
  201.  
  202. #define DBX_OUTPUT_CATCH(file,decl,name)        \
  203.   fprintf (file, ".stab \"%s:C1\",",            \
  204.        IDENTIFIER_POINTER (DECL_NAME (decl)));    \
  205.   assemble_name (file, name);                \
  206.   fprintf (file, ",0x%x,0,0\n", N_CATCH)
  207.  
  208. #define DBX_OUTPUT_LBRAC(file,name)    \
  209.   if (depth > 1) {            \
  210.     fprintf (file, ".stab \"\",");    \
  211.     assemble_name (file, name);        \
  212.     fprintf (file, ",0x%x,0,%d\n", N_LBRAC, depth); }
  213.  
  214. #define DBX_OUTPUT_RBRAC(file,name)    \
  215.   if (depth > 1) {            \
  216.     fprintf (file, ".stab \"\",");    \
  217.     assemble_name (file, name);        \
  218.     fprintf (file, ",0x%x,0,%d\n", N_RBRAC, depth); }
  219.  
  220. #define DBX_OUTPUT_ENUM(file,type)                \
  221.   fprintf (file, "e3");                        \
  222.   CHARS(2);                            \
  223.   for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))    \
  224.     {                                \
  225.       fprintf (asmfile, "%s:%d,",                \
  226.            IDENTIFIER_POINTER (TREE_PURPOSE (tem)),        \
  227.            TREE_INT_CST_LOW (TREE_VALUE (tem)));        \
  228.       CHARS (11 + IDENTIFIER_LENGTH (TREE_PURPOSE (tem)));    \
  229.       if (TREE_CHAIN (tem) != 0)                \
  230.     CONTIN;                            \
  231.     }                                \
  232.   putc (';', asmfile);                        \
  233.   CHARS (1);
  234.  
  235. /* Undefine some things defined in i860.h because the native C compiler
  236.    on the FX/2800 emits code to do these operations inline.  For GCC,
  237.    we will use the default implementation of these things... i.e.
  238.    generating calls to libgcc1 routines.  */
  239.  
  240. #undef DIVSI3_LIBCALL
  241.