OSDN Git Service

Update copyrights.
[pf3gnuchains/gcc-fork.git] / gcc / config / pdp11 / 2bsd.h
1 /* Definitions of target machine for GNU compiler, for a PDP with 2BSD
2    Copyright (C) 1995, 96, 99, 2000 Free Software Foundation, Inc.
3    Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 /* This macro generates the assembly code for function entry. */
23 #undef FUNCTION_PROLOGUE
24 #define FUNCTION_PROLOGUE(FILE, SIZE) \
25 do {                                                                    \
26 fprintf(FILE, "\tjsr    r5, csv\n");                                    \
27 if ((SIZE) != 0)                                                        \
28   {                                                                     \
29     fprintf(FILE, "\t/*abuse empty parameter slot for locals!*/\n");    \
30     if ((SIZE) > 2)                                                     \
31       fprintf(FILE, "\tsub $%d, sp\n", (SIZE)-2);                       \
32   };                                                                    \
33 } while (0)
34
35 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
36    the stack pointer does not matter.  The value is tested only in
37    functions that have frame pointers.
38    No definition is equivalent to always zero.  */
39
40 #undef EXIT_IGNORE_STACK
41 #define EXIT_IGNORE_STACK       1
42
43 /* This macro generates the assembly code for function exit,
44    on machines that need it.  If FUNCTION_EPILOGUE is not defined
45    then individual return instructions are generated for each
46    return statement.  Args are same as for FUNCTION_PROLOGUE.
47 */
48
49 #undef FUNCTION_EPILOGUE
50 #define FUNCTION_EPILOGUE(FILE, SIZE) \
51 do {                                                                    \
52 fprintf(FILE, "\t/* SP ignored by cret? */\n");                         \
53 fprintf(FILE, "\tjmp cret\n");                                          \
54 } while (0)
55
56 #undef INITIAL_FRAME_POINTER_OFFSET  
57 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) \
58 {                                                               \
59   int offset;                                           \
60   offset = get_frame_size();                                    \
61   offset = (offset <= 2)? 0: (offset -2);                       \
62   (DEPTH_VAR) = offset+10;                                              \
63 }   
64
65 /* Value should be nonzero if functions must have frame pointers.
66    Zero means the frame pointer need not be set up (and parms
67    may be accessed via the stack pointer) in functions that seem suitable.
68    This is computed in `reload', in reload1.c.
69   */
70
71 #undef FRAME_POINTER_REQUIRED 
72 #define FRAME_POINTER_REQUIRED 1
73
74 /* Offset within stack frame to start allocating local variables at.
75    If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
76    first local allocated.  Otherwise, it is the offset to the BEGINNING
77    of the first local allocated.  */
78 #undef STARTING_FRAME_OFFSET
79 #define STARTING_FRAME_OFFSET -8
80
81
82 #undef ASM_DECLARE_FUNCTION_NAME
83 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL)   \
84 do {                                                    \
85 ASM_OUTPUT_LABEL (STREAM, NAME);                        \
86 fprintf (STREAM, "~~%s:\n", NAME);                      \
87 } while (0)
88
89 #undef TARGET_UNIX_ASM_DEFAULT
90 #define TARGET_UNIX_ASM_DEFAULT 2048