Skip to content

Commit 79b033b

Browse files
fix: detect Arm NEON with alternative predefined macro
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>
1 parent 2f7a264 commit 79b033b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/implementation/c/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class CCompiler {
4949
out.push('#endif /* __SSE4_2__ */');
5050
out.push('');
5151

52-
out.push('#ifdef __ARM_NEON__');
52+
out.push('#if defined(__ARM_NEON__) || defined(__ARM_NEON)');
5353
out.push(' #include <arm_neon.h>');
5454
out.push('#endif /* __ARM_NEON__ */');
5555
out.push('');

src/implementation/c/node/table-lookup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
202202
return false;
203203
}
204204

205-
out.push('#ifdef __ARM_NEON__');
205+
out.push('#if defined(__ARM_NEON__) || defined(__ARM_NEON)');
206206
out.push(`while (${ctx.endPosArg()} - ${ctx.posArg()} >= 16) {`);
207207
out.push(' uint8x16_t input;');
208208
out.push(' uint8x16_t single;');

0 commit comments

Comments
 (0)