diff options
author | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-25 02:32:56 +0000 |
---|---|---|
committer | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-25 02:32:56 +0000 |
commit | cef20746448f8897180eed3a49a3f8c68b0147f2 (patch) | |
tree | ca7ce0ff5e24f9843632cabb82dece865bffe38a /libgcc/config/rs6000/crtrestvr.S | |
parent | 6b5a351ff69c6582bae4882536706ba308293876 (diff) | |
download | ppe42-gcc-cef20746448f8897180eed3a49a3f8c68b0147f2.tar.gz ppe42-gcc-cef20746448f8897180eed3a49a3f8c68b0147f2.zip |
gcc/
* config/rs6000/rs6000 (SAVE_INLINE_VRS, REST_INLINE_VRS,
V_SAVE_INLINE, SAVRES_LR, SAVRES_SAVE, SAVRES_REG,
SAVRES_GPR, SAVRES_FPR, SAVRES_VR): Define.
(no_global_regs_above): Delete.
(no_global_regs): New function.
(rs6000_savres_strategy): Handle vector regs. Use proper lr_save_p
value for load multiple test.
(savres_routine_syms): Increase size.
(rs6000_savres_routine_name, rs6000_savres_routine_sym,
ptr_regno_for_savres, rs6000_emit_savres_rtx): Pass in int selector
rather than a number of boolean flags. Update all callers.
(rs6000_savres_routine_name): Generate vector save/restore names.
(rs6000_savres_routine_sym): Handle vector regs. Delete forward decl.
(ptr_regno_for_savres, rs6000_emit_savres_rtx): Likewise.
(rs6000_emit_prologue): Delete saving_FPRs_inline, saving_GPRs_inline
and using_store_multiple. Expand uses. Don't always use r11 as
frame reg when needed for out-of-line saves. Set up initial offset
for out-of-line vector saves when buying stack frame. Handle pointer
reg setup for out-of-line fp save. Emit call to out-of-line vector
save function. Choose r11 or r12 for vrsave reg when available for
better scheduling.
(rs6000_output_function_prologue): Don't emit .extern for ELF.
(rs6000_emit_epilogue): Choose a better frame reg when restoring
from back-chain to suit out-of-line vector restore functions. Emit
call to out-of-line vector restore function. Adjust register used
for cr restore. Tweak pointer register setup for gpr restore.
* config/rs6000/rs6000.h (FIRST_SAVED_GP_REGNO): Take into account
FIXED_R13.
* config/rs6000/sysv4.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Simplify.
(V_SAVE_INLINE): Define.
* config/rs6000/altivec.md (save_vregs_*, restore_vregs_*): New insns.
libgcc/
* config/rs6000/crtsavevr.S: New file.
* config/rs6000/crtrestvr.S: New file.
* config/rs6000/t-savresfgpr: Build the above.
* config/rs6000/t-netbsd: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186800 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/rs6000/crtrestvr.S')
-rw-r--r-- | libgcc/config/rs6000/crtrestvr.S | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/libgcc/config/rs6000/crtrestvr.S b/libgcc/config/rs6000/crtrestvr.S new file mode 100644 index 00000000000..21c4ed08931 --- /dev/null +++ b/libgcc/config/rs6000/crtrestvr.S @@ -0,0 +1,88 @@ +/* Routines for restoring vector registers. + + Copyright (C) 2012 + Free Software Foundation, Inc. + Written by Alan Modra, IBM + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +/* On PowerPC64 Linux, these functions are provided by the linker. */ +#ifndef __powerpc64__ + +#undef __ALTIVEC__ +#define __ALTIVEC__ 1 + #include "ppc-asm.h" + +/* Called with r0 pointing just beyond the end of the vector save area. */ + + .section ".text" +CFI_STARTPROC +HIDDEN_FUNC(_restvr_20) + li r11,-192 + lvx v20,r11,r0 +HIDDEN_FUNC(_restvr_21) + li r11,-176 + lvx v21,r11,r0 +HIDDEN_FUNC(_restvr_22) + li r11,-160 + lvx v22,r11,r0 +HIDDEN_FUNC(_restvr_23) + li r11,-144 + lvx v23,r11,r0 +HIDDEN_FUNC(_restvr_24) + li r11,-128 + lvx v24,r11,r0 +HIDDEN_FUNC(_restvr_25) + li r11,-112 + lvx v25,r11,r0 +HIDDEN_FUNC(_restvr_26) + li r11,-96 + lvx v26,r11,r0 +HIDDEN_FUNC(_restvr_27) + li r11,-80 + lvx v27,r11,r0 +HIDDEN_FUNC(_restvr_28) + li r11,-64 + lvx v28,r11,r0 +HIDDEN_FUNC(_restvr_29) + li r11,-48 + lvx v29,r11,r0 +HIDDEN_FUNC(_restvr_30) + li r11,-32 + lvx v30,r11,r0 +HIDDEN_FUNC(_restvr_31) + li r11,-16 + lvx v31,r11,r0 + blr +FUNC_END(_restvr_31) +FUNC_END(_restvr_30) +FUNC_END(_restvr_29) +FUNC_END(_restvr_28) +FUNC_END(_restvr_27) +FUNC_END(_restvr_26) +FUNC_END(_restvr_25) +FUNC_END(_restvr_24) +FUNC_END(_restvr_23) +FUNC_END(_restvr_22) +FUNC_END(_restvr_21) +FUNC_END(_restvr_20) +CFI_ENDPROC + +#endif |