2.9
[glibc/nacl-glibc.git] / sysdeps / powerpc / powerpc32 / gprsave0.S
blobc74272b56d5bf35bf2e256fac6cdce2bceb41571
1 /* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, write to the Free
16    Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
17    02110-1301 USA.  */
20     General Purpose Register (GPR) save routine
21     when Floating Point Registers (FPRs) are not saved
23     Note: This save routine must not be called when GPR30 or
24     GPR31, or both, are the only registers beings saved. In these
25     cases, the saving and restoring must be done inline.
28 #include <sysdep.h>
30 ENTRY(_savegpr0_all)
31                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_13)
32 C_TEXT(_savegpr0_13):   stw     r13,-76(r1)
33                         cfi_offset(r13,-76)
34                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_14)
35 C_TEXT(_savegpr0_14):   stw     r14,-72(r1)
36                         cfi_offset(r14,-72)
37                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_15)
38 C_TEXT(_savegpr0_15):   stw     r15,-68(r1)
39                         cfi_offset(r15,-68)
40                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_16)
41 C_TEXT(_savegpr0_16):   stw     r16,-64(r1)
42                         cfi_offset(r16,-64)
43                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_17)
44 C_TEXT(_savegpr0_17):   stw     r17,-60(r1)
45                         cfi_offset(r17,-60)
46                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_18)
47 C_TEXT(_savegpr0_18):   stw     r18,-56(r1)
48                         cfi_offset(r18,-56)
49                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_19)
50 C_TEXT(_savegpr0_19):   stw     r19,-52(r1)
51                         cfi_offset(r19,-52)
52                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_20)
53 C_TEXT(_savegpr0_20):   stw     r20,-48(r1)
54                         cfi_offset(r20,-48)
55                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_21)
56 C_TEXT(_savegpr0_21):   stw     r21,-44(r1)
57                         cfi_offset(r21,-44)
58                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_22)
59 C_TEXT(_savegpr0_22):   stw     r22,-40(r1)
60                         cfi_offset(r22,-40)
61                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_23)
62 C_TEXT(_savegpr0_23):   stw     r23,-36(r1)
63                         cfi_offset(r23,-36)
64                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_24)
65 C_TEXT(_savegpr0_24):   stw     r24,-32(r1)
66                         cfi_offset(r24,-32)
67                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_25)
68 C_TEXT(_savegpr0_25):   stw     r25,-28(r1)
69                         cfi_offset(r25,-28)
70                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_26)
71 C_TEXT(_savegpr0_26):   stw     r26,-24(r1)
72                         cfi_offset(r26,-24)
73                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_27)
74 C_TEXT(_savegpr0_27):   stw     r27,-20(r1)
75                         cfi_offset(r27,-20)
76                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_28)
77 C_TEXT(_savegpr0_28):   stw     r28,-16(r1)
78                         cfi_offset(r28,-16)
79                 ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_29)
80 C_TEXT(_savegpr0_29):   stw     r29,-12(r1) #save r29
81                         stw     r30,-8(r1)  #save r30
82                         stw     r31,-4(r1)  #save r31
83                         cfi_offset(r29,-12)
84                         cfi_offset(r30,-8)
85                         cfi_offset(r31,-4)
86                         stw     r0,8(r1)    #save LR in callers frame
87                         blr                 #return
88 END (_savegpr0_all)