RE: [arm-gnu] Assembler error for Inline Assembly (cortex-A8 processor)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [arm-gnu] Assembler error for Inline Assembly (cortex-A8 processor)
- To: "Carlos O'Donell" <carlos@xxxxxxxxxxxxxxxx>, "akshay.joshi@xxxxxxxxxxx" <akshay.joshi@xxxxxxxxxxx>
- Subject: RE: [arm-gnu] Assembler error for Inline Assembly (cortex-A8 processor)
- From: "Shilimkar, Santosh" <santosh.shilimkar@xxxxxx>
- Date: Tue, 25 Nov 2008 10:39:07 +0530
> -----Original Message-----
> From: Carlos O'Donell [mailto:carlos@xxxxxxxxxxxxxxxx]
> Sent: Monday, November 24, 2008 8:08 PM
> To: akshay.joshi@xxxxxxxxxxx
> Cc: Shilimkar, Santosh; arm-gnu@xxxxxxxxxxxxxxxx
> Subject: Re: [arm-gnu] Assembler error for Inline Assembly
> (cortex-A8 processor)
>
> Joshi Akshay wrote:
> > void func( )
> >
> > {
> >
> > __asm__ __volatile__(
> >
> > " vadd.s32 d0, d0\n"
> >
> > " vld1.32 d0[], [r7]!\n"
> >
> > " vadd.s32 d0, d0\n"
> > " vzip.s32 d8, d8\n");
> >
> > }
>
> You must specify the correct asm contraints.
>
> This asm statement writes to d0, d8, and reads from r7, but does not
> specify any input or output operands. This function will not operate
> correctly if it is inlined into other code.
>
> Please see the GCC manual for an example of how to use asm contraints
> i.e. input, output and clobber operands in assembly.
>
> http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Extended-Asm.html#
> Extended-Asm
> http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Constraints.html#i
> ndex-g_t_0040code_007basm_007d-constraints-2247
>
> An alternative may be to declare the function naked.
>
This example was given just for the syntactical errors. This is dummy one I wrote to highlight the syntax. Infact a void function and not returning anythings doesn't make sense anyways.