This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc inline assembly for sparc
- From: Ian Lance Taylor <iant at google dot com>
- To: dave77 <zhu_dave at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 11 Jan 2007 18:03:02 -0800
- Subject: Re: gcc inline assembly for sparc
- References: <8286324.post@talk.nabble.com>
dave77 <zhu_dave@yahoo.com> writes:
> I have the following inline assembly code (for a sparc machine), but get
> compilation errors (such as /usr/ccs/bin/as: "/var/tmp//ccJC2PUL.s", line
> 415: error: statement syntax). Could you please tell me what is wrong with
> my code as the error message is not very helpful? Thanks.
>
> __asm__ __volatile__ ( \
> "movl %0, %%g1;" \
> "movl %0, %%g2;" \
> "movl %0, %%g3;" \
> : /* no outputs */ \
> : "g" (var1), "g" (var2), "g" (var3) \
> : "g1", "g2", "g3" \
> );
Use the --save-temps option to tell gcc to save the assembler output.
Examine that line of the assembler output.
It's been quite a while since I've done any SPARC programming, but are
you sure you mean "movl"? Shouldn't it just be "mov"?
Ian