ffmpeg neon 在 android 上编译 - 汇编错误

Posted

技术标签:

【中文标题】ffmpeg neon 在 android 上编译 - 汇编错误【英文标题】:ffmpeg neon compilation on android - assembler errors 【发布时间】:2011-03-04 17:33:49 【问题描述】:

我正在尝试为支持 neon 的 android 编译 ffmpeg,但出现以下汇编错误。如果有人对此有任何线索,请告诉我?

/home/user1/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -MMD -MP -MF /home/user1/workspace/FFMPEGFinal/obj/local/armeabi-v7a/objs/ffmpeg/libavcodec/arm/rdft_neon.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -I/home/user1/workspace/FFMPEGFinal/jni/SDL/include -I/home/user1/workspace/FFMPEGFinal/jni -DANDROID -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -DCMP_HAVE_NEON -DCMP_HAVE_VFP -fasm -Wa,--noexecstack -O2 -DNDEBUG -g -I/home/user1/android-ndk-r5b/platforms/android-8/arch-arm/usr/include -c  /home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S -o /home/user1/workspace/FFMPEGFinal/obj/local/armeabi-v7a/objs/ffmpeg/libavcodec/arm/rdft_neon.o && rm -f /home/user1/workspace/FFMPEGFinal/obj/local/armeabi-v7a/objs/ffmpeg/libavcodec/arm/rdft_neon.o.d && mv /home/user1/workspace/FFMPEGFinal/obj/local/armeabi-v7a/objs/ffmpeg/libavcodec/arm/rdft_neon.o.d.org /home/user1/workspace/FFMPEGFinal/obj/local/armeabi-v7a/objs/ffmpeg/libavcodec/arm/rdft_neon.o.d
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S: Assembler messages:
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:54: Error: bad instruction `vld1.32 d0,[r0,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:55: Error: bad instruction `vld1.32 d1,[r1,:64],r8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:56: Error: bad instruction `vld1.32 d4,[r2,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:57: Error: bad instruction `vld1.32 d5,[r3,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:58: Error: bad instruction `vmov.f32 d18,#0.5'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:59: Error: bad instruction `vdup.32 d19,r6'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:61: Error: selected processor does not support `veor d19,d18,d19'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:62: Error: bad instruction `vmov.i32 d16,#0'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:63: Error: bad instruction `vmov.i32 d17,#1<<31'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:65: Error: bad instruction `vtrn.32 d16,d17'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:67: Error: bad instruction `vrev64.32 d16,d16'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:70: Error: selected processor does not support `veor q1,q0,q8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:71: Error: bad instruction `vld1.32 d24,[r0,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:72: Error: bad instruction `vadd.f32 d0,d0,d3'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:73: Error: bad instruction `vld1.32 d25,[r1,:64],r8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:74: Error: bad instruction `vadd.f32 d1,d2,d1'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:75: Error: selected processor does not support `veor q3,q12,q8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:77: Error: bad instruction `vmul.f32 q10,q0,q9'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:79: Error: bad instruction `vadd.f32 d0,d24,d7'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:80: Error: bad instruction `vadd.f32 d1,d6,d25'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:81: Error: bad instruction `vmul.f32 q11,q0,q9'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:82: Error: selected processor does not support `veor d7,d21,d16'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:83: Error: bad instruction `vrev64.32 d3,d21'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:84: Error: selected processor does not support `veor d6,d20,d17'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:85: Error: selected processor does not support `veor d2,d3,d16'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:86: Error: bad instruction `vmla.f32 d20,d3,d4[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:87: Error: bad instruction `vmla.f32 d20,d7,d5[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:88: Error: bad instruction `vmla.f32 d6,d2,d4[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:89: Error: bad instruction `vmla.f32 d6,d21,d5[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:90: Error: bad instruction `vld1.32 d4,[r2,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:91: Error: selected processor does not support `veor d7,d23,d16'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:92: Error: bad instruction `vld1.32 d5,[r3,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:93: Error: selected processor does not support `veor d24,d22,d17'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:94: Error: bad instruction `vrev64.32 d3,d23'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:96: Error: selected processor does not support `veor d2,d3,d16'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:98: Error: bad instruction `vmla.f32 d22,d3,d4[0]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:99: Error: bad instruction `vmla.f32 d22,d7,d5[0]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:100: Error: bad instruction `vmla.f32 d24,d2,d4[0]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:101: Error: bad instruction `vmla.f32 d24,d23,d5[0]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:102: Error: bad instruction `vld1.32 d0,[r0,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:103: Error: bad instruction `vld1.32 d1,[r1,:64],r8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:104: Error: bad instruction `vst1.32 d20,[r7,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:105: Error: bad instruction `vst1.32 d6,[lr,:64],r8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:106: Error: bad instruction `vst1.32 d22,[r7,:64]!'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:107: Error: bad instruction `vst1.32 d24,[lr,:64],r8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:111: Error: selected processor does not support `veor q1,q0,q8'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:112: Error: bad instruction `vadd.f32 d0,d0,d3'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:113: Error: bad instruction `vadd.f32 d1,d2,d1'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:115: Error: bad instruction `vmul.f32 q10,q0,q9'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:118: Error: bad instruction `vld1.32 d0[0],[r0,:32]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:119: Error: selected processor does not support `veor d7,d21,d16'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:120: Error: bad instruction `vrev64.32 d3,d21'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:121: Error: selected processor does not support `veor d6,d20,d17'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:122: Error: bad instruction `vld1.32 d22,[r5,:64]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:123: Error: bad instruction `vdup.32 d1,r2'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:124: Error: selected FPU does not support instruction -- `vmov d23,d22'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:125: Error: selected processor does not support `veor d2,d3,d16'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:126: Error: bad instruction `vtrn.32 d22,d23'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:127: Error: selected processor does not support `veor d0,d0,d1'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:128: Error: selected processor does not support `veor d23,d23,d17'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:129: Error: bad instruction `vmla.f32 d20,d3,d4[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:130: Error: bad instruction `vmla.f32 d20,d7,d5[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:131: Error: bad instruction `vmla.f32 d6,d2,d4[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:132: Error: bad instruction `vmla.f32 d6,d21,d5[1]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:133: Error: bad instruction `vadd.f32 d22,d22,d23'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:134: Error: bad instruction `vst1.32 d20,[r7,:64]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:135: Error: bad instruction `vst1.32 d6,[lr,:64]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:136: Error: bad instruction `vst1.32 d0[0],[r0,:32]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:137: Error: bad instruction `vst1.32 d22,[r5,:64]'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:142: Error: bad instruction `vmul.f32 d22,d22,d18'
/home/user1/workspace/FFMPEGFinal/jni/libavcodec/arm/rdft_neon.S:143: Error: bad instruction `vst1.32 d22,[r5,:64]'
make: *** [/home/user1/workspace/FFMPEGFinal/obj/local/armeabi-v7a/objs/ffmpeg/libavcodec/arm/rdft_neon.o] Error 1

【问题讨论】:

【参考方案1】:

好吧,汇编器显然无法识别那些 Neon 特有的助记符。

根据http://gcc.gnu.org/onlinedocs/gcc/ARM-NEON-Intrinsics.html你需要用-mfpu=neon编译。尝试将此行添加到您的 Android 生成文件中:

CFLAGS += -mfpu=neon

【讨论】:

【参考方案2】:

你在你的代码中使用了这样的东西-

`vld1.32 d1,[r1,:64],r8'

因此有一个类似的命令 -

"vld1.16   q1, [%4] ,%5                      \n\t"

应该可以工作。(其中 %4 指向一个数组,%5 保存一个整数值)。 但是我得到了这个错误。

Error: Neon quad precision register expected -- `vld1.16 q1,[ip],r4'

【讨论】:

以上是关于ffmpeg neon 在 android 上编译 - 汇编错误的主要内容,如果未能解决你的问题,请参考以下文章

无法在 xcode 8.3.2 上编译 NEON 代码

在 Mac OS 上编译 FFmpeg

如何在 Windows 上编译 64 位版本的 ffmpeg?

如何在windows上编译Tesseract OCR

如何在windows上编译Tesseract OCR

sh 如何在Amazon Linux(EC2)上编译ffmpeg