[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#611249: gcc-4.4: please update powerpcspe patches



Okay, I finally made it. Here is my list of gcc for powerpcspe:
- no_fpr_in_libgcc.diff
  It does not really harm by including them since nobody should use them
  but gas does not wont to assmebly hard float since they are not
  available on this cpu. Upstream did respond.
  
- powerpc_remove_many.diff
  this helps to to detect opcodes which are not part of the current
  CPU because without -many gas won't touch them. This currently could
  break the kernel build as the 603 on steroids cpus use performance
  counter opcodes which are not available on the steroid less 603 core.

- pr44364.diff
  This patch made it into trunk. I don't get it into the 4.4 branch
  because I can't prove that it is a regression since 4.3. If you worry
  about caller-save.c changes I could ifdef __SPE__ them.

I dropped pr44606 because I saw it in svn-updates.diff as of the -12
release. I also dropped the lwsync & eieio patches because this
nightmare is allready addressed in gas.

Sebastian
Index: gcc-4.4.5/src/gcc/config/rs6000/crtresfpr.asm
===================================================================
--- gcc-4.4.5.orig/src/gcc/config/rs6000/crtresfpr.asm	2011-02-13 17:25:36.000000000 +0100
+++ gcc-4.4.5/src/gcc/config/rs6000/crtresfpr.asm	2011-02-13 17:26:14.000000000 +0100
@@ -33,6 +33,7 @@
 
 /* On PowerPC64 Linux, these functions are provided by the linker.  */
 #ifndef __powerpc64__
+#ifndef __NO_FPRS__
 
 /* Routines for restoring floating point registers, called by the compiler.  */
 /* Called with r11 pointing to the stack header word of the caller of the */
@@ -77,3 +78,4 @@
 FUNC_END(_restfpr_14)
 
 #endif
+#endif
Index: gcc-4.4.5/src/gcc/config/rs6000/crtresxfpr.asm
===================================================================
--- gcc-4.4.5.orig/src/gcc/config/rs6000/crtresxfpr.asm	2011-02-13 17:25:36.000000000 +0100
+++ gcc-4.4.5/src/gcc/config/rs6000/crtresxfpr.asm	2011-02-13 17:26:29.000000000 +0100
@@ -33,6 +33,7 @@
 
 /* On PowerPC64 Linux, these functions are provided by the linker.  */
 #ifndef __powerpc64__
+#ifndef __NO_FPRS__
 
 /* Routines for restoring floating point registers, called by the compiler.  */
 /* Called with r11 pointing to the stack header word of the caller of the */
@@ -82,3 +83,4 @@
 FUNC_END(_restfpr_14_x)
 
 #endif
+#endif
Index: gcc-4.4.5/src/gcc/config/rs6000/crtsavfpr.asm
===================================================================
--- gcc-4.4.5.orig/src/gcc/config/rs6000/crtsavfpr.asm	2011-02-13 17:25:36.000000000 +0100
+++ gcc-4.4.5/src/gcc/config/rs6000/crtsavfpr.asm	2011-02-13 17:26:42.000000000 +0100
@@ -33,6 +33,7 @@
 
 /* On PowerPC64 Linux, these functions are provided by the linker.  */
 #ifndef __powerpc64__
+#ifndef __NO_FPRS__
 
 /* Routines for saving floating point registers, called by the compiler.  */
 /* Called with r11 pointing to the stack header word of the caller of the */
@@ -77,3 +78,4 @@
 FUNC_END(_savefpr_14)
 
 #endif
+#endif
Subject: [PATCH] remove -many on __SPE__ target

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---

Index: gcc-4.4.5/src/gcc/config/rs6000/rs6000.h
===================================================================
--- gcc-4.4.5.orig/src/gcc/config/rs6000/rs6000.h	2009-04-10 01:23:07.000000000 +0200
+++ gcc-4.4.5/src/gcc/config/rs6000/rs6000.h	2011-02-13 17:57:17.000000000 +0100
@@ -83,6 +83,12 @@
 #define ASM_CPU_POWER7_SPEC "-mpower4 -maltivec"
 #endif
 
+#ifndef __SPE__
+#define ASM_CPU_SPU_MANY_NOT_SPE "-many"
+#else
+#define ASM_CPU_SPU_MANY_NOT_SPE
+#endif
+
 /* Common ASM definitions used by ASM_SPEC among the various targets
    for handling -mcpu=xxx switches.  */
 #define ASM_CPU_SPEC \
@@ -147,7 +153,8 @@
 %{mcpu=e300c3: -me300} \
 %{mcpu=e500mc: -me500mc} \
 %{maltivec: -maltivec} \
--many"
+" \
+ASM_CPU_SPU_MANY_NOT_SPE
 
 #define CPP_DEFAULT_SPEC ""
 
Index: gcc/caller-save.c
===================================================================
--- a/src/gcc/caller-save.c	(revision 160245)
+++ b/src/gcc/caller-save.c	(working copy)
@@ -1080,7 +1080,7 @@ insert_restore (struct insn_chain *chain
       /* Check that insn to restore REGNO in save_mode[regno] is
 	 correct.  */
       && reg_save_code (regno, save_mode[regno]) >= 0)
-    mem = adjust_address (mem, save_mode[regno], 0);
+    mem = adjust_address_nv (mem, save_mode[regno], 0);
   else
     mem = copy_rtx (mem);
 
@@ -1161,7 +1161,7 @@ insert_save (struct insn_chain *chain, i
       /* Check that insn to save REGNO in save_mode[regno] is
 	 correct.  */
       && reg_save_code (regno, save_mode[regno]) >= 0)
-    mem = adjust_address (mem, save_mode[regno], 0);
+    mem = adjust_address_nv (mem, save_mode[regno], 0);
   else
     mem = copy_rtx (mem);
 
Index: gcc/config/rs6000/e500.h
===================================================================
--- a/src/gcc/config/rs6000/e500.h	(revision 160245)
+++ b/src/gcc/config/rs6000/e500.h	(working copy)
@@ -43,3 +43,10 @@
 	  error ("E500 and FPRs not supported");			\
       }									\
   } while (0)
+
+/* When setting up caller-save slots (MODE == VOIDmode) ensure we
+   allocate space for DFmode.  Save gprs in the correct mode too.  */
+#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
+  (TARGET_E500_DOUBLE && ((MODE) == VOIDmode || (MODE) == DFmode)	\
+   ? DFmode								\
+   : choose_hard_reg_mode ((REGNO), (NREGS), false))

Reply to: