Cortex-M0/M0+ Cortex-M4 FPU Cortex-M7 FPU + DP Cortex-A Full DP

numx for ARM Cortex-M: Bare-Metal Numerical Computing

ARM Cortex-M processors ship with hardware floating-point. Most numerical libraries expect a runtime to go with it. numx does not.

Coverage across Cortex-M tiers

Cortex-M0 / M0+

-mcpu=cortex-m0plus -mfloat-abi=soft

Software float. Full numx API available.

Cortex-M4 (FPU)

-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard

Hardware float32. Recommended.

Cortex-M7 (FPU)

-mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard

Hardware double. Use with -DNUMX_USE_DOUBLE=1.

Cortex-A7 / A53

-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard

Full double precision. Linux targets supported.

Building with arm-none-eabi-gcc

Toolchain file

cmake
# cmake/arm-cortex-m4.cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_C_FLAGS_INIT "-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-specs=nosys.specs -specs=nano.specs")

Build commands

bash
cmake -B build \
  -DCMAKE_TOOLCHAIN_FILE=cmake/arm-cortex-m4.cmake \
  -DCMAKE_BUILD_TYPE=MinSizeRel \
  -DNUMX_BUILD_TESTS=OFF
cmake --build build --parallel

A note on CMSIS-DSP

CMSIS-DSP is an excellent library for hardware-accelerated DSP on Cortex-M. If you need Helium SIMD or Neon intrinsics for compute-heavy FFT or FIR workloads on Cortex-M55/M85, CMSIS-DSP is the right tool.

numx covers the algorithms CMSIS-DSP does not: ODE solvers, automatic differentiation, compressed sensing, statistical computing, polynomial arithmetic, and root-finding. It also works identically on non-ARM targets, so your code compiles on x86-64 for CI and on RISC-V without modification. The two libraries can coexist in the same project.

Full comparison →