一、要编译下面的test.c代码,包含arm 汇编语言。
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
void test_NEON32(uint8_t *dst, uint16_t *src, int a, int b)
{
asm volatile (
".p2align 4 \n"
"1: \n"
"vld1.16 {q1, q2}, [%1]! \n"
"vrshrn.i16 d0, q1, #2 \n"
"vrshrn.u16 d1, q2, #2 \n"
"subs %0, %0, #16 \n"
"bgt 1b \n"
"+r"(src),
"+r"(dst)
:
: "cc", "memory", "q0", "q1", "q2");
}
int main()
{
return 0 ;
}
二、提示下面的ERRO
三、解决方法;增加-mfpu=neon-vfpv4。在Makefile里面可以增加CFLAGS=-c -mfpu=neon-vfpv4 -Wall。
四、在 GCC(GNU Compiler Collection)中,-mfpu
选项用于指定要使用的浮点单元(FPU)类型使用arm-xxxxxx-gcc -Q --help=target 命令查看-mfpu
,发现编译器的默认值不是neon,故先前是编译不过的。