Skip to content

Missing SIMDe ARM NEON A32V8 native aliases #24066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PaperStrike opened this issue Apr 8, 2025 · 0 comments
Open

Missing SIMDe ARM NEON A32V8 native aliases #24066

PaperStrike opened this issue Apr 8, 2025 · 0 comments

Comments

@PaperStrike
Copy link

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 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.
    try:
    f.write("#define SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES\n")
    f.write("#define SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES\n")
    f.write(neon_h_buf)

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

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

No branches or pull requests

1 participant