Re: [PATCH] powerpc: add vr save/restore functions

2014-01-08 Thread Andreas Schwab
Michael Ellerman mich...@ellerman.id.au writes:

 On Mon, 2013-12-30 at 15:31 +0100, Andreas Schwab wrote:
 GCC 4.8 now generates out-of-line vr save/restore functions when
 optimizing for size.  They are needed for the raid6 altivec support.

 It looks like they're identical for 32  64-bit ?

They use different temporary registers and calling conventions (no .opd
for ppc64).
  
Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc: add vr save/restore functions

2014-01-08 Thread Michael Ellerman
On Wed, 2014-01-08 at 10:54 +0100, Andreas Schwab wrote:
 Michael Ellerman mich...@ellerman.id.au writes:
 
  On Mon, 2013-12-30 at 15:31 +0100, Andreas Schwab wrote:
  GCC 4.8 now generates out-of-line vr save/restore functions when
  optimizing for size.  They are needed for the raid6 altivec support.
 
  It looks like they're identical for 32  64-bit ?
 
 They use different temporary registers and calling conventions (no .opd
 for ppc64).

Yeah, sorry, you'd think I could spot the difference between r11 and r12.

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc: add vr save/restore functions

2014-01-07 Thread Michael Ellerman
On Mon, 2013-12-30 at 15:31 +0100, Andreas Schwab wrote:
 GCC 4.8 now generates out-of-line vr save/restore functions when
 optimizing for size.  They are needed for the raid6 altivec support.

It looks like they're identical for 32  64-bit ? If so can't we arrange to
have a single version?

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] powerpc: add vr save/restore functions

2013-12-30 Thread Andreas Schwab
GCC 4.8 now generates out-of-line vr save/restore functions when
optimizing for size.  They are needed for the raid6 altivec support.

Signed-off-by: Andreas Schwab sch...@linux-m68k.org
---
 arch/powerpc/lib/crtsavres.S | 186 +++
 scripts/mod/modpost.c|   8 +-
 2 files changed, 192 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/lib/crtsavres.S b/arch/powerpc/lib/crtsavres.S
index b2c68ce..a5b30c7 100644
--- a/arch/powerpc/lib/crtsavres.S
+++ b/arch/powerpc/lib/crtsavres.S
@@ -231,6 +231,87 @@ _GLOBAL(_rest32gpr_31_x)
mr  1,11
blr
 
+#ifdef CONFIG_ALTIVEC
+/* Called with r0 pointing just beyond the end of the vector save area.  */
+
+_GLOBAL(_savevr_20)
+   li  r11,-192
+   stvxvr20,r11,r0
+_GLOBAL(_savevr_21)
+   li  r11,-176
+   stvxvr21,r11,r0
+_GLOBAL(_savevr_22)
+   li  r11,-160
+   stvxvr22,r11,r0
+_GLOBAL(_savevr_23)
+   li  r11,-144
+   stvxvr23,r11,r0
+_GLOBAL(_savevr_24)
+   li  r11,-128
+   stvxvr24,r11,r0
+_GLOBAL(_savevr_25)
+   li  r11,-112
+   stvxvr25,r11,r0
+_GLOBAL(_savevr_26)
+   li  r11,-96
+   stvxvr26,r11,r0
+_GLOBAL(_savevr_27)
+   li  r11,-80
+   stvxvr27,r11,r0
+_GLOBAL(_savevr_28)
+   li  r11,-64
+   stvxvr28,r11,r0
+_GLOBAL(_savevr_29)
+   li  r11,-48
+   stvxvr29,r11,r0
+_GLOBAL(_savevr_30)
+   li  r11,-32
+   stvxvr30,r11,r0
+_GLOBAL(_savevr_31)
+   li  r11,-16
+   stvxvr31,r11,r0
+   blr
+
+_GLOBAL(_restvr_20)
+   li  r11,-192
+   lvx vr20,r11,r0
+_GLOBAL(_restvr_21)
+   li  r11,-176
+   lvx vr21,r11,r0
+_GLOBAL(_restvr_22)
+   li  r11,-160
+   lvx vr22,r11,r0
+_GLOBAL(_restvr_23)
+   li  r11,-144
+   lvx vr23,r11,r0
+_GLOBAL(_restvr_24)
+   li  r11,-128
+   lvx vr24,r11,r0
+_GLOBAL(_restvr_25)
+   li  r11,-112
+   lvx vr25,r11,r0
+_GLOBAL(_restvr_26)
+   li  r11,-96
+   lvx vr26,r11,r0
+_GLOBAL(_restvr_27)
+   li  r11,-80
+   lvx vr27,r11,r0
+_GLOBAL(_restvr_28)
+   li  r11,-64
+   lvx vr28,r11,r0
+_GLOBAL(_restvr_29)
+   li  r11,-48
+   lvx vr29,r11,r0
+_GLOBAL(_restvr_30)
+   li  r11,-32
+   lvx vr30,r11,r0
+_GLOBAL(_restvr_31)
+   li  r11,-16
+   lvx vr31,r11,r0
+   blr
+
+#endif /* CONFIG_ALTIVEC */
+
 #else /* CONFIG_PPC64 */
 
