This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mips:redundant output


tanaka wrote:
> Hello,
> 
> On the
> >GNU assembler version 2.14 (mips64vrel-unknown-elf) using BFD version
> 2.14 20030612
> environment, the assembled output code of the following sample is redundant.
> ---- sample(test.s) -----
> 	.globl _a
> 	.type _a, @function
> _a:
> 	lw $24, 0xaF000440
> -----------------
> /work/linux/tool/Linux-i686/mips64vrel-unknown-elf/bin/as -o test.o test.s
> ---- output(test.o) -----
> 00000000 <_a>:
>    0:   3c180000    lui t8,0x0
>    4:   3c01af00    lui at,0xaf00
>    8:   67180001    daddiu  t8,t8,1
>    c:   0018c03c    dsll32  t8,t8,0x0
>   10:   0301c02d    daddu   t8,t8,at
>   14:   8f180440    lw  t8,1088(t8)

This creates a 64 bit value without sign extension.

> On the previous (GNU assembler version 2.11.2 (mips64vr5000-elf) using
> BFD version 2.11.2)

That's a very old gas which had IIRC no 64 bit addressing mode.

> environment, the assembled output code of the same sample is this.
> -----------------
> /work/linux/tool/build/gnu/binutils-2.11.2/Linux-i686.mips64vrel/gas/as-new
> -EL -o test.o test.s
> ---- output(test.o) -----
> 0000000000000000 <_a>:
>    0:   3c18af00    lui t8,0xaf00
>    4:   8f180440    lw  t8,1088(t8)

This creates a 32/64 bit sign extended value.

> -----------------
> Is this bug?

Rather a feature. Use the "-32" option if you want O32 ABI style
32 bit addressing.


Thiemo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]