1 /* longjmp for PowerPC64.
2 Copyright (C) 1995, 1996,1997,1999-2006,2009 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
24 # include <novmxsetjmp.h>
26 # include <jmpbuf-offsets.h>
35 .tc _rtld_global_ro[TC],_rtld_global_ro
37 .tc _dl_hwcap[TC],_dl_hwcap
43 ENTRY (BP_SYM (__longjmp))
45 CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
47 ld r5,.LC__dl_hwcap@toc(r2)
49 /* Load _rtld-global._dl_hwcap. */
50 ld r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
52 ld r5,0(r5) /* Load extern _dl_hwcap. */
54 andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
58 lwz r0,((JB_VRSAVE)*8)(3)
60 beq+ L(aligned_restore_vmx)
67 # define load_misaligned_vmx_lo_loaded(loadvr,lovr,shiftvr,loadgpr,addgpr) \
68 addi addgpr,addgpr,32; \
70 vperm loadvr,loadvr,lovr,shiftvr;
71 load_misaligned_vmx_lo_loaded(v21,v22,v0,r5,r6)
72 load_misaligned_vmx_lo_loaded(v22,v23,v0,r6,r5)
73 load_misaligned_vmx_lo_loaded(v23,v24,v0,r5,r6)
74 load_misaligned_vmx_lo_loaded(v24,v25,v0,r6,r5)
75 load_misaligned_vmx_lo_loaded(v25,v26,v0,r5,r6)
76 load_misaligned_vmx_lo_loaded(v26,v27,v0,r6,r5)
77 load_misaligned_vmx_lo_loaded(v27,v28,v0,r5,r6)
78 load_misaligned_vmx_lo_loaded(v28,v29,v0,r6,r5)
79 load_misaligned_vmx_lo_loaded(v29,v30,v0,r5,r6)
80 load_misaligned_vmx_lo_loaded(v30,v31,v0,r6,r5)
84 L(aligned_restore_vmx):
111 ld r22,(JB_GPR1*8)(r3)
112 PTR_DEMANGLE3 (r1, r22, r25)
114 ld r1,(JB_GPR1*8)(r3)
116 ld r2,(JB_GPR2*8)(r3)
118 ld r14,((JB_GPRS+0)*8)(r3)
119 lfd fp14,((JB_FPRS+0)*8)(r3)
120 #if defined SHARED && !defined IS_IN_rtld
121 std r2,40(r1) /* Restore the callers TOC save area. */
123 ld r15,((JB_GPRS+1)*8)(r3)
124 lfd fp15,((JB_FPRS+1)*8)(r3)
125 ld r16,((JB_GPRS+2)*8)(r3)
126 lfd fp16,((JB_FPRS+2)*8)(r3)
127 ld r17,((JB_GPRS+3)*8)(r3)
128 lfd fp17,((JB_FPRS+3)*8)(r3)
129 ld r18,((JB_GPRS+4)*8)(r3)
130 lfd fp18,((JB_FPRS+4)*8)(r3)
131 ld r19,((JB_GPRS+5)*8)(r3)
132 lfd fp19,((JB_FPRS+5)*8)(r3)
133 ld r20,((JB_GPRS+6)*8)(r3)
134 lfd fp20,((JB_FPRS+6)*8)(r3)
136 PTR_DEMANGLE2 (r0, r25)
139 /* std r2,40(r1) Restore the TOC save area. */
140 ld r21,((JB_GPRS+7)*8)(r3)
141 lfd fp21,((JB_FPRS+7)*8)(r3)
142 ld r22,((JB_GPRS+8)*8)(r3)
143 lfd fp22,((JB_FPRS+8)*8)(r3)
145 ld r23,((JB_GPRS+9)*8)(r3)
146 lfd fp23,((JB_FPRS+9)*8)(r3)
147 ld r24,((JB_GPRS+10)*8)(r3)
148 lfd fp24,((JB_FPRS+10)*8)(r3)
149 ld r25,((JB_GPRS+11)*8)(r3)
150 lfd fp25,((JB_FPRS+11)*8)(r3)
152 ld r26,((JB_GPRS+12)*8)(r3)
153 lfd fp26,((JB_FPRS+12)*8)(r3)
154 ld r27,((JB_GPRS+13)*8)(r3)
155 lfd fp27,((JB_FPRS+13)*8)(r3)
156 ld r28,((JB_GPRS+14)*8)(r3)
157 lfd fp28,((JB_FPRS+14)*8)(r3)
158 ld r29,((JB_GPRS+15)*8)(r3)
159 lfd fp29,((JB_FPRS+15)*8)(r3)
160 ld r30,((JB_GPRS+16)*8)(r3)
161 lfd fp30,((JB_FPRS+16)*8)(r3)
162 ld r31,((JB_GPRS+17)*8)(r3)
163 lfd fp31,((JB_FPRS+17)*8)(r3)
166 END (BP_SYM (__longjmp))