.section .text.save.restore,ax,@progbits
@@ -356,6 +437,111 @@ _restgpr0_31:
mtlrr0
blr
 
+#ifdef CONFIG_ALTIVEC
+/* Called with r0 pointing just beyond the end of the vector save area.  */
+
+.globl _savevr_20
+_savevr_20:
+   li  r12,-192
+   stvxvr20,r12,r0
+.globl _savevr_21
+_savevr_21:
+   li  r12,-176
+   stvxvr21,r12,r0
+.globl _savevr_22
+_savevr_22:
+   li  r12,-160
+   stvxvr22,r12,r0
+.globl _savevr_23
+_savevr_23:
+   li  r12,-144
+   stvxvr23,r12,r0
+.globl _savevr_24
+_savevr_24:
+   li  r12,-128
+   stvxvr24,r12,r0
+.globl _savevr_25
+_savevr_25:
+   li  r12,-112
+   stvxvr25,r12,r0
+.globl _savevr_26
+_savevr_26:
+   li  r12,-96
+   stvxvr26,r12,r0
+.globl _savevr_27
+_savevr_27:
+   li  r12,-80
+   stvxvr27,r12,r0
+.globl _savevr_28
+_savevr_28:
+   li  r12,-64
+   stvxvr28,r12,r0
+.globl _savevr_29
+_savevr_29:
+   li  r12,-48
+   stvxvr29,r12,r0
+.globl _savevr_30
+_savevr_30:
+   li  r12,-32
+   stvxvr30,r12,r0
+.globl _savevr_31
+_savevr_31:
+   li  r12,-16
+   stvxvr31,r12,r0
+   blr
+
+.globl _restvr_20
+_restvr_20:
+   li  r12,-192
+   lvx vr20,r12,r0
+.globl _restvr_21
+_restvr_21:
+   li  r12,-176
+   lvx vr21,r12,r0
+.globl _restvr_22
+_restvr_22:
+   li  r12,-160
+   lvx vr22,r12,r0
+.globl _restvr_23
+_restvr_23:
+   li  r12,-144
+   lvx vr23,r12,r0
+.globl _restvr_24
+_restvr_24:
+   li  r12,-128
+   lvx vr24,r12,r0
+.globl _restvr_25
+_restvr_25:
+   li  r12,-112
+   lvx vr25,r12,r0
+.globl _restvr_26
+_restvr_26:
+   li  r12,-96
+   lvx vr26,r12,r0
+.globl _restvr_27
+_restvr_27:
+   li  r12,-80
+   lvx vr27,r12,r0
+.globl _restvr_28
+_restvr_28:
+   li  r12,-64
+   lvx vr28,r12,r0
+.globl _restvr_29
+_restvr_29:
+   li  r12,-48
+   lvx vr29,r12,r0
+.globl _restvr_30
+_restvr_30:
+   li  r12,-32
+   lvx vr30,r12,r0
+.globl _restvr_31
+_restvr_31:
+   li  r12,-16
+   lvx vr31,r12,r0
+   blr
+
+#endif /* CONFIG_ALTIVEC */
+
 #endif /* CONFIG_PPC64 */
 
 #endif
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 1785576..4061098