This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [csl-asm?] PR middle-end/11821: Tweak arm_rtx_costs_1
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Mon, 17 Nov 2003 16:00:30 +0000
- Subject: Re: [csl-asm?] PR middle-end/11821: Tweak arm_rtx_costs_1
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
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.