Skip to content

Commit

Permalink
armv8-r/r52: add neon support into compiler line
Browse files Browse the repository at this point in the history
1. correct the armv8-r fpu flag from vfpv3-d16 to fpv5-sp-d16
2. add neon support

This commit updates the build script to specify the FPU type of
`fpv5-sp-d16` when the processor is configured with a single-precision
FPU, and `neon-fp-armv8` when the processor is configured with a
double-precision + Advanced SIMD-capable FPU.

Note that the `fp-armv8` FPU type is an alias for double-precision FPv5
with 32 double-precision registers (refer to the GCC
`gcc/config/arm/arm-cpus.in` for more details); NEON is always
specified in case of a double-precision configuration because the
Cortex-R52 can only be configured as such.

Reference:
https://developer.arm.com/Processors/Cortex-R52

Instruction set:

Arm and Thumb-2. Supports DSP instructions and a configurable Floating-Point
Unit either with single-precision or double precision and Neon.

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Sep 4, 2024
1 parent 9e5d3da commit 9a6cf24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion arch/arm/src/armv8-r/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ ARCHCPUFLAGS += -march=armv8-r

ifeq ($(CONFIG_ARCH_FPU),y)
LLVM_ABITYPE := eabihf
ARCHCPUFLAGS += -mfpu=vfpv3-d16

ifeq ($(CONFIG_ARCH_CORTEXR52)$(CONFIG_ARM_NEON),yy)
ARCHCPUFLAGS += -mfpu=neon-fp-armv8
else
ARCHCPUFLAGS += -mfpu=fpv5-sp-d16
endif
ifeq ($(CONFIG_ARM_FPU_ABI_SOFT),y)
ARCHCPUFLAGS += -mfloat-abi=softfp
else
ARCHCPUFLAGS += -mfloat-abi=hard
endif

else
LLVM_ABITYPE := eabi
ARCHCPUFLAGS += -mfloat-abi=soft
Expand Down
7 changes: 6 additions & 1 deletion arch/arm/src/cmake/armv8-r.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ if(CONFIG_ARCH_CORTEXR52)
endif()

if(CONFIG_ARCH_FPU)
list(APPEND PLATFORM_FLAGS -mfpu=vfpv3-d16)

if(CONFIG_ARCH_CORTEXR52 AND CONFIG_ARM_NEON)
list(APPEND PLATFORM_FLAGS -mfpu=neon-fp-armv8)
else()
list(APPEND PLATFORM_FLAGS -mfpu=fpv5-sp-d16)
endif()
if(CONFIG_ARM_FPU_ABI_SOFT)
list(APPEND PLATFORM_FLAGS -mfloat-abi=softfp)
else()
Expand Down

0 comments on commit 9a6cf24

Please sign in to comment.