ETSI intrinsic for Android NDK (basic operations)

Started by GoodMan November 8, 2012
I am looking for ETSI intrinsic for Android NDK (basic operations).

ARM has such in the form of dspfns.h file, but its code is not suitable for NDK
(uses __asm{} rather than asm() etc.).  The ARM __asm{} can specify a variable name,
while the asm() can specify a register.  How can I specify C variable into asm() ?

Is there anything like _NASSERT  for NDK?

Thanks,
AM
On 9 Nov., 02:36, GoodMan <o...@compandent.com> wrote:
> I am looking for ETSI intrinsic for Android NDK (basic operations). > > ARM has such in the form of dspfns.h file, but its code is not suitable for NDK
(uses __asm{} rather than asm() etc.). &#2013266080;The ARM __asm{} can specify a variable name, while the asm() can specify a register. &#2013266080;How can I specify C variable into asm() ?
> > Is there anything like _NASSERT &#2013266080;for NDK? > > Thanks, > AM
NDK is basically arm-eabi-gcc so you should probably look at the gcc documentation -Lasse
On Thursday, November 8, 2012 5:36:23 PM UTC-8, GoodMan wrote:
> I am looking for ETSI intrinsic for Android NDK (basic operations). > > > > ARM has such in the form of dspfns.h file, but its code is not suitable for NDK
(uses __asm{} rather than asm() etc.). The ARM __asm{} can specify a variable name, while the asm() can specify a register. How can I specify C variable into asm() ?
> > > > Is there anything like _NASSERT for NDK? > > > > Thanks, > > AM
I never found a way to put C variables inside inline assembler (in C files) for Android NDK which is basically arm-eabi-gcc. I would greatly appreciate if someone could help on that! Thanks, AM
On Friday, November 9, 2012 12:37:47 PM UTC-8, lang...@fonz.dk wrote:
> On 9 Nov., 02:36, GoodMan <o...@compandent.com> wrote: > > > I am looking for ETSI intrinsic for Android NDK (basic operations). > > > > > > ARM has such in the form of dspfns.h file, but its code is not suitable for NDK
(uses __asm{} rather than asm() etc.). &#2013266080;The ARM __asm{} can specify a variable name, while the asm() can specify a register. &#2013266080;How can I specify C variable into asm() ?
> > > > > > Is there anything like _NASSERT &#2013266080;for NDK? > > > > > > Thanks, > > > AM > > > > NDK is basically arm-eabi-gcc so you should probably look at the gcc > > documentation > > > > -Lasse
I never found a way to put C variables inside inline assembler (in C files) for Android NDK which is basically arm-eabi-gcc. I would greatly appreciate if someone could help on that! Thanks, AM
On 13.11.12 3:41 , GoodMan wrote:
> On Friday, November 9, 2012 12:37:47 PM UTC-8, lang...@fonz.dk wrote: >> On 9 Nov., 02:36, GoodMan <o...@compandent.com> wrote: >> >>> I am looking for ETSI intrinsic for Android NDK (basic operations). >> >>> >> >>> ARM has such in the form of dspfns.h file, but its code is not suitable for NDK
(uses __asm{} rather than asm() etc.). The ARM __asm{} can specify a variable name, while the asm() can specify a register. How can I specify C variable into asm() ?
>> >>> >> >>> Is there anything like _NASSERT for NDK? >> >>> >> >>> Thanks, >> >>> AM >> >> >> >> NDK is basically arm-eabi-gcc so you should probably look at the gcc >> >> documentation >> >> >> >> -Lasse > > > I never found a way to put C variables inside inline assembler (in C files) for
Android NDK which is basically arm-eabi-gcc. I would greatly appreciate if someone could help on that!
> > Thanks, > AM
There is a method in GCC to access C variables from __asm__() code. Get the GCC manual from <http://gcc.gnu.org/onlinedocs/>. In my copy (version 4.7.1) it is in: 6.41 Assembler Instructions with C Expression Operands An example for arm-eabi-gcc in Cortex-M3 mode: Source: #include <inttypes.h> /* Change processing priority, return old priority */ uint32_t change_pri(uint32_t newpri) { uint32_t oldpri; __asm__ ( "mrs %[r], basepri\n\t" /* get old priority */ "msr basepri, %[n]" /* update priority */ : [r] "=&r" (oldpri) : [n] "r" (newpri) ); return oldpri; } Compiler listing (part of larger module): 410 change_pri: 411 @ args = 0, pretend = 0, frame = 0 412 @ frame_needed = 0, uses_anonymous_args = 0 413 @ link register save eliminated. 414 @ 55 "kernel.c" 1 415 0000 EFF31183 mrs r3, basepri 416 0004 80F31188 msr basepri, r0 417 @ 0 "" 2 418 .thumb 419 0008 1846 mov r0, r3 420 000a 7047 bx lr -- Tauno Voipio