Optimzie brl to br for ia64

H. J. Lu hjl@lucon.org
Wed Mar 12 23:56:00 GMT 2003
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.



More information about the Binutils mailing list