Skip to content
heliaDSP
User guide
HELIA HUB

Toolchains

Which compiler builds CMSIS-DSP decides both the speed and the correctness of its Helium kernels. Helium is Arm’s name for the M-profile Vector Extension (MVE) of the Cortex-M55 in Apollo510; CMSIS-DSP has handwritten Helium kernels, written with compiler intrinsics, for many of its functions, and portable C kernels for all of them. This page states heliaDSP’s compiler policy, the evidence for each entry, and what the build does when the policy is not followed.

Compiler Helium kernels Portable kernels (AUTOVECTORIZE=ON) and non-Helium targets Evidence for 2.0.0
ATfE 22.1.0 (Arm Toolchain for Embedded, LLVM-based) Production compiler: qualified and recommended Permitted Executed on the Corstone-300 simulator and the Apollo510 EVB
Arm GNU 15.2.Rel1 (GCC 15.2.1) Not qualified; the qualified CMSIS-DSP commit carries source workarounds for its complex-FFT miscompilation and its if-conversion internal compiler error Permitted through the if-conversion workaround; not qualified CI jobs build and link it for Cortex-M55 and Cortex-M4 without running it; executed on the simulator
Arm GNU 15.3.Rel1 (GCC 15.3.1) Permitted, not qualified; the GCC 15.2 if-conversion workaround does not apply Permitted On the simulator: the complex-FFT regression test and 64-point CFFT checks for f32, Q31, Q15 and f16 pass; gather order checked in the objects; compiles the sources GCC 15.2.1 stops on
Arm GNU 14.x (GCC 14) Permitted with DISABLEFLOAT16=ON (the default) Permitted Executed on the simulator and the Apollo510 EVB with 14.2.1
Arm Compiler 6.24 (Armclang) Not run Not run A CI job builds and links a Cortex-M55 test when an Arm licence is available; not run for this version

The decision record is helia-dsp issue #23 and the 2.0.0 entry of CHANGELOG.md; the executed evidence is in COMPATIBILITY.md.

ATfE is the production compiler for Helium builds, meaning the compiler heliaDSP qualifies Helium builds with and recommends for them, because it compiled Arm’s Helium kernels correctly where GCC 15.2 did not, and because, from identical source, its Helium kernels took fewer cycles than GCC 14.2.1’s on Apollo510: 1.4 times fewer for FIR, 1.7 for the biquad cascade, 1.2 for the real FFT and 1.1 for the matrix-vector product. Complex magnitude was the exception, at 2% more cycles (see Measurements).

Executed with ATfE 22.1.0 at the current qualified CMSIS-DSP commit:

  • On the Corstone-300 simulator, with the library built through heliaDSP’s CMake and f16 kernels included: the direct-form-I biquad through arm_biquad_cascade_df1_mve_init_f32, the Q15 and Q31 real-FFT parity test (36 cases, bit-exact), and 64-point arm_cfft_f32, arm_cfft_q31 and arm_cfft_q15 against a double-precision DFT, with no write outside the buffer.
  • On the Apollo510 EVB at 96 MHz: Q15 and Q31 real-FFT parity of every fixed-length initializer against the generic one, forward and inverse, lengths 32 to 8192: 54 checks, 0 failures; and the direct-form-I biquad through arm_biquad_cascade_df1_mve_init_f32, with the library built through heliaDSP’s CMake and f16 kernels included: passes, largest absolute error 5.6e-07.
  • In the upstream-tracking fork, the five memory-guarded regression tests (complex FFT, f32 and fixed-point matrix-vector tails, real-FFT table guards, FIR state bound) pass under ATfE on the simulator. The upstream-tracking fork’s patch ledger records the matrix-vector and real-FFT table tests at -O2 and -O3 in its Toolchain section, the FIR state-bound test at -O2 and -O3 in the row of pull request #9, and all five, without optimization levels, in the row of pull request #28.

Limits of this evidence: in every executed image the ATfE objects were linked by GNU ld with the GNU newlib C library, so ATfE’s own linker and C library were not part of an executed image (the CI job that links with ATfE uses its linker without a C library). On the simulator the device startup files were compiled by GCC. The board’s real-FFT run built the library from the upstream-tracking fork’s own CMake entry with DISABLEFLOAT16=ON, not through heliaDSP’s. Linking ATfE objects with the GNU toolchain prints variable-size enums ABI warnings, because GCC for arm-none-eabi uses short enums and clang uses 32-bit enums; no enumeration crosses the library interface in the tests above, and an application that passes one across that boundary must use one convention.

The toolchain file in Direct CMake shows the flags used: --target=arm-none-eabihf -mcpu=cortex-m55 -mthumb -mfloat-abi=hard.

