Repository navigation
sns: disable tree vectorization for Arm MVE GCC builds - #95
Open
vignesh-aerlync wants to merge 1 commit into
Open
vignesh-aerlync wants to merge 1 commit into
vignesh-aerlync wants to merge 1 commit into
Conversation
At -O3 with GCC 14, loop vectorization in sns.c generates literal pool constants located farther than the 1020-byte immediate displacement limit for vldr instructions on Cortex-M55 (Armv8.1-M MVE). This results in the GNU assembler error: 'Error: co-processor offset out of range'. Disable tree vectorization specifically for Arm GCC builds with __ARM_FEATURE_MVE in sns.c to prevent this assembler failure while preserving -O3 optimization across the rest of the library. Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When compiling
src/sns.cat-O3for Arm Cortex-M55 / Armv8.1-M with Helium/MVE (-mcpu=cortex-m55) using GCC 14 (e.g.arm-none-eabi-gccorarm-zephyr-eabi-gcc), loop vectorization unrolls the loops inlc3_sns_analyze()and generates floating-point constants in literal pools located farther than the 1020-byte immediate displacement limit forvldrinstructions.This leads to the GNU assembler error:
Solution
Add a targeted #pragma GCC optimize("no-tree-vectorize") inside
src/sns.cguarded by (__ARM_FEATURE_MVE & 1) anddefined(GNUC) && !defined(clang).
• Prevents GCC from emitting out-of-range literal pool offsets on Arm MVE targets.
• Preserves full -O3 optimizations across the rest of the file and library.
• Completely inert on non-MVE architectures, Clang builds, and existing x86/ARM platforms.
Fixes #94