This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS futex patch for OpenMP


"Fu, Chao-Ying" <fu@mips.com> writes:
> +static inline void
> +sys_futex0 (int *addr, int op, int val)
> +{
> +  register unsigned long __v0 asm("$2") = (unsigned long) SYS_futex;
> +  register unsigned long __a0 asm("$4") = (unsigned long) addr;
> +  register unsigned long __a1 asm("$5") = (unsigned long) op;
> +  register unsigned long __a2 asm("$6") = (unsigned long) val;
> +  register unsigned long __a3 asm("$7") = 0;
> +
> +  __asm volatile ("syscall"
> +		  /* returns $a3 (errno), $v0 (return value) */
> +		  : "+r" (__v0), "+r" (__a3)
> +		  /* arguments in v0 (syscall) a0-a3 */
> +		  : "r" (__v0), "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a3)
> +		  /* clobbers t0-t8 */
> +		  : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
> +		    "$24", "memory");
> +}

Sorry, just looked at this again.  I don't think it's correct to
have separate "+r" and "r" operands for the same register.
Just make the output operands "=r" instead.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]