lighttransport/tinyusdz

Failing build on armeabi-v7a with android NDK

tellypresence opened this issue · 0 comments

tinyusdz builds correctly on android for 64 bit arm, x86_64 and x86. But it appears that when building on 32 bit arm, the NEON intrinsic for 64 bit arm is picked up due to falling past the 32 bit #elif condition.

Error in src/external/stb_image_resize2.h

error: use of undeclared identifier 'vld1q_f16'
    float16x8_t in = vld1q_f16(input);

The problem seems to be that arm32 isn't detected properly, and the #if/#elif cascade falls through to the block for 64 bit arm

#if defined(STBIR_FP16C)
...
#elif defined(STBIR_SSE2)
...
#elif defined(STBIR_WASM) || (defined(STBIR_NEON) && defined(_MSC_VER) && defined(_M_ARM)) // WASM or 32-bit ARM on MSVC/clang
...
#elif defined(STBIR_NEON) && defined(_MSC_VER) && defined(_M_ARM64) && !defined(__clang__) // 64-bit ARM on MSVC (not clang)
...
#elif defined(STBIR_NEON) // 64-bit ARM

  static stbir__inline void stbir__half_to_float_SIMD(float * output, stbir__FP16 const * input)
  {
    float16x8_t in = vld1q_f16(input);