This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix oops with last long double patch


Turns out I hadn't actually bootstrapped my previous patch, and it
caused subtle codegen problems in the stage1 compiler, because of
course while it's fine to clobber the destination before loading
from memory, clobbering the *source* before storing to memory doesn't
work so well :-).

This patch really was bootstrapped & tested on powerpc-darwin.
There are a few of new libstdc++ testcase fails, due to the OS not
having long double routines.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-longdoubleoops.patch==================
2004-08-01  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/rs6000.c (rs6000_split_multireg_move): Just abort
	if trying to *store* to a non-offsettable address.
	* config/rs6000/rs6000.md (movtf_internal): Don't move GPRs to
	a nonoffsettable address.
	(movdi_internal32): Don't move GPRs to a nonoffsettable address.
	Clean up.
	(movti_string): Don't move GPRs to a nonoffsettable address.
	(movti_ppc64): Don't move GPRs to a nonoffsettable address.  Clean up.

Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.674
diff -u -p -u -p -r1.674 rs6000.c
--- config/rs6000/rs6000.c	31 Jul 2004 01:40:16 -0000	1.674
+++ config/rs6000/rs6000.c	2 Aug 2004 01:43:24 -0000
@@ -11134,14 +11134,7 @@ rs6000_split_multireg_move (rtx dst, rtx
 	      dst = gen_rtx_MEM (mode, breg);
 	    }
 	  else if (! offsettable_memref_p (dst))
-	    {
-	      rtx newdst, basereg;
-	      basereg = gen_rtx_REG (Pmode, reg);
-	      emit_insn (gen_rtx_SET (VOIDmode, basereg, XEXP (dst, 0)));
-	      newdst = gen_rtx_MEM (GET_MODE (dst), basereg);
-	      MEM_COPY_ATTRIBUTES (newdst, dst);
-	      dst = newdst;
-	    }
+	    abort ();
 	}
 
       for (i = 0; i < nregs; i++)
Index: config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.314
diff -u -p -u -p -r1.314 rs6000.md
--- config/rs6000/rs6000.md	28 Jul 2004 12:13:12 -0000	1.314
+++ config/rs6000/rs6000.md	2 Aug 2004 01:43:25 -0000
@@ -8301,10 +8301,10 @@
 
 ; It's important to list the o->f and f->o moves before f->f because
 ; otherwise reload, given m->f, will try to pick f->f and reload it,
-; which doesn't make progress.
+; which doesn't make progress.  Likewise r->o<> must be before r->r.
 (define_insn_and_split "*movtf_internal"
-  [(set (match_operand:TF 0 "nonimmediate_operand" "=o,f,f,rm,r")
-	(match_operand:TF 1 "input_operand"         "f,o,f,r,mGHF"))]
+  [(set (match_operand:TF 0 "nonimmediate_operand" "=o,f,f,r,o<>,r")
+	(match_operand:TF 1 "input_operand"         "f,o,f,mGHF,r,r"))]
   "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
    && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128
    && (gpc_reg_operand (operands[0], TFmode)
@@ -8313,7 +8313,7 @@
   "&& reload_completed"
   [(pc)]
 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; }
-  [(set_attr "length" "8,8,8,20,20")])
+  [(set_attr "length" "8,8,8,20,20,16")])
 
 (define_expand "extenddftf2"
   [(parallel [(set (match_operand:TF 0 "nonimmediate_operand" "")
@@ -8506,37 +8506,23 @@
   ""
   "{ rs6000_emit_move (operands[0], operands[1], DImode); DONE; }")
 
+; List r->r after r->"o<>", otherwise reload will try to reload a
+; non-offsettable address by using r->r which won't make progress.
 (define_insn "*movdi_internal32"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r")
-	(match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))]
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,r,r,f,f,m,r")
+	(match_operand:DI 1 "input_operand" "r,r,m,f,m,f,IJKnGHF"))]
   "! TARGET_POWERPC64
    && (gpc_reg_operand (operands[0], DImode)
        || gpc_reg_operand (operands[1], DImode))"
-  "*
-{
-  switch (which_alternative)
-    {
-    default:
-      abort ();
-    case 0:
-    case 1:
-    case 2:
-      return \"#\";
-    case 3:
-      return \"fmr %0,%1\";
-    case 4:
-      return \"lfd%U1%X1 %0,%1\";
-    case 5:
-      return \"stfd%U0%X0 %1,%0\";
-    case 6:
-    case 7:
-    case 8:
-    case 9:
-    case 10:
-      return \"#\";
-    }
-}"
-  [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*,*,*,*")])
+  "@
+   #
+   #
+   #
+   fmr %0,%1
+   lfd%U1%X1 %0,%1
+   stfd%U0%X0 %1,%0
+   #"
+  [(set_attr "type" "load,*,store,fp,fpload,fpstore,*")])
 
 (define_split
   [(set (match_operand:DI 0 "gpc_reg_operand" "")
@@ -8751,7 +8737,7 @@
   [(set_attr "type" "store,store,*,load,load")])
 
 (define_insn "*movti_string"
-  [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
+  [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,o<>,????r,????r,????r")
 	(match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))]
   "! TARGET_POWER && ! TARGET_POWERPC64
    && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
@@ -8781,14 +8767,11 @@
   [(set_attr "type" "store,store,*,load,load")])
 
 (define_insn "*movti_ppc64"
-  [(set (match_operand:TI 0 "nonimmediate_operand" "=r,m,r")
-	(match_operand:TI 1 "input_operand" "r,r,o"))]
+  [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o<>,r")
+	(match_operand:TI 1 "input_operand" "r,r,m"))]
   "TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode)
    || gpc_reg_operand (operands[1], TImode))"
-  "@
-   #
-   #
-   #"
+  "#"
   [(set_attr "type" "*,load,store")])
 
 (define_split
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]