Hi,

I'm trying to compile our C++ code that makes use of SSE 4.1 intrinsics. 

I'm on OSX 10.11.6 using emscripten-incoming-64bit on commit 
a28973d1b60a22723768e4e2bbe77b6795f964d1

The emscripten command I'm running is:

path/to/emscripten/incoming/em++ --pre-js 
/Users/joe/Desktop/test2/js/hv_wrapper.js 
/Users/joe/Desktop/test2/c/Heavy_heavy.cpp 
/Users/joe/Desktop/test2/c/HeavyContext.cpp 
/Users/joe/Desktop/test2/c/HvHeavy.cpp 
/Users/joe/Desktop/test2/c/HvLightPipe.c 
/Users/joe/Desktop/test2/c/HvMessage.c 
/Users/joe/Desktop/test2/c/HvMessagePool.c 
/Users/joe/Desktop/test2/c/HvMessageQueue.c 
/Users/joe/Desktop/test2/c/HvSignalPhasor.c 
/Users/joe/Desktop/test2/c/HvSignalVar.c 
/Users/joe/Desktop/test2/c/HvTable.c -msse4.1 -ffast-math -DNDEBUG 
-std=c++11 -Wall -s WASM=1 -s RESERVED_FUNCTION_POINTERS=2 -s 
EXPORTED_FUNCTIONS=["_hv_heavy_new", "_hv_delete", "_hv_processInline", 
"_hv_getNumInputChannels", "_hv_getNumOutputChannels", "_hv_setPrintHook", 
"_hv_sendFloatToReceiver", "_hv_sendBangToReceiver", 
"_hv_sendSymbolToReceiver", "_hv_stringToHash", "_hv_msg_getByteSize", 
"_hv_msg_init", "_hv_msg_setFloat", "_hv_msg_getFloat", 
"_hv_table_getLength", "_hv_table_resize", "_hv_table_getBuffer"] -O3 
--memory-init-file 0 -o /Users/joe/Desktop/test2/js/heavyLib.min.js


And the errors I get are these:

path/to/c/HvMath.h:335:11: error: use of undeclared identifier 
'__builtin_ia32_roundps'
  *bOut = _mm_ceil_ps(bIn);
          ^
path/to/emscripten/incoming/system/include/SSE/smmintrin.h:53:30: note: 
expanded from macro '_mm_ceil_ps'
#define _mm_ceil_ps(X)       _mm_round_ps((X), _MM_FROUND_CEIL)
                             ^
path/to/emscripten/incoming/system/include/SSE/smmintrin.h:64:11: note: 
expanded from macro '_mm_round_ps'
  (__m128)__builtin_ia32_roundps((__v4sf)(__m128)(X), (M)); })
          ^
path/to/c/HvMath.h:335:9: error: assigning to '__m128' (aka 'float32x4') 
from incompatible type 'void'
  *bOut = _mm_ceil_ps(bIn);
        ^ ~~~~~~~~~~~~~~~~
path/to/c/HvMath.h:353:11: error: use of undeclared identifier 
'__builtin_ia32_roundps'
  *bOut = _mm_floor_ps(bIn);
          ^
path/to/emscripten/incoming/system/include/SSE/smmintrin.h:58:30: note: 
expanded from macro '_mm_floor_ps'
#define _mm_floor_ps(X)      _mm_round_ps((X), _MM_FROUND_FLOOR)
                             ^
path/to/emscripten/incoming/system/include/SSE/smmintrin.h:64:11: note: 
expanded from macro '_mm_round_ps'
  (__m128)__builtin_ia32_roundps((__v4sf)(__m128)(X), (M)); })
          ^
path/to/c/HvMath.h:353:9: error: assigning to '__m128' (aka 'float32x4') 
from incompatible type 'void'
  *bOut = _mm_floor_ps(bIn);
        ^ ~~~~~~~~~~~~~~~~~
4 errors generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting


It looks like it can't find the builtin x86 functions, I'm not that 
familiar with the emscripten build system so I'm wondering if there's 
something I'm misssing?

Note: i had to change the #include <immintrin.h> declaration we usually 
have to #include <smmintrin.h> for emscripten to find the SSE4.1 intrinsics.

Any pointers would be much appreciated!

Thanks,
Joe

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to