home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / gcc-2.6.0-src.lha / GNU / src / amiga / gcc-2.6.0 / config / ns32k / netbsd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-31  |  7.6 KB  |  238 lines

  1. /* Configuration for a ns32532 running NetBSD as the target machine.
  2.  
  3. This file is part of GNU CC.
  4.  
  5. GNU CC is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. GNU CC is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with GNU CC; see the file COPYING.  If not, write to
  17. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.     $Id: netbsd.h,v 1.1 1994/03/30 22:30:46 kenner Exp $
  20. */
  21.  
  22. #include <machine/ansi.h>
  23. #include "ns32k/ns32k.h"
  24.  
  25. /* Compile for the floating point unit & 32532 by default;
  26.    Don't assume SB is zero */
  27.  
  28. #define TARGET_DEFAULT 57
  29.  
  30. /* 32-bit alignment for efficiency */
  31.  
  32. #undef POINTER_BOUNDARY
  33. #define POINTER_BOUNDARY 32
  34.  
  35. /* 32-bit alignment for efficiency */
  36.  
  37. #undef FUNCTION_BOUNDARY
  38. #define FUNCTION_BOUNDARY 32
  39.  
  40. /* 32532 spec says it can handle any alignment.  Rumor from tm-ns32k.h
  41.    tells this might not be actually true (but it's for 32032, perhaps
  42.    National has fixed the bug for 32532).  You might have to change this
  43.    if the bug still exists. */
  44.  
  45. #undef STRICT_ALIGNMENT
  46. #define STRICT_ALIGNMENT 0
  47.  
  48. /* Use pc relative addressing whenever possible,
  49.    it's more efficient than absolute (ns32k.c)
  50.    You have to fix a bug in gas 1.38.1 to make this work with gas,
  51.    patch available from jkp@cs.hut.fi.
  52.    (NetBSD's gas version has this patch already applied) */
  53.  
  54. #define PC_RELATIVE
  55.  
  56. /* Operand of bsr or jsr should be just the address.  */
  57.  
  58. #define CALL_MEMREF_IMPLICIT
  59.  
  60. /* movd insns may have floating point constant operands.  */
  61.  
  62. #define MOVD_FLOAT_OK
  63.  
  64. /* Every address needs to use a base reg.  */
  65.  
  66. #define BASE_REG_NEEDED
  67.  
  68. /* Names to predefine in the preprocessor for this target machine.  */
  69.  
  70. #undef CPP_PREDEFINES
  71. #define CPP_PREDEFINES "-Dns32k -Dns32000 -Dns32532 -D__NetBSD__ -Dunix"
  72.  
  73. /* Specify -k to assembler for pic generation. PIC needs -K too. */
  74.  
  75. #define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K}"
  76.  
  77. #define LINK_SPEC    \
  78.  "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
  79.  
  80. #define STARTFILE_SPEC  \
  81.   "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
  82.  
  83. /* No more libg.a; no libraries if making shared object */
  84.  
  85. #define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
  86.  
  87. /* Make gcc agree with <machine/ansi.h> */
  88.  
  89. #undef SIZE_TYPE
  90. #define SIZE_TYPE "unsigned int"
  91.  
  92. #undef PTRDIFF_TYPE
  93. #define PTRDIFF_TYPE "int"
  94.  
  95. #undef WCHAR_TYPE
  96. #define WCHAR_TYPE    "short unsigned int"
  97.  
  98. #define WCHAR_UNSIGNED    1
  99.  
  100. #undef WCHAR_TYPE_SIZE
  101. #define WCHAR_TYPE_SIZE    16
  102.  
  103. /* This is BSD, so it wants DBX format.  */
  104.  
  105. #define DBX_DEBUGGING_INFO
  106.  
  107. /* Do not break .stabs pseudos into continuations.  */
  108.  
  109. #define DBX_CONTIN_LENGTH 0
  110.  
  111. /* This is the char to use for continuation (in case we need to turn
  112.    continuation back on).  */
  113.  
  114. #define DBX_CONTIN_CHAR '?'
  115.  
  116. /* Don't use the `xsfoo;' construct in DBX output; this system
  117.    doesn't support it.  */
  118.  
  119. #define DBX_NO_XREFS
  120.  
  121. /* Don't default to pcc-struct-return, because gcc is the only compiler, and
  122.    we want to retain compatibility with older gcc versions.  */
  123.  
  124. #undef PCC_STATIC_STRUCT_RETURN
  125. #define DEFAULT_PCC_STRUCT_RETURN 0
  126.  
  127. /*
  128.  * Some imports from svr4.h in support of shared libraries.
  129.  */
  130.  
  131. /* Define the strings used for the special svr4 .type and .size directives.
  132.    These strings generally do not vary from one system running svr4 to
  133.    another, but if a given system (e.g. m88k running svr) needs to use
  134.    different pseudo-op names for these, they may be overridden in the
  135.    file which includes this one.  */
  136.  
  137. #define TYPE_ASM_OP    ".type"
  138. #define SIZE_ASM_OP    ".size"
  139. #define WEAK_ASM_OP    ".weak"
  140.  
  141. /* The following macro defines the format used to output the second
  142.    operand of the .type assembler directive.  Different svr4 assemblers
  143.    expect various different forms for this operand.  The one given here
  144.    is just a default.  You may need to override it in your machine-
  145.    specific tm.h file (depending upon the particulars of your assembler).  */
  146.  
  147. #define TYPE_OPERAND_FMT    "@%s"
  148.  
  149. /* Write the extra assembler code needed to declare a function's result.
  150.    Most svr4 assemblers don't require any special declaration of the
  151.    result value, but there are exceptions.  */
  152.  
  153. #ifndef ASM_DECLARE_RESULT
  154. #define ASM_DECLARE_RESULT(FILE, RESULT)
  155. #endif
  156.  
  157. /* These macros generate the special .type and .size directives which
  158.    are used to set the corresponding fields of the linker symbol table
  159.    entries in an ELF object file under SVR4.  These macros also output
  160.    the starting labels for the relevant functions/objects.  */
  161.  
  162. /* Write the extra assembler code needed to declare a function properly.
  163.    Some svr4 assemblers need to also have something extra said about the
  164.    function's return value.  We allow for that here.  */
  165.  
  166. #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)            \
  167.   do {                                    \
  168.     fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                \
  169.     assemble_name (FILE, NAME);                        \
  170.     putc (',', FILE);                            \
  171.     fprintf (FILE, TYPE_OPERAND_FMT, "function");            \
  172.     putc ('\n', FILE);                            \
  173.     ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));            \
  174.     ASM_OUTPUT_LABEL(FILE, NAME);                    \
  175.   } while (0)
  176.  
  177. /* Write the extra assembler code needed to declare an object properly.  */
  178.  
  179. #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)            \
  180.   do {                                    \
  181.     fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                \
  182.     assemble_name (FILE, NAME);                        \
  183.     putc (',', FILE);                            \
  184.     fprintf (FILE, TYPE_OPERAND_FMT, "object");                \
  185.     putc ('\n', FILE);                            \
  186.     size_directive_output = 0;                        \
  187.     if (!flag_inhibit_size_directive && DECL_SIZE (DECL))        \
  188.       {                                    \
  189.         size_directive_output = 1;                    \
  190.     fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                \
  191.     assemble_name (FILE, NAME);                    \
  192.     fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (decl)));    \
  193.       }                                    \
  194.     ASM_OUTPUT_LABEL(FILE, NAME);                    \
  195.   } while (0)
  196.  
  197. /* Output the size directive for a decl in rest_of_decl_compilation
  198.    in the case where we did not do so before the initializer.
  199.    Once we find the error_mark_node, we know that the value of
  200.    size_directive_output was set
  201.    by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
  202.  
  203. #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)     \
  204. do {                                     \
  205.      char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);             \
  206.      if (!flag_inhibit_size_directive                     \
  207.      && !size_directive_output                     \
  208.          && DECL_SIZE (DECL)                         \
  209.          && ! AT_END && TOP_LEVEL                     \
  210.      && DECL_INITIAL (DECL) == error_mark_node)             \
  211.        {                                 \
  212.      fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);             \
  213.      assemble_name (FILE, name);                     \
  214.      fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
  215.        }                                 \
  216.    } while (0)
  217.  
  218. /* This is how to declare the size of a function.  */
  219.  
  220. #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)            \
  221.   do {                                    \
  222.     if (!flag_inhibit_size_directive)                    \
  223.       {                                    \
  224.         char label[256];                        \
  225.     static int labelno;                        \
  226.     labelno++;                            \
  227.     ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno);        \
  228.     ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno);        \
  229.     fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                \
  230.     assemble_name (FILE, (FNAME));                    \
  231.         fprintf (FILE, ",");                        \
  232.     assemble_name (FILE, label);                    \
  233.         fprintf (FILE, "-");                        \
  234.     assemble_name (FILE, (FNAME));                    \
  235.     putc ('\n', FILE);                        \
  236.       }                                    \
  237.   } while (0)
  238.