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: akshay.joshi@xxxxxxxxxxx
- Subject: Re: [arm-gnu] Assembler error for Inline Assembly (cortex-A8 processor)
- From: Carlos O'Donell <carlos@xxxxxxxxxxxxxxxx>
- Date: Mon, 24 Nov 2008 09:38:08 -0500
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#index-g_t_0040code_007basm_007d-constraints-2247
An alternative may be to declare the function naked.
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@xxxxxxxxxxxxxxxx
(650) 331-3385 x716