emscripten-core / emscripten-core/emscripten

Missing SIMDe ARM NEON A32V8 native aliases

Open
#24,066 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

**Version of emscripten/emsdk:**
```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.6 (1ddaae4d2d6dfbb678ecc193bc988820d1fc4633)
clang version 21.0.0git (https:/github.com/llvm/llvm-project 4775e6d9099467df9363e1a3cd5950cc3d2fde05)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /data/home/sliphua/open/emsdk/upstream/bin
```

**Failing command line in full:**
It fails when compiling [astc-encoder](https://github.com/ARM-software/astc-encoder) ARM NEON version. I've found the cause so the build and adaption steps like adding the `-msimd128` flag are omitted.

The error:
```
In file included from /data/home/sliphua/open/astc-encoder/Source/astcenc_mathlib.cpp:18:
In file included from /data/home/sliphua/open/astc-encoder/Source/astcenc_mathlib.h:460:
In file included from /data/home/sliphua/open/astc-encoder/Source/astcenc_vecmathlib.h:163:
/data/home/sliphua/open/astc-encoder/Source/astcenc_vecmathlib_neon_4.h:760:17: error: use of undeclared identifier 'vrndnq_f32'
760 | return vfloat4(vrndnq_f32(a.m));
| ^
1 error generated.
make[2]: *** [Source/CMakeFiles/astcenc-neon-static.dir/build.make:272: Source/CMakeFiles/astcenc-neon-static.dir/astcenc_mathlib.cpp.o] Error 1
```

The cause:
1. emscripten uses SIMDe for NEON SIMD functions.
2. SIMDe `vrndnq_f32` requires `SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES`.
https://github.com/simd-everywhere/simde/blob/2af3dce9b2481b6b32139b1022cdfc02a633c898/simde/arm/neon/rndn.h#L193-L196
3. emscripten did not enabled `SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES`.
https://github.com/emscripten-core/emscripten/blob/d05dbc817acc5697854427407631e8cad277387d/tools/maint/simde_update.py#L75-L78

The error gone and the project can be compiled successfully if I manually define `SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.