This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/3] PowerPC: Add the low level infrastructure for pthreads
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 7 Nov 2014 21:05:34 -0600
- Subject: Re: [PATCH 1/3] PowerPC: Add the low level infrastructure for pthreads
- Authentication-results: sourceware.org; auth=none
- References: <545CFD9F dot 5040004 at linux dot vnet dot ibm dot com> <545D080D dot 3090006 at linux dot vnet dot ibm dot com> <545D1DDE dot 2060908 at linux dot vnet dot ibm dot com>
On Fri, Nov 07, 2014 at 05:30:38PM -0200, Adhemerval Zanella wrote:
> +static __force_inline
> +unsigned int _tbegin (void)
> +{
> + unsigned int ret;
> + asm volatile (
> + TBEGIN "\t\n"
> + "mfcr %0,128\t\n"
> + "rlwinm %0,%0,3,1\t\n"
> + "subfic %0,%0,1\t\n"
> + : "=r" (ret) :: "cr0", "memory");
> + return ret;
> +}
This needs a "xer" clobber because you use subfic (which sets XER[CA]).
Better is to not use subfic, but instead e.g. "xori %0,%0,1".
Segher