Arm GNU Toolchain 15.2.Rel1 miscompiles the last stage of CMSIS-DSP’s Helium radix-4 complex FFT in arm_cfft_f32.c, arm_cfft_q31.c, arm_cfft_q15.c and arm_cfft_f16.c. Those kernels use a gather load with write-back, vldrwq_gather_base_wb_*(&addr, 64), which loads four words through a vector of addresses and then advances every address by 64 bytes; the next gather, vldrwq_gather_base_*(addr, 16), must use the advanced addresses. GCC 15.2.1 schedules the following gathers, and the first scatter store, from the addresses as they were before the write-back, so they read and write 64 bytes too low. A 12-line function reproduces it:

#include <arm_mve.h>
int32x4_t gather_wb_then_gather(const int32_t *p)
{
uint32x4_t base = vidupq_n_u32(0, 8); /* {0, 8, 16, 24} */
base = vaddq_n_u32(base, (uint32_t)p);
int32x4_t a = vldrwq_gather_base_wb_s32(&base, 64);
int32x4_t c = vldrwq_gather_base_s32(base, 16);
return vaddq_s32(a, c);
}

Compiled with arm-none-eabi-gcc -mcpu=cortex-m55 -mthumb -mfloat-abi=hard -O2, GCC 14.3.1 issues vldrw.u32 q0, [q3, #64]! before vldrw.u32 q2, [q3, #16]; GCC 15.2.1 issues them in the opposite order. The defect appears at -O1, -O2, -O3 and -Os, with and without -ffast-math. The write-back gather and scatter intrinsics occur only in the four complex-FFT files (16 call sites), and the real FFTs arm_rfft_fast_f32, arm_rfft_q31 and arm_rfft_q15 call those kernels.

Measured on the Corstone-300 simulator at ambiq/2026.10.0 (9046be7f), before the workaround below, a 64-point forward complex FFT built with GCC 15.2.1 and the Helium kernels has maximum absolute error 1.2e+04 (f32), 14.1 (Q31) and 14.1 (Q15) against a double-precision DFT, on inputs below 0.4 in magnitude, and overwrites 20 to 32 words below the caller’s buffer. The same test built with GCC 14.2.1, with ATfE 22.1.0, or with GCC 15.2.1 and AUTOVECTORIZE=ON is correct. f16 has the same construction and was not run. The write-back gathers are unchanged from Arm’s source, so heliaDSP v1.1.0 is affected in the same way when built with this compiler; its CI built with GCC 15.2.Rel1 and did not execute the result.

The upstream-tracking fork carries a regression test for the defect, Testing/Regression/mve_cfft_q31_guard.c (pull request #10 of the upstream-tracking fork), which places a memory-protection guard below the buffer and passes 14 Q31 cases, lengths 16 to 1024, forward and inverse, with GCC 14.3.1, and faults at the first case with GCC 15.2.1 on Arm’s source.

The qualified CMSIS-DSP commit carries a source workaround (pull request #53 of the upstream-tracking fork): in the last stage of the four files, each vldrwq_gather_base_wb_*(&addr, 64) becomes addr = vaddq_n_u32(addr, 64U) followed by vldrwq_gather_base_*(addr, 0), which issues the same addresses without a write-back gather. With it, mve_cfft_q31_guard.c passes its 14 cases under GCC 15.2.1 at -O2 and -O3, and the fork’s mve_cfft_overread.c passes 72 cases for f32, Q31, Q15 and f16, lengths 16 to 4096, with no access past the buffer. heliaDSP builds the four files with every compiler and applies no check of its own. No report has been filed with GCC; none is planned, because Arm GNU Toolchain 15.3.Rel1 does not reproduce the defect in the tests below.

Arm GNU Toolchain 15.3.Rel1 (GCC 15.3.1) does not reproduce the defect in the following tests. At 9046be7f, on Arm’s source, on the Corstone-300 simulator, at -O2 and -O3: a 64-point forward complex FFT against a double-precision DFT has maximum absolute error 5.388e-07 (f32), 6.333e-08 (Q31), 3.769e-03 (Q15) and 3.612e-03 (f16), the values of GCC 14.3.1 for the first three, with no guard element changed; mve_cfft_q31_guard.c passes its 14 cases; and in the four arm_cfft_* objects each of the 16 write-back gathers is followed by gathers that read the written-back address. It also compiles, without -fno-if-conversion, the sources on which GCC 15.2.1 stops with an internal compiler error (below), for Cortex-M4 and Cortex-M55. This evidence is for Arm’s 15.3.Rel1 build; GCC 15.3 builds from other vendors are assumed to behave the same and have not been tested. GCC 15.0 and 15.1 have not been tested and are treated as affected by the internal compiler error. GCC 16 has not been tested; it is outside the range 15.0 to 15.2, so heliaDSP applies no workaround to it.

The defect has been observed only in code that uses the write-back gather intrinsics (vldrwq_gather_base_wb_*); after the workaround no CMSIS-DSP library source uses them. Code of your own that uses them may be miscompiled by GCC 15.2.1 and is not detected. Linking a second CMSIS-DSP library as well (for example AmbiqSuite’s prebuilt archive) can supply arm_cfft_* from Arm’s unpatched source, which GCC 15.2.1 miscompiles for Helium. heliaDSP qualifies Helium builds with ATfE 22.1.0, not with GCC 15.

The GCC 15 if-conversion internal compiler error

Section titled “The GCC 15 if-conversion internal compiler error”

GCC 15.0 to 15.2 stop with an internal compiler error (during RTL pass: ce1, GCC bug rtl-optimization/122170) at -O1 and above when if-conversion meets a conditional saturating subtraction or addition, such as x > 0 ? x : __QSUB(0, x), and CMSIS-Core 6 maps __QSUB and __QADD to the ACLE builtins __qsub and __qadd. Six Q31 sources fail wherever their scalar code is compiled, on Cortex-M4 and on Cortex-M55 with AUTOVECTORIZE=ON: arm_abs_q31.c, arm_absmax_q31.c, arm_absmin_q31.c, arm_absmax_no_idx_q31.c, arm_absmin_no_idx_q31.c and arm_atan2_q31.c; with the Helium kernels only arm_atan2_q31.c fails. GCC 15.3 has the fix.

The qualified CMSIS-DSP commit works around the error in its headers (pull request #55 of the upstream-tracking fork). Directly after cmsis_compiler.h, arm_math_types.h redefines __QSUB and __QADD as forced-inline functions around the qsub and qadd instructions, which if-conversion does not look into, for GCC 15.0 to 15.2, not Clang, on targets with the DSP extension. The gate also requires __QSUB and __QADD to be defined as macros, so that CMSIS-Core 5.x builds, whose inline-assembly functions are unaffected, keep their own definitions. Under GCC 15.2 the saturating operation then sits behind a short conditional branch where GCC 15.3 emits an IT block; GCC 15.2.Rel1 is permitted through this workaround and is not qualified. The fork’s canary, Testing/Regression/gcc15_qsub_ifcvt_canary.c, compiles the reproducer without the workaround, so that the gate is narrowed when a compiler in the range stops failing. heliaDSP’s CMake applies no compiler option for this defect. The CI jobs for GCC 15.2.Rel1 build Cortex-M55 with AUTOVECTORIZE=ON and with the Helium kernels, and Cortex-M4 (build.py --cpu cortex-m4); they link and do not execute.

GCC 14.2.1 stops with an internal compiler error (in extract_insn, at recog.cc:2812) on CMSIS-DSP’s f16 Helium kernels for Cortex-M55 at -O1 and above, with or without AUTOVECTORIZE. In a cross build with GCC below 15, heliaDSP therefore defaults DISABLEFLOAT16=ON and prints:

-- helia-dsp: gcc 14.2.1 < 15 cannot compile the f16 MVE kernels (ICE); defaulting DISABLEFLOAT16=ON. Pass -DDISABLEFLOAT16=OFF to override.

A value set explicitly with -DDISABLEFLOAT16=..., or by a parent project, is respected. With f16 disabled the f16 functions and their declarations are absent. GCC 14 orders the write-back gathers correctly, and the 2.0.0 simulator and board runs with 14.2.1 pass. The Zephyr SDK’s GCC 14.3.0 compiled the f16 Helium kernels without the internal error at Zephyr’s -Ofast; that observation has not been extended to a policy change.

A board study of the matrix products and the FIR decimator at the qualified CMSIS-DSP commit (2026-10-09) narrows the extent of the internal error: at -O2 for Cortex-M55 with MVE, GCC 14.2.1 fails on arm_min_no_idx_f16.c alone, and with MVE disabled (-mcpu=cortex-m55+nomve) also on arm_absmax_no_idx_f16.c; arm_mat_vec_mult_f16, arm_mat_mult_f16 and the remaining f16 sources compile, and their output on the Apollo510 EVB matches ATfE’s within f16 accumulation. The default therefore stands as a build-breaking defect in two files, not as a correctness finding against the f16 Helium kernels. A second GCC defect applies to builds without MVE: GCC 14.2.1 and Arm GNU 14.3.1 compile a store of __fp16 for -mcpu=cortex-m55+nomve to a Neon lane store, vst1.16 {dN[0]}, which the Cortex-M55 does not implement, so the program takes a UsageFault on the first such store (a two-line function, *p = (__fp16)x;, reproduces it). f16 code must not be built with GCC for a Cortex-M target without MVE; ATfE 22.1.0 compiles every f16 source in both configurations. Neither defect has been reported to GCC.

nsx/nsx-module.yaml lists armclang, and a CI job builds and links a Cortex-M55 test with Arm Compiler 6.24 when an Arm licence is activated. No Armclang build of 2.0.0 has been executed on the simulator or on hardware, and its correctness on the Helium complex FFT has not been checked.

A static CMSIS-DSP library and the code that includes its headers must be compiled for the same CPU, FPU, float ABI and header-affecting definitions. Archives built with different options, architectures or toolchain ABIs are not interchangeable. heliaDSP does not distribute prebuilt libraries; it builds CMSISDSP in the consumer’s build tree with the consumer’s compiler.