Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: android can't add the cortex a8 neon assermbly function? - ARM Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

android can't add the cortex a8 neon assermbly function? Rate Topic: ****- 1 Votes

#1 User is offline   EricMao 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 19-July 12

Posted 24 July 2012 - 09:15 AM

Hi all I want to do a yuv422torgb888 function, this function is a cortex A8 neon's assembly code. The context of the Android.mk is LOCAL_PATH:=$(call my-dir)include $(CLEAR_VARS)#Here we give our module name and sourcefile(s)
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 ?
0

#2 User is offline   webshaker 

  • Regular Contributor
  • PipPipPip
  • Group: Members
  • Posts: 220
  • Joined: 07-October 10

Posted 24 July 2012 - 10:02 AM

View PostEricMao, on 24 July 2012 - 09:15 AM, said:

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 ?


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 !
When you have eliminated the impossible, whatever remains, however improbable, must be the truth
1

#3 User is offline   EricMao 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 19-July 12

Posted 24 July 2012 - 01:03 PM

Hi webshaker
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/"
1

#4 User is offline   webshaker 

  • Regular Contributor
  • PipPipPip
  • Group: Members
  • Posts: 220
  • Joined: 07-October 10

Posted 24 July 2012 - 01:47 PM

View PostEricMao, on 24 July 2012 - 01:03 PM, said:

Hi webshaker
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 !



When you have eliminated the impossible, whatever remains, however improbable, must be the truth
1

#5 User is offline   EricMao 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 19-July 12

Posted 25 July 2012 - 01:26 AM

The two problems are all solved now ,thank you very much!


1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic