This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: Fix ll/sc for mips (take 3)
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: "H . J . Lu" <hjl at lucon dot org>
- Cc: Dominic Sweetman <dom at algor dot co dot uk>, GNU C Library <libc-alpha at sources dot redhat dot com>, linux-mips at oss dot sgi dot com, binutils at sources dot redhat dot com
- Date: Wed, 6 Feb 2002 12:37:31 +0100 (MET)
- Subject: Re: PATCH: Fix ll/sc for mips (take 3)
- Organization: Technical University of Gdansk
On Tue, 5 Feb 2002, H . J . Lu wrote:
> 0xd724 <__pthread_alt_lock+212>: ll v1,0(s1)
> 0xd728 <__pthread_alt_lock+216>: move a1,zero
> 0xd72c <__pthread_alt_lock+220>: bne v1,s0,0xd744 <__pthread_alt_lock+244>
> 0xd730 <__pthread_alt_lock+224>: nop
> 0xd734 <__pthread_alt_lock+228>: move a1,v0
> 0xd738 <__pthread_alt_lock+232>: sc a1,0(s1)
> 0xd73c <__pthread_alt_lock+236>: beqz a1,0xd724 <__pthread_alt_lock+212>
> 0xd740 <__pthread_alt_lock+240>: nop
>
> There is an extra "nop" in the delay slot. I don't think gas is smart
> enough to fill the delay slot. I will put back those ".set noredor".
The code uses the same count of cycles either way. As you may see above,
gas was smart enough to fill the "ll" load delay slot. Maybe it should
prefer filling the branch delay slot instead due to smaller code...
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +