1 Target Definitions for R8C/M16C/M32C
2 Copyright (C) 2005-2018 Free Software Foundation, Inc.
3 Contributed by Red Hat.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>.
22 These are just some random notes I used during development of this
23 port. Please don't consider these to be "official" specifications,
24 just additional information to help make the code easier to
35 osp -> +--------------------
37 fp -> +--------------------
43 sp -> +--------------------
51 First arg may be passed in r1l or r1 if it (1) fits (QImode or
52 HImode), (2) is named, and (3) is an integer or pointer type (no
53 structs, floats, etc). Otherwise, it's passed on the stack.
55 Second arg may be passed in r2, same restrictions (but not QImode),
56 even if the first arg is passed on the stack.
58 Third and further args are passed on the stack. No padding is used,
59 stack "alignment" is 8 bits.
63 First arg may be passed in r0l or r0, same restrictions as above.
65 Second and further args are passed on the stack. Padding is used
66 after QImode parameters (i.e. lower-addressed byte is the value,
67 higher-addressed byte is the padding), stack "alignment" is 16 bits.
83 Anything bigger than 16 bits is returned in memory, at mem0 (mem0
84 through mem15 are provided by libgcc.a)
86 Aggregate values (regardless of size) are returned by pushing a
87 pointer to a temporary area on the stack after the args are pushed.
88 The function fills in this area with the value. Note that this
89 pointer on the stack does not affect how register arguments, if any,
97 Registers Preserved Across Calls
98 ================================
102 sb, fb, sp (i.e. nearly all registers are call clobbered)
106 r1, r2, r3, a0, a1, sb, fb, sp
107 (except when used for return values)
113 The stack frame is slightly different for interrupt handlers, because
114 (1) we don't have a usable parent frame, and (2) we have to use
115 special instructions to return and thus must save/restore everything
118 +--------------------
120 osp -> +--------------------
122 +--------------------
123 | saved r0..fp (pushm)
124 fp -> +--------------------
126 +--------------------
127 | saved regs mem0..mem15
128 +--------------------
129 | outgoing args (opt)
130 sp -> +--------------------