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]

Re: [csl-asm?] PR middle-end/11821: Tweak arm_rtx_costs_1


roger@eyesopen.com said:
> 2003-11-15  Roger Sayle  <roger@eyesopen.com>
> 	PR middle-end/11821
> 	* config/arm/arm.c (arm_rtx_costs_1): Improve estimate of the code
> 	size for calls to libgcc's div & mod subroutines when using -Os. 

Mark and I discussed some issues related to arm_rtx_costs recently and we 
were both in agreement that the current implementation is in serious want 
of a rewrite.  As such, I'm not convinced this should go on the csl-arm 
branch.

However, I do think this is small enough and simple enough (and against a 
PR) that it is suitable for the trunk, even at this stage.

But before you check it in, why did you use a cost of two insns?  A div 
call is typically going to be about four insns long (two to set up the 
arguments, one for the call and one to move the result somewhere useful.  
In addition to this, we have to consider the fact that making a call will 
clobber the six call-clobbered registers and potentially turn a leaf 
function into a non-leaf one.  I would expect (though it would need 
measuring on real code) that any division by a power of two, whether 
signed or unsigned, will continue to be best done inline.

R.


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