This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: Fix ll/sc for mips (take 3)
- From: Ralf Baechle <ralf at oss dot sgi dot com>
- To: cgd at broadcom dot com
- Cc: hjl at lucon dot org, Justin Carlson <justinca at ri dot cmu dot edu>, Daniel Jacobowitz <dan at debian dot org>, "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>, Hiroyuki Machida <machida at sm dot sony dot co dot jp>, libc-alpha at sources dot redhat dot com, linux-mips at oss dot sgi dot com, gcc at gcc dot gnu dot org
- Date: Mon, 4 Feb 2002 07:07:41 +0100
- Subject: Re: PATCH: Fix ll/sc for mips (take 3)
- References: <20020131231714.E32690@lucon.org> <Pine.GSO.3.96.1020201124328.26449Aemail@example.com> <20020201102943.A11146@lucon.org> <20020201180126.A23740@nevyn.them.org> <20020201151513.A15913@lucon.org> <20020201222657.A13339@nevyn.them.org> <firstname.lastname@example.org> <20020202120354.A1522@lucon.org> <mailpost.1012680250.7159@news-sj1-1> <email@example.com>
On Sun, Feb 03, 2002 at 03:29:28PM -0800, firstname.lastname@example.org wrote:
> At Sat, 2 Feb 2002 20:04:10 +0000 (UTC), "H . J . Lu" wrote:
> > Does everyone agree with this? If yes, I can make a patch not to use
> > branch likely. But on the other hand, "gcc -mips2" will generate code
> > using branch likely. If branch likely doesn't buy you anything,
> > shouldn't we change gcc not to generate branch likely instructions?
> Branch-likely instructions probably _do_ buy you something (at least,
> slightly less code size) on some CPUs, probably even some CPUs which
> are still being produced.
I benchmarked the performance improvment on R4000/R4400 by using branch
likely instructions to be in the range of 1-2% in a piece of pretty
"branchy" code, so we don't want to disable branch likely right entirely.
Newer CPU types, in particular those featuring branch prediction tend to
I suggest to enable branch likely in gcc for those > MIPS II CPUs where
they're known to improve performance or when optimizing for code size.
Unfortunately gcc's knowledge about such architecture details is rather