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]

[PATCH] ARM PR target/12133 index range of DFmode


A long time ago I restricted the indexing range of DFmode to be those
offsets that can be handled by a load-multiple instruction, namely -8,
-4, 0, and +4.  This was probably a good idea at the time, since
load-multiple instructions on the then-current architectures were far
more efficient than separate load instructions.  However, modern cores
are now at least as efficient using to ldr instructions and the ability
to use a larger offset range means that the trade-offs probably
no-longer hold (and even when they do, should probably be coded in the
rtx cost or address cost macros).

A consequence of the old code, and this is what forced me to confront
the above issue, was the failure in PR 12133.  In this case reload is
trying to judge whether an address in a V2DF can be split into suitable
subreg loads.  It does this by calling offsettable_memref_p which in
turn calls offsettable_address_p.  The latter is written with the
assumption that if an address is offsettable with in QImode with some
constant then any constant smaller than this will probably be valid in
any other mode (with the possible constraint that the wider mode must
maintain alignment).  This was clearly a false assumption for DFmode
where the offsettable range is practically zero (and certainly didn't
include the second element of a V2DF vector).  I did consider at one
point changing the code in reload to avoid calling offsettable_memref_p
in this case, the patch did solve the abort, but it still left us with
the situation that offsettable_address_p could fail in other cases.

Strictly speaking we should probably be making MODE_DEPENDENT_ADDRESS
return non-zero for any address that has an existing offset larger than
the smallest offset supported by any mode, this would then make
offsettable_address_p well defined again -- but the consequences of
doing this when the smallest offset was +/-4 was somewhat unpalatable. 
Hence the desire to increase the range of DFmode and DImode.  We're now
in the situation where we could probably do this for any offset outside
the range -255...255 without major consequence.

R.

2004-07-09  Richard Earnshaw  <rearnsha@arm.com>

	PR target/12133
	* arm.c (arm_legitimate_index_p) Allow DFmode for soft-float 
	and DImode to use +/-4k offset.


Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.374
diff -p -r1.374 arm.c
*** config/arm/arm.c	9 Jul 2004 09:30:45 -0000	1.374
--- config/arm/arm.c	9 Jul 2004 09:59:53 -0000
*************** arm_legitimate_index_p (enum machine_mod
*** 3110,3116 ****
  	  if (TARGET_LDRD)
  	    return val > -256 && val < 256;
  	  else
! 	    return val == 4 || val == -4 || val == -8;
  	}
  
        return TARGET_LDRD && arm_address_register_rtx_p (index, strict_p);
--- 3110,3116 ----
  	  if (TARGET_LDRD)
  	    return val > -256 && val < 256;
  	  else
! 	    return val > -4096 && val < 4092;
  	}
  
        return TARGET_LDRD && arm_address_register_rtx_p (index, strict_p);

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