1 /* libgcc routines for R8C/M16C/M32C
3 Free Software Foundation, Inc.
4 Contributed by Red Hat.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 2, or (at your
11 option) any later version.
13 In addition to the permissions in the GNU General Public License,
14 the Free Software Foundation gives you unlimited permission to link
15 the compiled version of this file into combinations with other
16 programs, and to distribute those combinations without any
17 restriction coming from the use of this file. (The General Public
18 License restrictions do apply in other respects; for example, they
19 cover modification of the file, and distribution when not linked
20 into a combine executable.)
22 GCC is distributed in the hope that it will be useful, but WITHOUT
23 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
25 License for more details.
27 You should have received a copy of the GNU General Public License
28 along with GCC; see the file COPYING. If not, write to the Free
29 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
32 #if defined(__r8c_cpu__) || defined(__m16c_cpu__)
43 #ifdef L__m32c_memregs
45 /* Warning: these memory locations are used as a register bank. They
46 *must* end up consecutive in any final executable, so you may *not*
47 use the otherwise obvious ".comm" directive to allocate space for
86 #ifdef L__m32c_eh_return
88 .global __m32c_eh_return
91 /* At this point, r0 has the stack adjustment, r1r3 has the
92 address to return to. The stack looks like this:
103 What we need to do is restore all the registers, update the
104 stack, and return to the right place.
110 /* a0 points to the current stack, just above the register
117 /* a1 points to the new stack. */
119 /* This is for the "rts" below. */
128 /* This is for the "popc sp" below. */
131 popm r0,r1,r2,r3,a0,a1,sb,fb
136 /* SImode arguments for SI foo(SI,SI) functions. */
149 #ifdef L__m32c_mulsi3
157 mulu.w SBL,mem0 /* writes to r2r0 */
159 mulu.w SBH,r0 /* writes to r2r0 */
168 #ifdef L__m32c_cmpsi2
189 #ifdef L__m32c_ucmpsi2
210 #ifdef L__m32c_jsri16
221 pop.b m32c_jsri_ret+2
223 push.b m32c_jsri_ret+2
225 jmpi.a m32c_jsri_addr