Hello, we are using the imx8m plus to do ultrasound signal processing. At first we tried openCL, but results are too slow for our application so now we are trying it with neon. The problem is that the cross-compile gcc generated with yocto don't recognize -mfloat-abi neither -mfpu flags, and when we execute commands to detect neon on linux it doesn't show up (https://developer.arm.com/documentation/den0018/a/Compiling-NEON-Instructions/Detecting-presence-of-...).
I wrote some code using neon intrinsics and I can compile using the make file below, but I see in assembly code that it isn't using neon instructions like vadd, vmul etc.
What should I do to enable neon? Should I do something on yocto?
Makefile:
PROJ_NAME = frame_processing
# Diretório do sysroot e do Yocto SDK
ROOTFS_DIR = /opt/poky/4.0.6/sysroots/cortexa53-crypto-poky-linux
TARGET_PATH_LIB = $(ROOTFS_DIR)/usr/lib
TARGET_PATH_INCLUDE = $(ROOTFS_DIR)/usr/include
# Diretório da toolchain Yocto
TOOLCHAIN_DIR = /opt/poky/4.0.6/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux
# Fontes C e Headers
C_SOURCE = $(wildcard *.c)
H_SOURCE = $(wildcard *.h)
OBJ = $(C_SOURCE:.c=.o)
# Compilador correto do Yocto SDK
CC = $(TOOLCHAIN_DIR)/aarch64-poky-linux-gcc
# Flags de compilação e linkagem
CPU_CFLAGS = --sysroot=$(ROOTFS_DIR) -Wall -Wextra -std=c11 -O3 -Ofast -I$(TARGET_PATH_INCLUDE) -g -mcpu=cortex-a53 -march=armv8-a+simd -std=gnu11 -ftree-vectorize -fopt-info-vec-missed
CPU_LFLAGS = --sysroot=$(ROOTFS_DIR) -L$(TARGET_PATH_LIB) -lm
# Regra principal
all: $(PROJ_NAME)
# Regra para gerar o binário final
$(PROJ_NAME): $(OBJ)
$(CC) $(CPU_CFLAGS) $(CPU_LFLAGS) -o $@ $^
# Compilação dos arquivos .o
%.o: %.c
$(CC) $(CPU_CFLAGS) -c -o $@ $<
# Regra para gerar código assembly (.s) a partir de .c
%.s: %.c
$(CC) $(CPU_CFLAGS) -S -o $@ $< $(CPU_LFLAGS)
# Gera os arquivos .s (assembly) para todos os arquivos .c
assembly: $(C_SOURCE:.c=.s)
# Limpeza dos arquivos compilados
clean:
rm -f $(OBJ) $(PROJ_NAME) *.s