MLAS: use vmlaq_f32 for ARMv7 targets - #26161
Merged
hariharans29 merged 2 commits intoSep 25, 2025
Merged
Conversation
Use vmlaq_f32 on MLAS_TARGET_ARM (armv7) so builds on Linux/Android arm32 don't attempt to use the armv8 (aarch64) vfmaq_f32 intrinsic. Fixes build failures referencing vfmaq_f32 in arm_neon.h. Signed-off-by: Wei Du <wei.du@tpv-tech.com>
edgchen1
reviewed
Sep 25, 2025
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Member
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
hariharans29
approved these changes
Sep 25, 2025
edgchen1
approved these changes
Sep 25, 2025
Contributor
Author
|
My first pr to open source, it is simple but seeing it merged still made me excited! Thank you ONNX! |
Contributor
@weidu-tpvision Thanks for your contribution! |
fs-eire
pushed a commit
that referenced
this pull request
Oct 24, 2025
Use vmlaq_f32 on MLAS_TARGET_ARM (armv7) so builds on Linux/Android arm32 don't attempt to use the armv8 (aarch64) vfmaq_f32 intrinsic. Fixes build failures referencing vfmaq_f32 in arm_neon.h. ### Description On ARMv7 targets (32-bit ARM with NEON) the vfmaq_f32 intrinsic is unavailable and causes build failures like: target specific option mismatch 1728 | vfmaq_f32 (float32x4_t __a, float32x4_t __b, float32x4_t __c). The previous code only fell back to vmlaq_f32 when __ANDROID__ was defined, which fixes Android but not Linux ARM32 builds. ### Motivation and Context The proposal is to change: if defined(__ANDROID__) && defined(MLAS_TARGET_ARM) to: if defined(MLAS_TARGET_ARM) This change ensures 32-bit ARM builds (Linux and Android) use vmlaq_f32 while 64-bit ARM uses vfmaq_f32. This pr is related to issue #25949 which was opened also by me. --------- Signed-off-by: Wei Du <wei.du@tpv-tech.com> Co-authored-by: Hariharan Seshadri <shariharan91@gmail.com> Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
naomiOvad
pushed a commit
to naomiOvad/onnxruntime
that referenced
this pull request
Nov 2, 2025
Use vmlaq_f32 on MLAS_TARGET_ARM (armv7) so builds on Linux/Android arm32 don't attempt to use the armv8 (aarch64) vfmaq_f32 intrinsic. Fixes build failures referencing vfmaq_f32 in arm_neon.h. ### Description On ARMv7 targets (32-bit ARM with NEON) the vfmaq_f32 intrinsic is unavailable and causes build failures like: target specific option mismatch 1728 | vfmaq_f32 (float32x4_t __a, float32x4_t __b, float32x4_t __c). The previous code only fell back to vmlaq_f32 when __ANDROID__ was defined, which fixes Android but not Linux ARM32 builds. ### Motivation and Context The proposal is to change: if defined(__ANDROID__) && defined(MLAS_TARGET_ARM) to: if defined(MLAS_TARGET_ARM) This change ensures 32-bit ARM builds (Linux and Android) use vmlaq_f32 while 64-bit ARM uses vfmaq_f32. This pr is related to issue microsoft#25949 which was opened also by me. --------- Signed-off-by: Wei Du <wei.du@tpv-tech.com> Co-authored-by: Hariharan Seshadri <shariharan91@gmail.com> Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
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.
Use vmlaq_f32 on MLAS_TARGET_ARM (armv7) so builds on Linux/Android arm32 don't attempt to use the armv8 (aarch64) vfmaq_f32 intrinsic.
Fixes build failures referencing vfmaq_f32 in arm_neon.h.
Description
On ARMv7 targets (32-bit ARM with NEON) the vfmaq_f32 intrinsic is unavailable and causes build failures like:
target specific option mismatch 1728 | vfmaq_f32 (float32x4_t __a, float32x4_t __b, float32x4_t __c).
The previous code only fell back to vmlaq_f32 when ANDROID was defined, which fixes Android but not Linux ARM32 builds.
Motivation and Context
The proposal is to change:
if defined(ANDROID) && defined(MLAS_TARGET_ARM)
to:
if defined(MLAS_TARGET_ARM)
This change ensures 32-bit ARM builds (Linux and Android) use vmlaq_f32 while 64-bit ARM uses vfmaq_f32.
This pr is related to issue #25949 which was opened also by me.