mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-14 05:20:25 +08:00
rs6000 (SAVE_INLINE_VRS, [...]): Define.
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. From-SVN: r186800
This commit is contained in:
parent
1bf7c2a71c
commit
b427dd7ae3
@ -1,3 +1,37 @@
|
||||
2012-04-25 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* 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.
|
||||
|
||||
2012-04-25 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* config/rs6000/rs6000.c (rs6000_savres_strategy): Allow
|
||||
|
@ -313,6 +313,68 @@
|
||||
"TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT"
|
||||
"b %z1")
|
||||
|
||||
;; The save_vregs and restore_vregs patterns don't use memory_operand
|
||||
;; because (plus (reg) (const_int)) is not a valid vector address.
|
||||
;; This way is more compact than describing exactly what happens in
|
||||
;; the out-of-line functions, ie. loading the constant into r11/r12
|
||||
;; then using indexed addressing, and requires less editing of rtl
|
||||
;; to describe the operation to dwarf2out_frame_debug_expr.
|
||||
(define_insn "*save_vregs_<mode>_r11"
|
||||
[(match_parallel 0 "any_parallel_operand"
|
||||
[(clobber (reg:P 65))
|
||||
(use (match_operand:P 1 "symbol_ref_operand" "s"))
|
||||
(clobber (reg:P 11))
|
||||
(use (reg:P 0))
|
||||
(set (mem:V4SI (plus:P (match_operand:P 2 "gpc_reg_operand" "b")
|
||||
(match_operand:P 3 "short_cint_operand" "I")))
|
||||
(match_operand:V4SI 4 "gpc_reg_operand" "v"))])]
|
||||
""
|
||||
"bl %1"
|
||||
[(set_attr "type" "branch")
|
||||
(set_attr "length" "4")])
|
||||
|
||||
(define_insn "*save_vregs_<mode>_r12"
|
||||
[(match_parallel 0 "any_parallel_operand"
|
||||
[(clobber (reg:P 65))
|
||||
(use (match_operand:P 1 "symbol_ref_operand" "s"))
|
||||
(clobber (reg:P 12))
|
||||
(use (reg:P 0))
|
||||
(set (mem:V4SI (plus:P (match_operand:P 2 "gpc_reg_operand" "b")
|
||||
(match_operand:P 3 "short_cint_operand" "I")))
|
||||
(match_operand:V4SI 4 "gpc_reg_operand" "v"))])]
|
||||
""
|
||||
"bl %1"
|
||||
[(set_attr "type" "branch")
|
||||
(set_attr "length" "4")])
|
||||
|
||||
(define_insn "*restore_vregs_<mode>_r11"
|
||||
[(match_parallel 0 "any_parallel_operand"
|
||||
[(clobber (reg:P 65))
|
||||
(use (match_operand:P 1 "symbol_ref_operand" "s"))
|
||||
(clobber (reg:P 11))
|
||||
(use (reg:P 0))
|
||||
(set (match_operand:V4SI 2 "gpc_reg_operand" "=v")
|
||||
(mem:V4SI (plus:P (match_operand:P 3 "gpc_reg_operand" "b")
|
||||
(match_operand:P 4 "short_cint_operand" "I"))))])]
|
||||
""
|
||||
"bl %1"
|
||||
[(set_attr "type" "branch")
|
||||
(set_attr "length" "4")])
|
||||
|
||||
(define_insn "*restore_vregs_<mode>_r12"
|
||||
[(match_parallel 0 "any_parallel_operand"
|
||||
[(clobber (reg:P 65))
|
||||
(use (match_operand:P 1 "symbol_ref_operand" "s"))
|
||||
(clobber (reg:P 12))
|
||||
(use (reg:P 0))
|
||||
(set (match_operand:V4SI 2 "gpc_reg_operand" "=v")
|
||||
(mem:V4SI (plus:P (match_operand:P 3 "gpc_reg_operand" "b")
|
||||
(match_operand:P 4 "short_cint_operand" "I"))))])]
|
||||
""
|
||||
"bl %1"
|
||||
[(set_attr "type" "branch")
|
||||
(set_attr "length" "4")])
|
||||
|
||||
;; Simple binary operations.
|
||||
|
||||
;; add
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -909,8 +909,8 @@ extern unsigned rs6000_pointer_size;
|
||||
#define TOTAL_ALTIVEC_REGS (LAST_ALTIVEC_REGNO - FIRST_ALTIVEC_REGNO + 1)
|
||||
|
||||
#define FIRST_SAVED_ALTIVEC_REGNO (FIRST_ALTIVEC_REGNO+20)
|
||||
#define FIRST_SAVED_FP_REGNO (14+32)
|
||||
#define FIRST_SAVED_GP_REGNO 13
|
||||
#define FIRST_SAVED_FP_REGNO (14+32)
|
||||
#define FIRST_SAVED_GP_REGNO (FIXED_R13 ? 14 : 13)
|
||||
|
||||
/* List the order in which to allocate registers. Each register must be
|
||||
listed once, even those in FIXED_REGISTERS.
|
||||
|
@ -245,13 +245,16 @@ do { \
|
||||
|
||||
/* Define cutoff for using external functions to save floating point.
|
||||
When optimizing for size, use external functions when profitable. */
|
||||
#define FP_SAVE_INLINE(FIRST_REG) (optimize_size \
|
||||
? ((FIRST_REG) == 62 \
|
||||
|| (FIRST_REG) == 63) \
|
||||
: (FIRST_REG) < 64)
|
||||
#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 \
|
||||
|| (FIRST_REG) == 63 \
|
||||
|| !optimize_size)
|
||||
|
||||
/* And similarly for general purpose registers. */
|
||||
#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \
|
||||
&& !optimize_size)
|
||||
#define GP_SAVE_INLINE(FIRST_REG) (!optimize_size)
|
||||
|
||||
/* And vector registers. */
|
||||
#define V_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == LAST_ALTIVEC_REGNO \
|
||||
|| !optimize_size)
|
||||
|
||||
/* Put jump tables in read-only memory, rather than in .text. */
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION 0
|
||||
|
@ -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.
|
||||
|
88
libgcc/config/rs6000/crtrestvr.S
Normal file
88
libgcc/config/rs6000/crtrestvr.S
Normal file
@ -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
|
88
libgcc/config/rs6000/crtsavevr.S
Normal file
88
libgcc/config/rs6000/crtsavevr.S
Normal file
@ -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
|
@ -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
|
||||
|
@ -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 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user