This is the mail archive of the binutils@sourceware.org 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: [PATCH 1/2] MIPS/GAS: Fix o32 LD to the base register


"Maciej W. Rozycki" <macro@linux-mips.org> writes:
>  Here's another one:
>
> $ cat ld-base.s
> 	ld	$4, ($4)
> $ mips-linux-as -o ld-base.o ld-base.s
> $ mips-linux-objdump -d ld-base.o
>
> ld-base.o:     file format elf32-tradbigmips
>
>
> Disassembly of section .text:
>
> 00000000 <.text>:
>    0:	8c840000 	lw	a0,0(a0)
>    4:	00000000 	nop
>    8:	8c850004 	lw	a1,4(a0)
>
> Ouch!
>
>  Fixed thus and regression tested for mips-linux, mips64-linux, 
> mipstx39-elf, mipsisa64-elf and mips-ecoff targets and their little-endian 
> counterparts.  The new code produced looks like this:
>
> $ mips-linux-objdump -d ld-base.o
>
> ld-base.o:     file format elf32-tradbigmips
>
>
> Disassembly of section .text:
>
> 00000000 <.text>:
>    0:	00800821 	move	at,a0
>    4:	8c240000 	lw	a0,0(at)
>    8:	8c250004 	lw	a1,4(at)

Why are you doing it this way, rather than reversing the loads?
Seems a shame to use $at when we don't need to.

Richard


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