public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Optimzie brl to br for ia64
@ 2003-03-12 23:56 H. J. Lu
  2003-03-12 23:57 ` H. J. Lu
  2003-03-13  1:09 ` Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: H. J. Lu @ 2003-03-12 23:56 UTC (permalink / raw)
  To: binutils

On ia64, brl, which may be introduced by relaxation, can be optimized
to br. Here is a testcase:

# make
cc -O -S foo.c
echo "  .align 32" >> foo.s
echo "  .skip 0xf60000" >> foo.s
cc -o foo -B./ -static foo.s
cc: file path prefix `./' never used
./foo
hello
objdump -d foo > foo.list
grep brl foo.list
4000000000f604a0:       05 00 00 00 01 00       [MLX]       nop.m 0x0
4000000000f604a6:       00 00 00 00 00 00                   brl.few 40000000010011c0 <foo>;;
4000000000f604ac:       20 0d 0a c0

This brl can be optimized by br since the dispacement is less than
16MB:

4000000000f604a0:       13 00 00 00 01 00       [MBB]       nop.m 0x0
4000000000f604a6:       00 00 00 00 10 00                   nop.b 0x0
4000000000f604ac:       20 0d 0a 40                         br.few 40000000010011c0 <foo>;;

We can do it automatically or we can turn it on by a switch. ld does
support -On. But it also turn on other stuff. Any suggestions?

Thanks.


H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Optimzie brl to br for ia64
  2003-03-12 23:56 Optimzie brl to br for ia64 H. J. Lu
@ 2003-03-12 23:57 ` H. J. Lu
  2003-03-13  1:09 ` Richard Henderson
  1 sibling, 0 replies; 5+ messages in thread
From: H. J. Lu @ 2003-03-12 23:57 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

On Wed, Mar 12, 2003 at 03:56:24PM -0800, H. J. Lu wrote:
> On ia64, brl, which may be introduced by relaxation, can be optimized
> to br. Here is a testcase:
> 
> # make
> cc -O -S foo.c
> echo "  .align 32" >> foo.s
> echo "  .skip 0xf60000" >> foo.s
> cc -o foo -B./ -static foo.s
> cc: file path prefix `./' never used
> ./foo
> hello
> objdump -d foo > foo.list
> grep brl foo.list
> 4000000000f604a0:       05 00 00 00 01 00       [MLX]       nop.m 0x0
> 4000000000f604a6:       00 00 00 00 00 00                   brl.few 40000000010011c0 <foo>;;
> 4000000000f604ac:       20 0d 0a c0
> 
> This brl can be optimized by br since the dispacement is less than
> 16MB:
> 
> 4000000000f604a0:       13 00 00 00 01 00       [MBB]       nop.m 0x0
> 4000000000f604a6:       00 00 00 00 10 00                   nop.b 0x0
> 4000000000f604ac:       20 0d 0a 40                         br.few 40000000010011c0 <foo>;;
> 
> We can do it automatically or we can turn it on by a switch. ld does
> support -On. But it also turn on other stuff. Any suggestions?
> 
> Thanks.

Oops. Here is the testcase.


H.J.

[-- Attachment #2: bug.tar.gz --]
[-- Type: application/x-gzip, Size: 454 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Optimzie brl to br for ia64
  2003-03-12 23:56 Optimzie brl to br for ia64 H. J. Lu
  2003-03-12 23:57 ` H. J. Lu
@ 2003-03-13  1:09 ` Richard Henderson
  2003-03-13 23:31   ` H. J. Lu
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2003-03-13  1:09 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Wed, Mar 12, 2003 at 03:56:24PM -0800, H. J. Lu wrote:
> On ia64, brl, which may be introduced by relaxation, can be optimized
> to br. Here is a testcase:

Ok, sure, but why bother?  The cases in which one object file
is that large, and yet the target is actually in range of a 
br is approximately nil.  Plus, brl and br are the same speed
on Itanium2, so I don't see what the effort would buy you.



r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Optimzie brl to br for ia64
  2003-03-13  1:09 ` Richard Henderson
@ 2003-03-13 23:31   ` H. J. Lu
  2003-03-17 18:24     ` Richard Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: H. J. Lu @ 2003-03-13 23:31 UTC (permalink / raw)
  To: Richard Henderson; +Cc: binutils

On Wed, Mar 12, 2003 at 05:09:26PM -0800, Richard Henderson wrote:
> On Wed, Mar 12, 2003 at 03:56:24PM -0800, H. J. Lu wrote:
> > On ia64, brl, which may be introduced by relaxation, can be optimized
> > to br. Here is a testcase:
> 
> Ok, sure, but why bother?  The cases in which one object file
> is that large, and yet the target is actually in range of a 
> br is approximately nil.  Plus, brl and br are the same speed
> on Itanium2, so I don't see what the effort would buy you.
> 

I was told br had better branch predication accuracy on Itanium 2.


H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Optimzie brl to br for ia64
  2003-03-13 23:31   ` H. J. Lu
@ 2003-03-17 18:24     ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2003-03-17 18:24 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Thu, Mar 13, 2003 at 03:31:41PM -0800, H. J. Lu wrote:
> I was told br had better branch predication accuracy on Itanium 2.

It does.  However, there will not be another aliasing branch
in the bundle pair.

If you're that concerned, you can implement this yourself;
I don't think it's worthwhile myself.


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-17 18:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-12 23:56 Optimzie brl to br for ia64 H. J. Lu
2003-03-12 23:57 ` H. J. Lu
2003-03-13  1:09 ` Richard Henderson
2003-03-13 23:31   ` H. J. Lu
2003-03-17 18:24     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).