Quick Links
android can't add the cortex a8 neon assermbly function?
#1
Posted 24 July 2012 - 09:15 AM
LOCAL_MODULE := libv2d
LOCAL_SRC_FILES := global.cpp \
haarDetector.cpp \
haarTab.cpp \
initPara.cpp \
main.cpp \
resize.cpp \
track_haar.cpp \
track_rgb.cpp \
yuv422torgb888.s
APP_ABI := armeabi armeabi-v7a
LOCAL_ARM_MODE := arm
TARGET_ARCH_VARIANT=armv7-a-neon
LOCAL_CFLAGS := -O3 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize
#include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY) After type the command ndk-build, the console get the error message:"Compile++ arm : v2d <= global.cpp
"Compile++ arm : v2d <= haarDetector.cpp
"Compile++ arm : v2d <= haarTab.cpp
"Compile++ arm : v2d <= initPara.cpp
"Compile++ arm : v2d <= main.cpp
"Compile++ arm : v2d <= resize.cpp
"Compile++ arm : v2d <= track_haar.cpp
"Compile++ arm : v2d <= track_rgb.cpp
"Compile arm : v2d <= yuv422torgb888.s
SharedLibrary : libv2d.so
E:/DSP/2d_lib//obj/local/armeabi/objs/v2d/main.o: In function `GetOneFrame(unsigned char*, unsigned char*)':
E:/DSP/2d_lib//jni/main.cpp:239: undefined reference to `yuv422torgb888(unsigned char*, unsigned char*, void*, int)'
collect2: ld returned 1 exit status
make: *** [E:/DSP/2d_lib//obj/local/armeabi/libv2d.so] Error 1 How to fix this problem ?
#2
Posted 24 July 2012 - 10:02 AM
EricMao, on 24 July 2012 - 09:15 AM, said:
E:/DSP/2d_lib//jni/main.cpp:239: undefined reference to `yuv422torgb888(unsigned char*, unsigned char*, void*, int)'
collect2: ld returned 1 exit status
make: *** [E:/DSP/2d_lib//obj/local/armeabi/libv2d.so] Error 1 How to fix this problem ?
The problem is not due to NEON but to the assembly function declaration !
I've written a simple assembly ADD example for Android
If you speak french
http://pulsar.websha.../07/13/android/
else you can translate with google
The interesting part for you is
.global Java_com_example_helloandroid_HelloAndroid_sommeAsm .type Java_com_example_helloandroid_HelloAndroid_sommeAsm, %function Java_com_example_helloandroid_HelloAndroid_sommeAsm: vadd.s16 d0, d0, d0 add r0, r2, r3 mov pc, lr .size Java_com_example_helloandroid_HelloAndroid_sommeAsm, .-Java_com_example_helloandroid_HelloAndroid_sommeAsm
Give you assembly function here if you want some more explanation !
#3
Posted 24 July 2012 - 01:03 PM
Thank you for reply.
I speek chinese, and can read in english. I transfer the web from french into english and will try it.
Now I have another quesion, list in the post "http://forums.arm.com/index.php?/topic/16090-the-same-instructionrealview-compile-correct-but-arm-gcc-compile-get-error/"
#4
Posted 24 July 2012 - 01:47 PM
EricMao, on 24 July 2012 - 01:03 PM, said:
Thank you for reply.
I speek chinese, and can read in english. I transfer the web from french into english and will try it.
Now I have another quesion, list in the post "http://forums.arm.com/index.php?/topic/16090-the-same-instructionrealview-compile-correct-but-arm-gcc-compile-get-error/"
isogen74 replied you !!!
you must not specify the type for each register but for the instruction
if the instruction VSUBL Q3.S16, D0.U8, D2.U8 is "compiled" with realview and not with gcc it's just because the assembler syntax are not the same !
to my opinion, that's a better idea to use gcc syntax !
















