Skip to content

Commit 9f652ea

Browse files
committed
cmake: gcc: Fix Cortex-R52 FPU type
The commit f10fa0d mapped the Cortex-R52 processor type to use the "VFPv3" FPU type, but the toolchain requires the "FPv5" FPU type and refuses to assemble floating-point instructions when the "VFPv3" FPU type is specified. 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. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 87217ef commit 9f652ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmake/gcc-m-fpu.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(CONFIG_FPU)
77

88
if("${ARCH}" STREQUAL "arm")
99
if(CONFIG_CPU_AARCH32_CORTEX_R)
10-
if(CONFIG_CPU_CORTEX_R4 OR CONFIG_CPU_CORTEX_R5 OR CONFIG_CPU_CORTEX_R52) # VFPv3
10+
if(CONFIG_CPU_CORTEX_R4 OR CONFIG_CPU_CORTEX_R5) # VFPv3
1111
if(CONFIG_VFP_FEATURE_DOUBLE_PRECISION)
1212
set(GCC_M_FPU vfpv3-d16)
1313
elseif(CONFIG_VFP_FEATURE_SINGLE_PRECISION)
@@ -16,6 +16,12 @@ if("${ARCH}" STREQUAL "arm")
1616
if(CONFIG_VFP_FEATURE_HALF_PRECISION)
1717
set(GCC_M_FPU ${GCC_M_FPU}-fp16)
1818
endif()
19+
elseif(CONFIG_CPU_CORTEX_R52)
20+
if(CONFIG_VFP_FEATURE_DOUBLE_PRECISION)
21+
set(GCC_M_FPU neon-fp-armv8)
22+
elseif(CONFIG_VFP_FEATURE_SINGLE_PRECISION)
23+
set(GCC_M_FPU fpv5-sp-d16)
24+
endif()
1925
endif()
2026
elseif(CONFIG_CPU_CORTEX_M)
2127
# Defines a mapping from GCC_M_CPU to FPU

0 commit comments

Comments
 (0)