From: Joshua Kinard <kumba@gentoo.org>
To: linux-mips@linux-mips.org
Subject: Re: gcc-4.8+ and R10000+
Date: Mon, 08 Sep 2014 05:44:27 -0400 [thread overview]
Message-ID: <540D7A7B.9090905@gentoo.org> (raw)
In-Reply-To: <loom.20140908T100138-568@post.gmane.org>
On 09/08/2014 04:11, Miod Vallat wrote:
>> Disassembling a statically-built copy of the "sln" binary generated by
>> glibc's compile phase, there are slight differences in how gcc-4.7 and
>> gcc-4.8 are compiling the __lll_lock_wait_private function. The key
>> differences in the output asm are
>> this:
>
> [...]
>
>> gcc-4.8:
>> x+4 <START>
>> ...
>> x+24 bne v1,v0,<x+56>
>> ...
>> x+32 0x7c03e83b /* rdhwr */
>> x+36 li a2,2
>> x+40 lw a1,-29832(v1)
>> x+44 move a3,zero
>> x+48 li v0,4238
>> x+52 syscall
>> * x+56 ll v0,0(s0)
>> * x+60 li at,2
>> * x+64 sc at,0
>
> Note how the sc address is no longer 0(s0). Since the address does
> not match the address used in the ll instruction, sc will always
> fail on the R10k.
That would be a typo on my part. I typed that out by hand and just missed it. It should read:
gcc-4.8:
x+4 <START>
...
x+24 bne v1,v0,<x+56>
...
x+32 0x7c03e83b /* rdhwr */
x+36 li a2,2
x+40 lw a1,-29832(v1)
x+44 move a3,zero
x+48 li v0,4238
x+52 syscall
* x+56 ll v0,0(s0)
* x+60 li at,2
* x+64 sc at,0(s0)
x+68 beqzl at,<x+56>
x+72 nop
x+76 sync
x+80 bnez v0,<x+32>
Thanks!,
--
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
4096R/D25D95E3 2011-03-28
"The past tempts us, the present confuses us, the future frightens us. And our lives slip away, moment by moment, lost in that vast, terrible in-between."
--Emperor Turhan, Centauri Republic
next prev parent reply other threads:[~2014-09-08 9:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-07 8:25 gcc-4.8+ and R10000+ Joshua Kinard
2014-09-08 8:11 ` Miod Vallat
2014-09-08 9:44 ` Joshua Kinard [this message]
2014-09-22 9:31 ` Joshua Kinard
2014-09-22 9:31 ` Joshua Kinard
2014-09-28 19:34 ` Maciej W. Rozycki
2014-09-29 5:18 ` Joshua Kinard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=540D7A7B.9090905@gentoo.org \
--to=kumba@gentoo.org \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox