[cft] excise gen_mem_addressof from ia64

Richard Henderson rth@redhat.com
Fri Jul 2 08:49:00 GMT 2004


This one's a bit harder than Alpha.  Things do get a bit more
serialized than before, but as this only happens with unions,
not generalized long double arithmetic, I think I don't care.

I suppose another option might be to use MEMBER_TYPE_FORCES_BLK
to force such cases to not be in pseudos in the first place.
(I see that we'd need changes to compute_record_mode to make
this work.)  I'm a bit leary what sorts of hidden ABI changes
this might cause, however.  Jim, any thoughts here?

Tested with ia64-linux cross, and examining a few test cases
under gdb.  The ia64 machine to which I normally have access
appears to be dead or off or something, so I can't push this
any farther.  Would someone be so kind as to do a full build
and test?


r~



	* config/ia64/ia64.c (spill_xfmode_operand): Use assign_stack_temp
	instead of gen_mem_addressof.
	* config/ia64/ia64.md (movxf): Use assign_stack_temp to handle
	TImode output register.

Index: ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.293
diff -u -p -r1.293 ia64.c
--- ia64.c	2 Jul 2004 04:53:30 -0000	1.293
+++ ia64.c	2 Jul 2004 08:34:15 -0000
@@ -1640,17 +1640,16 @@ spill_xfmode_operand (rtx in, int force)
       && GET_MODE (SUBREG_REG (in)) == TImode
       && GET_CODE (SUBREG_REG (in)) == REG)
     {
-      rtx mem = gen_mem_addressof (SUBREG_REG (in), NULL_TREE, /*rescan=*/true);
-      return gen_rtx_MEM (XFmode, copy_to_reg (XEXP (mem, 0)));
+      rtx memt = assign_stack_temp (TImode, 16, 0);
+      emit_move_insn (memt, SUBREG_REG (in));
+      return adjust_address (memt, XFmode, 0);
     }
   else if (force && GET_CODE (in) == REG)
     {
-      rtx mem = gen_mem_addressof (in, NULL_TREE, /*rescan=*/true);
-      return gen_rtx_MEM (XFmode, copy_to_reg (XEXP (mem, 0)));
+      rtx memx = assign_stack_temp (XFmode, 16, 0);
+      emit_move_insn (memx, in);
+      return memx;
     }
-  else if (GET_CODE (in) == MEM
-	   && GET_CODE (XEXP (in, 0)) == ADDRESSOF)
-    return change_address (in, XFmode, copy_to_reg (XEXP (in, 0)));
   else
     return in;
 }
Index: ia64.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.md,v
retrieving revision 1.129
diff -u -p -r1.129 ia64.md
--- ia64.md	27 Apr 2004 05:19:49 -0000	1.129
+++ ia64.md	2 Jul 2004 08:34:15 -0000
@@ -742,9 +742,25 @@
 
   if (! reload_in_progress && ! reload_completed)
     {
-      operands[0] = spill_xfmode_operand (operands[0], 0);
       operands[1] = spill_xfmode_operand (operands[1], 0);
 
+      if (GET_MODE (op0) == TImode && GET_CODE (op0) == REG)
+	{
+	  rtx memt, memx, in = operands[1];
+	  if (CONSTANT_P (in))
+	    in = validize_mem (force_const_mem (XFmode, in));
+	  if (GET_CODE (in) == MEM)
+	    memt = adjust_address (in, TImode, 0);
+	  else
+	    {
+	      memt = assign_stack_temp (TImode, 16, 0);
+	      memx = adjust_address (memt, XFmode, 0);
+	      emit_move_insn (memx, in);
+	    }
+	  emit_move_insn (op0, memt);
+	  DONE;
+	}
+
       if (! ia64_move_ok (operands[0], operands[1]))
 	operands[1] = force_reg (XFmode, operands[1]);
     }



More information about the Gcc-patches mailing list