[PATCH 1/3] PowerPC: Add the low level infrastructure for pthreads
Segher Boessenkool
segher@kernel.crashing.org
Sat Nov 8 03:05:00 GMT 2014
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
More information about the Libc-alpha
mailing list