OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / xtensa / windowspill.S
1 /* Function to force register windows to the stack.
2    Copyright (C) 2005, 2007 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9
10    The GNU C Library 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 GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
18
19 #include <bits/xtensa-config.h>
20
21         .text
22         .align  4
23         .literal_position
24         .global __window_spill
25         .type   __window_spill, @function
26 __window_spill:
27         entry   a1, 48
28         bbci.l  a0, 31, .L4             /* branch if called with call4 */
29         bbsi.l  a0, 30, .L12            /* branch if called with call12 */
30
31         /* Called with call8: touch register NUM_REGS-12 (4/20/52) */
32 .L8:
33 #if XCHAL_NUM_AREGS > 16
34         call12  1f
35         retw
36
37         .align  4
38 1:      _entry  a1, 48                  /* touch NUM_REGS-24 (x/8/40) */
39
40 #if XCHAL_NUM_AREGS == 32
41         mov     a8, a0
42         retw
43 #else
44         mov     a12, a0
45         _entry  a1, 48                  /* touch NUM_REGS-36 (x/x/28) */
46         mov     a12, a0
47         _entry  a1, 48                  /* touch NUM_REGS-48 (x/x/16) */
48         mov     a12, a0
49         _entry  a1, 16                  /* touch NUM_REGS-60 (x/x/4) */
50 #endif
51 #endif
52         mov     a4, a0
53         retw
54
55         /* Called with call4: touch register NUM_REGS-8 (8/24/56) */
56 .L4:
57 #if XCHAL_NUM_AREGS == 16
58         mov     a8, a0
59 #else
60         call12  1f
61         retw
62
63         .align  4
64 1:      _entry  a1, 48                  /* touch NUM_REGS-20 (x/12/44) */
65         mov     a12, a0
66 #if XCHAL_NUM_AREGS > 32
67         _entry  a1, 48                  /* touch NUM_REGS-32 (x/x/32) */
68         mov     a12, a0
69         _entry  a1, 48                  /* touch NUM_REGS-44 (x/x/20) */
70         mov     a12, a0
71         _entry  a1, 48                  /* touch NUM_REGS-56 (x/x/8) */
72         mov     a8, a0
73 #endif
74 #endif
75         retw
76
77         /* Called with call12: touch register NUM_REGS-16 (x/16/48) */
78 .L12:
79 #if XCHAL_NUM_AREGS > 16
80         call12  1f
81         retw
82
83         .align  4
84 1:      _entry  a1, 48                  /* touch NUM_REGS-28 (x/4/36) */
85 #if XCHAL_NUM_AREGS == 32
86         mov     a4, a0
87 #else
88         mov     a12, a0
89         _entry  a1, 48                  /* touch NUM_REGS-40 (x/x/24) */
90         mov     a12, a0
91         _entry  a1, 48                  /* touch NUM_REGS-52 (x/x/12) */
92         mov     a12, a0
93 #endif
94 #endif
95         retw