PATCH middle-end: handle decimal float moves
Ben Elliston
bje@au1.ibm.com
Mon Jan 9 23:54:00 GMT 2006
> 2006-01-10 Ben Elliston <bje@au.ibm.com>
>
> * expr.c (emit_move_change_mode): Always adjust addresses, not
> just during reload. Copy replacements only during reload.
> (emit_move_insn_1): Move MODE_DECIMAL_FLOAT modes by invoking
> emit_move_via_integer.
A small amendment: I attached an older version of this patch; the
correct one follows. The only difference is that true is passed as
the `force' argument to emit_move_via_integer.
Index: expr.c
===================================================================
--- expr.c (revision 109509)
+++ expr.c (working copy)
@@ -1,6 +1,7 @@
/* Convert tree expression to rtl instructions, for GNU compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+ Inc.
This file is part of GCC.
@@ -2783,7 +2784,7 @@ emit_move_change_mode (enum machine_mode
{
rtx ret;
- if (reload_in_progress && MEM_P (x))
+ if (MEM_P (x))
{
/* We can't use gen_lowpart here because it may call change_address
which is not appropriate if we were called when a reload was in
@@ -2791,9 +2792,9 @@ emit_move_change_mode (enum machine_mode
the size in bytes is supposed to be the same. Copy the MEM to
change the mode and move any substitutions from the old MEM to
the new one. */
-
ret = adjust_address_nv (x, new_mode, 0);
- copy_replacements (x, ret);
+ if (reload_in_progress)
+ copy_replacements (x, ret);
}
else
{
@@ -3128,6 +3129,9 @@ emit_move_insn_1 (rtx x, rtx y)
if (COMPLEX_MODE_P (mode))
return emit_move_complex (mode, x, y);
+ if (GET_MODE_CLASS (mode) == MODE_DECIMAL_FLOAT)
+ return emit_move_via_integer (mode, x, y, true);
+
if (GET_MODE_CLASS (mode) == MODE_CC)
return emit_move_ccmode (mode, x, y);
More information about the Gcc-patches
mailing list