blob: 1a87ff8f2d37c9b26470938168b8f24ee9129017 [file] [log] [blame]
mostang.com!davidm05a91012004-02-14 07:53:31 +00001/* libunwind - a platform-independent unwind library
2 Copyright (C) 2004 Hewlett-Packard Co
3 Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
4
5This file is part of libunwind.
6
7Permission is hereby granted, free of charge, to any person obtaining
8a copy of this software and associated documentation files (the
9"Software"), to deal in the Software without restriction, including
10without limitation the rights to use, copy, modify, merge, publish,
11distribute, sublicense, and/or sell copies of the Software, and to
12permit persons to whom the Software is furnished to do so, subject to
13the following conditions:
14
15The above copyright notice and this permission notice shall be
16included in all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
25
26 .text
27
28 .global save_static_to_stacked
29 .proc save_static_to_stacked
30save_static_to_stacked:
31 .prologue
32 .regstk 2, 7, 2, 0
33 .save ar.pfs, loc0
34 alloc loc0 = ar.pfs, 2, 7, 2, 0
35 .save rp, loc1
36 mov loc1 = rp
37 .spillreg r4, loc2
38 mov loc2 = r4
39 .spillreg r5, loc3
40 mov loc3 = r5
41 .spillreg r6, loc4
42 mov loc4 = r6
43 .spillreg r7, loc5
44 mov loc5 = r7
45 .body
46 ld8 r4 = [in1], 8;;
47 ld8 r5 = [in1], 8;;
48 ld8 r6 = [in1], 8;;
49 ld8 r7 = [in1], 8;;
50 tbit.nz p6, p0 = r4, 0
51 tbit.nz p7, p0 = r5, 0
52 tbit.nz p8, p0 = r6, 0
53 tbit.nz p9, p0 = r7, 0;;
54(p6) ld8.s r4 = [r0]
55(p7) ld8.s r5 = [r0]
56(p8) ld8.s r6 = [r0]
57(p9) ld8.s r7 = [r0]
58
59 ld8 r2 = [in0], 8 // read the next function pointer
60 ;;
61 ld8 r3 = [r2], 8 // read the function's entry-point
62 ;;
63 ld8 r2 = [r2] // read the function's gp
64 ;;
65 mov b6 = r3
66 mov loc6 = gp
67 mov out0 = in0
68 mov out1 = in1
69 mov gp = r2
70 br.call.sptk.many rp = b6;;
71 mov gp = loc6
72
73 mov r4 = loc2
74 mov r5 = loc3
75 mov r6 = loc4
76 mov r7 = loc5
77
78 mov ar.pfs = loc0
79 mov rp = loc1
80 br.ret.sptk.many rp
81 .endp save_static_to_stacked