linux-mips
[Top] [All Lists]

Re: [patch] MIPS/gcc: Revert removal of DImode shifts for 32-bit targets

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [patch] MIPS/gcc: Revert removal of DImode shifts for 32-bit targets
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Mon, 26 Jul 2004 13:56:47 +0200 (CEST)
Cc: Richard Henderson <rth@redhat.com>, Richard Sandiford <rsandifo@redhat.com>, gcc-patches@gcc.gnu.org, linux-mips@linux-mips.org
In-reply-to: <20040723211232.GB5138@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.55.0407191648451.3667@jurand.ds.pg.gda.pl> <87hds49bmo.fsf@redhat.com> <Pine.LNX.4.55.0407191907300.3667@jurand.ds.pg.gda.pl> <20040719213801.GD14931@redhat.com> <Pine.LNX.4.55.0407201505330.14824@jurand.ds.pg.gda.pl> <20040723202703.GB30931@redhat.com> <20040723211232.GB5138@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 23 Jul 2004, Ralf Baechle wrote:

> With a bit of hand waiving because haven't done benchmarks I guess Richard
> might be right.  The subroutine calling overhead on modern processors is
> rather low and smaller code means better cache hit rates ...

 Well, I just worry the call may itself include at least the same number
of instructions as the callee if inlined.  There would be no way for it to
be faster.

 That may happen for a leaf function -- the call itself, plus $ra
saving/restoration is already four instructions.  Now it's sufficient for
two statics to be needed to preserve temporaries across such a call and
the size of the caller is already the same.  With three statics, you lose
even for a non-leaf function.  That's for a function containing a single
call to such a shift -- if there are more, then you may win (but is it
common?).

 So not only it may not be faster, but the resulting code may be bigger as
well.  That said, the current GCC's implementation of these operations is
not exactly optimal for current MIPS processors.  That's trivial to deal
with in Linux, but would it be possible to pick a different implementation
from libgcc based on the "-march=" setting, too?

  Maciej

<Prev in Thread] Current Thread [Next in Thread>