Is there any instruction and compile/linker flag required to link CCS4 generated library with NEON instruction (CortexA9) to Android build and create an libXXX.so file ?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is there any instruction and compile/linker flag required to link CCS4 generated library with NEON instruction (CortexA9) to Android build and create an libXXX.so file ?
I break your question into two parts: How do you tell the compiler to use the NEON extensions? And, how do you create a dynamic library? Is that a fair interpretation? For now, I presume so.
Enable use of NEON extensions with the build switch --neon. The TI ARM compiler does not support dynamic linking. For that, you probably have to use the gcc ARM compiler.
Thanks and regards,
-George
Hi George,
1. For generating component lib (static) with NEON features, can CCS4 compile the C code and generate the NEON asm instruction/lib directly ? Based on our understanding, a hand-level asm code is required to utilize the NEON? Is there a way that we can write a structured C so the compiler can directly compile and utilize NEON instruction? This will save us a lot of time and make NEON a more attractive solution for future algorithm/engine development.
2. Will the asm code (utilizing NEON inst) written for CCS4 tools be compiled/assembled/linked with GNU Android tool? And another angle of this is, can the static lib generated by CCS4 be used with other lib/code compiled with GNU Android tool chain? Are there any specific compile/link flags on CCS4 and GNU?
Best regards,
JR
Ukrit Visitkitjakarn said:For generating component lib (static) with NEON features, can CCS4 compile the C code and generate the NEON asm instruction/lib directly ?
Yes. Just use the --neon build option.
Ukrit Visitkitjakarn said:2. Will the asm code (utilizing NEON inst) written for CCS4 tools be compiled/assembled/linked with GNU Android tool? And another angle of this is, can the static lib generated by CCS4 be used with other lib/code compiled with GNU Android tool chain? Are there any specific compile/link flags on CCS4 and GNU?
TI does not claim that the TI ARM compiler is compatible with the GNU ARM compiler. The TI ARM compiler can produce EABI object code with the build switch --abi=eabi. I'm pretty sure the GNU ARM compiler also supports EABI, maybe even by default. But TI never tests that combination. It is very likely that, despite both being EABI, there are other issues which prevent the TI and GNU compilers from working together.
Thanks and regards,
-George
What are the issue that you foresee? Any known issue or reported issue? Any related thread that I could check ?
I'm being vague about it precisely because I don't know.
It is likely the GNU ARM compiler and the Android OS work closely together to manage symbols and relocations in a manner that is very similar to, if not the same as, the Linux dynamic linking model. The TI ARM compiler supports none of those features.
Thanks and regards,
-George
Hi George,
I am colleague of Ukrit Visitkitjakarn. According to my investigation, TI TMS470 C compiler flag '--neon' is only able to generate fixed-point NEON instructions, it can not generate floating-point NEON instructions. It have to use ''--neon --float_support=vfpv3' compiler flag combination for generating floating-point operation instructions. But the problem is when additional compiler flag '--float_support=vfpv3' added, TI TMS470 C compiler generated mainly VFP instructions and only a few NEON instructions was generated, is there any method to make TI TMS470 C compiler generate mainly floating-point NEON instructions automatically?
Long Yan
Hi George,
I see a reply email per the following but I can't access the link, could you please check ?
codya replied to Re: Linking CCS4 generated CortexA9 library with NEON instruction to Android build in TI C/C++ Compiler - Forum. Long Yan, My post on this thread answers this question. https://e2e.ti.com/support/development_tools/compiler/int-compiler/f/85/p/117858/418896.aspx#418896 Also, for the compiler to perform NEON vectorization you should make sure you are using -o2 or above and -mf3 or above in addition to --neon.
The thread to which Cody refers was on an TI employee only forum. I removed the parts meant only for TI employees and moved it to the external forum. It can now be found here.
Thanks and regards,
-George