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 | |
parent | 6b5a351ff69c6582bae4882536706ba308293876 (diff) | |
download | gcc-cef20746448f8897180eed3a49a3f8c68b0147f2.tar.gz |
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')
-rw-r--r-- | libgcc/ChangeLog | 7 | ||||
-rw-r--r-- | libgcc/config/rs6000/crtrestvr.S | 88 | ||||
-rw-r--r-- | libgcc/config/rs6000/crtsavevr.S | 88 | ||||
-rw-r--r-- | libgcc/config/rs6000/t-netbsd | 4 | ||||
-rw-r--r-- | libgcc/config/rs6000/t-savresfgpr | 2 |
5 files changed, 188 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 638994aa3bc..831fa12203a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,10 @@ +2012-04-25 Alan Modra <amodra@gmail.com> + + * config/rs6000/crtsavevr.S: New file. + * config/rs6000/crtrestvr.S: New file. + * config/rs6000/t-savresfgpr: Build the above. + * config/rs6000/t-netbsd: Likewise. + 2012-04-24 Sriraman Tallam <tmsriram@google.com> * libgcc/config/i386/i386-cpuinfo.c: Set __cpu_vendor always. 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 diff --git a/libgcc/config/rs6000/crtsavevr.S b/libgcc/config/rs6000/crtsavevr.S new file mode 100644 index 00000000000..072c7b8eb9a --- /dev/null +++ b/libgcc/config/rs6000/crtsavevr.S @@ -0,0 +1,88 @@ +/* Routines for saving 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(_savevr_20) + li r11,-192 + stvx v20,r11,r0 +HIDDEN_FUNC(_savevr_21) + li r11,-176 + stvx v21,r11,r0 +HIDDEN_FUNC(_savevr_22) + li r11,-160 + stvx v22,r11,r0 +HIDDEN_FUNC(_savevr_23) + li r11,-144 + stvx v23,r11,r0 +HIDDEN_FUNC(_savevr_24) + li r11,-128 + stvx v24,r11,r0 +HIDDEN_FUNC(_savevr_25) + li r11,-112 + stvx v25,r11,r0 +HIDDEN_FUNC(_savevr_26) + li r11,-96 + stvx v26,r11,r0 +HIDDEN_FUNC(_savevr_27) + li r11,-80 + stvx v27,r11,r0 +HIDDEN_FUNC(_savevr_28) + li r11,-64 + stvx v28,r11,r0 +HIDDEN_FUNC(_savevr_29) + li r11,-48 + stvx v29,r11,r0 +HIDDEN_FUNC(_savevr_30) + li r11,-32 + stvx v30,r11,r0 +HIDDEN_FUNC(_savevr_31) + li r11,-16 + stvx v31,r11,r0 + blr +FUNC_END(_savevr_31) +FUNC_END(_savevr_30) +FUNC_END(_savevr_29) +FUNC_END(_savevr_28) +FUNC_END(_savevr_27) +FUNC_END(_savevr_26) +FUNC_END(_savevr_25) +FUNC_END(_savevr_24) +FUNC_END(_savevr_23) +FUNC_END(_savevr_22) +FUNC_END(_savevr_21) +FUNC_END(_savevr_20) +CFI_ENDPROC + +#endif diff --git a/libgcc/config/rs6000/t-netbsd b/libgcc/config/rs6000/t-netbsd index 3b4ba32a215..7be8e5e6700 100644 --- a/libgcc/config/rs6000/t-netbsd +++ b/libgcc/config/rs6000/t-netbsd @@ -6,4 +6,6 @@ LIB2ADD_ST = \ $(srcdir)/config/rs6000/crtsavgpr.S \ $(srcdir)/config/rs6000/crtresgpr.S \ $(srcdir)/config/rs6000/crtresxfpr.S \ - $(srcdir)/config/rs6000/crtresxgpr.S + $(srcdir)/config/rs6000/crtresxgpr.S \ + $(srcdir)/config/rs6000/crtsavevr.S \ + $(srcdir)/config/rs6000/crtrestvr.S diff --git a/libgcc/config/rs6000/t-savresfgpr b/libgcc/config/rs6000/t-savresfgpr index e2a951abd3f..a8455ae1af9 100644 --- a/libgcc/config/rs6000/t-savresfgpr +++ b/libgcc/config/rs6000/t-savresfgpr @@ -6,6 +6,8 @@ LIB2ADD_ST += \ $(srcdir)/config/rs6000/crtresgpr.S \ $(srcdir)/config/rs6000/crtresxfpr.S \ $(srcdir)/config/rs6000/crtresxgpr.S \ + $(srcdir)/config/rs6000/crtsavevr.S \ + $(srcdir)/config/rs6000/crtrestvr.S \ $(srcdir)/config/rs6000/e500crtres32gpr.S \ $(srcdir)/config/rs6000/e500crtres64gpr.S \ $(srcdir)/config/rs6000/e500crtres64gprctr.S \ |