How to solve bad instruction `vadd.i16 q0,q0,q0' when attempting to check gcc for neon instruction

可紊 提交于 2019-11-29 16:54:03

I'm not really sure what it is you want to accomplish. Do you just want to see if gcc can compile neon instructions, or see if the CPU in question supports neon?

In any case:
I cannot get your code to work either. After googling around, it seems that gcc cannot really handle inline neon code very well. Apparantly the -mfpu=neon flag is somehow ignored (if you compile to .s with the -E flag, you will see that .fpu is set to softvfp even if -mfpu=neon was used)

Consider writing a .S or .s file instead. Something like this:

test.s

    .cpu cortex-a8
    .fpu neon
    .text
    .align  2
    .global f
    .type   f, %function
f:
    vadd.i16        q0, q0, q0
    .size   f, .-f

For what it's worth this instruction works fine for me with gcc 4.5.1 (CodeSourcery).

Try with these switches:

-mfpu=neon
-mfloat-abi=softfp
-mcpu=cortex-a8
-march=armv7-a
-mthumb
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!