This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Specific register constraints on MIPS
- From: Ian Lance Taylor <iant at google dot com>
- To: "Aaron W. LaFramboise" <aaronavay62 at aaronwl dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 05 Feb 2007 12:19:08 -0800
- Subject: Re: Specific register constraints on MIPS
- References: <45C52481.4020201@aaronwl.com>
"Aaron W. LaFramboise" <aaronavay62@aaronwl.com> writes:
> On the MIPS GCC target, is there a way to write an inline assembler
> constraint for a specific register?
No.
> Here's an example of how I've been working around the issue using
> variables in specified registers. This is slightly inferior, and
> possibly incorrect.
>
> void print(const char *string) {
> const register int num asm("v0") = 4;
> const register char *const str asm("a0") = string;
> asm volatile("syscall" : : "r"(num), "r"(str));
> }
>
> Is there a way to write this without the extra variables?
That is the only way I know to do this.
Ian