[Top] [All Lists]

Re: PATCH: Fix ll/sc for mips (take 3)

Subject: Re: PATCH: Fix ll/sc for mips (take 3)
From: Ralf Baechle <>
Date: Mon, 4 Feb 2002 07:07:41 +0100
Cc:, Justin Carlson <>, Daniel Jacobowitz <>, "Maciej W. Rozycki" <>, Hiroyuki Machida <>,,,
In-reply-to: <>; from on Sun, Feb 03, 2002 at 03:29:28PM -0800
References: <> <> <> <> <> <> <> <> <mailpost.1012680250.7159@news-sj1-1> <>
User-agent: Mutt/1.2.5i
On Sun, Feb 03, 2002 at 03:29:28PM -0800, 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
perform differently.

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


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