On Sun, Feb 03, 2002 at 03:29:28PM -0800, cgd@broadcom.com 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 limited. Ralf