This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: MIPS futex patch for OpenMP
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Fu\, Chao-Ying" <fu at mips dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, "Garbacea\, Ilie" <ilie at mips dot com>, "Lau\, David" <davidlau at mips dot com>
- Date: Sun, 20 Jul 2008 18:34:09 +0100
- Subject: Re: MIPS futex patch for OpenMP
- References: <94BD67F8AF3ED34FA362C662BA1F12C501007E07@MTVEXCHANGE.mips.com>
"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