|
|
1.1 root 1: /* Definitions of target machine for GNU compiler, for a PDP with 2BSD
2: Copyright (C) 1995 Free Software Foundation, Inc.
3: Contributed by Michael K. Gschwind ([email protected]).
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 1, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
20:
21: #include "pdp11/pdp11.h"
22:
23: /* This macro generates the assembly code for function entry. */
24: #undef FUNCTION_PROLOGUE
25: #define FUNCTION_PROLOGUE(FILE, SIZE) \
26: do { \
27: fprintf(FILE, "\tjsr r5, csv\n"); \
28: if ((SIZE) != 0) \
29: { \
30: fprintf(FILE, "\t/*abuse empty parameter slot for locals!*/\n"); \
31: if ((SIZE) > 2) \
32: fprintf(FILE, "\tsub $%d, sp\n", (SIZE)-2); \
33: }; \
34: } while (0)
35:
36: /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
37: the stack pointer does not matter. The value is tested only in
38: functions that have frame pointers.
39: No definition is equivalent to always zero. */
40:
41: #undef EXIT_IGNORE_STACK
42: #define EXIT_IGNORE_STACK 1
43:
44: /* This macro generates the assembly code for function exit,
45: on machines that need it. If FUNCTION_EPILOGUE is not defined
46: then individual return instructions are generated for each
47: return statement. Args are same as for FUNCTION_PROLOGUE.
48: */
49:
50: #undef FUNCTION_EPILOGUE
51: #define FUNCTION_EPILOGUE(FILE, SIZE) \
52: do { \
53: fprintf(FILE, "\t/* SP ignored by cret? */\n"); \
54: fprintf(FILE, "\tjmp cret\n"); \
55: } while (0)
56:
57: #undef INITIAL_FRAME_POINTER_OFFSET
58: #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) \
59: { \
60: int offset, regno; \
61: offset = get_frame_size(); \
62: offset = (offset <= 2)? 0: (offset -2); \
63: (DEPTH_VAR) = offset+10; \
64: }
65:
66: /* Value should be nonzero if functions must have frame pointers.
67: Zero means the frame pointer need not be set up (and parms
68: may be accessed via the stack pointer) in functions that seem suitable.
69: This is computed in `reload', in reload1.c.
70: */
71:
72: #undef FRAME_POINTER_REQUIRED
73: #define FRAME_POINTER_REQUIRED 1
74:
75: /* Offset within stack frame to start allocating local variables at.
76: If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
77: first local allocated. Otherwise, it is the offset to the BEGINNING
78: of the first local allocated. */
79: #undef STARTING_FRAME_OFFSET
80: #define STARTING_FRAME_OFFSET -8
81:
82:
83: #undef ASM_DECLARE_FUNCTION_NAME
84: #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
85: do { \
86: ASM_OUTPUT_LABEL (STREAM, NAME); \
87: fprintf (STREAM, "~~%s:\n", NAME); \
88: } while (0)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.