This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Mirror i386 change on sparc: 'Avoid "anonymous" code in pthread_spin_lock'
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Chris Metcalf <cmetcalf at tilera dot com>
- Cc: David Miller <davem at davemloft dot net>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Thu, 3 May 2012 06:11:21 -0700
- Subject: Re: [PATCH] Mirror i386 change on sparc: 'Avoid "anonymous" code in pthread_spin_lock'
- References: <20120502.222330.1667012217526737937.davem@davemloft.net> <4FA1F195.40901@tilera.com>
On Wed, May 2, 2012 at 7:46 PM, Chris Metcalf <cmetcalf@tilera.com> wrote:
> Wouldn't you get the same result as the assembly code just by removing the
> .subsection and .previous directives? ?In that case the code would all be
> under the C function label, which is the point of the change.
FWIW, I tried that approach with i386,x86_64 code.
The result with .subsection removed was:
0: f0 ff 0f lock decl (%rdi)
3: 75 0b jne 10 <pthread_spin_lock+0x10>
10: f3 90 pause
12: 83 3f 00 cmpl $0x0,(%rdi)
15: 7f e9 jg 0 <pthread_spin_lock>
17: eb f7 jmp 10 <pthread_spin_lock+0x10>
19: 31 c0 xor %eax,%eax
1b: c3 retq
If I am reading this correctly, this will spin forever.
--
Paul Pluzhnikov