| /* libunwind - a platform-independent unwind library |
| Copyright (C) 2004 Hewlett-Packard Co |
| Contributed by David Mosberger-Tang <davidm@hpl.hp.com> |
| |
| This file is part of libunwind. |
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and associated documentation files (the |
| "Software"), to deal in the Software without restriction, including |
| without limitation the rights to use, copy, modify, merge, publish, |
| distribute, sublicense, and/or sell copies of the Software, and to |
| permit persons to whom the Software is furnished to do so, subject to |
| the following conditions: |
| |
| The above copyright notice and this permission notice shall be |
| included in all copies or substantial portions of the Software. |
| |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| |
| .text |
| |
| .global save_static_to_stacked |
| .proc save_static_to_stacked |
| save_static_to_stacked: |
| .prologue |
| .regstk 2, 7, 2, 0 |
| .save ar.pfs, loc0 |
| alloc loc0 = ar.pfs, 2, 7, 2, 0 |
| .save rp, loc1 |
| mov loc1 = rp |
| .spillreg r4, loc2 |
| mov loc2 = r4 |
| .spillreg r5, loc3 |
| mov loc3 = r5 |
| .spillreg r6, loc4 |
| mov loc4 = r6 |
| .spillreg r7, loc5 |
| mov loc5 = r7 |
| .body |
| ld8 r4 = [in1], 8;; |
| ld8 r5 = [in1], 8;; |
| ld8 r6 = [in1], 8;; |
| ld8 r7 = [in1], 8;; |
| tbit.nz p6, p0 = r4, 0 |
| tbit.nz p7, p0 = r5, 0 |
| tbit.nz p8, p0 = r6, 0 |
| tbit.nz p9, p0 = r7, 0;; |
| (p6) ld8.s r4 = [r0] |
| (p7) ld8.s r5 = [r0] |
| (p8) ld8.s r6 = [r0] |
| (p9) ld8.s r7 = [r0] |
| |
| ld8 r2 = [in0], 8 // read the next function pointer |
| ;; |
| ld8 r3 = [r2], 8 // read the function's entry-point |
| ;; |
| ld8 r2 = [r2] // read the function's gp |
| ;; |
| mov b6 = r3 |
| mov loc6 = gp |
| mov out0 = in0 |
| mov out1 = in1 |
| mov gp = r2 |
| br.call.sptk.many rp = b6;; |
| mov gp = loc6 |
| |
| mov r4 = loc2 |
| mov r5 = loc3 |
| mov r6 = loc4 |
| mov r7 = loc5 |
| |
| mov ar.pfs = loc0 |
| mov rp = loc1 |
| br.ret.sptk.many rp |
| .endp save_static_to_stacked |