This is the mail archive of the gcc-help@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: Specific register constraints on MIPS


"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


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