Skip to content

fix: detect Arm NEON with alternative predefined macro#84

Merged
indutny merged 1 commit intonodejs:mainfrom
OldManYellsAtCloud:main
Feb 14, 2026
Merged

fix: detect Arm NEON with alternative predefined macro#84
indutny merged 1 commit intonodejs:mainfrom
OldManYellsAtCloud:main

Conversation

@OldManYellsAtCloud
Copy link
Contributor

Currently Arm NEON availability is detected using only the ARM_NEON predefined macro. However this is not defined by all modern compilers, it seems it was superseded by __ARM_NEON. The "Arm C Language Extensions" guide[1] refers to __ARM_NEON macro aswell.

To be able to detect NEON availability more reliably, check for both macro names.

[1]: https://developer.arm.com/documentation/ihi0053/d/ - pdf, section 6.9

Currently Arm NEON availability is detected using only the __ARM_NEON__
predefined macro. However this is not used by all modern compilers,
it seems it was superseded by __ARM_NEON. The "Arm C Language Extensions"
guide[1] refers to __ARM_NEON macro aswell.

To be able to detect NEON availability more reliably, check for
both macro names.

[1]: https://developer.arm.com/documentation/ihi0053/d/ - pdf, section 6.9

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Feb 13, 2026
The llhttp vendored dependency of nodejs takes advantage of Arm NEON
instructions when they are available, however they are detected by
checking for an outdated CPU feature macro: it checks for __ARM_NEON__,
however it is not defined by new compilers for aarch64, rather they
set __ARM_NEON. The Arm C extension guide[1] refers to __ARM_NEON macro
aswell.

This patch changes the detection to check for both macros when detecting
the availability of NEON instructions.

The code this patch modifies is generated, so the patch itself isn't
suitable for upstream submission, as the root cause of the error is
in the generator itself. A PR has been submitted[2] to the generator
project to rectify this issue.

[1]: https://developer.arm.com/documentation/ihi0053/d/ - pdf, section 6.9
[2]: nodejs/llparse#84

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Copy link
Member

@indutny indutny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@indutny indutny merged commit 79b033b into nodejs:main Feb 14, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants