-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
It's not possible to store bit masks in SIMD register for logical operations. #2840
Comments
Yes, this does look like NaN caonicalization in the polyfill, as you noted in tc39/ecmascript_simd#38 (comment) The only ways I can think of to fix this in the polyfill involve making float32x4 hold raw bit patterns and convert them to actual float32 values on demand, but that would add a bunch of complexity and slow it down. Native implementations can avoid this problem because a plain SIMD load won't involve loading scalar values, so it won't require NaN canonicalization. |
Added a test for this in the above commit. This passes in node.js which uses the polyfill, but does not pass in SpiderMonkey, which should not be using the polyfill, so I don't think this is a polyfill issue, but related to SpiderMonkey instead? |
Like said earlier, this is not a polyfill issue. LLVM is failing here. Building with |
…rns in a SIMD vector, don't attempt to create a float SIMD vector directly out of them, since JS source can't represent NaNs with noncanonical bits. Instead, create a int SIMD vector and cast it to float one to detour to the SIMD vector with correct bits intact. Fixes emscripten-core/emscripten#2840, emscripten-core/emscripten#3560, emscripten-core/emscripten#3010 and emscripten-core/emscripten#3403.
…rns in a SIMD vector, don't attempt to create a float SIMD vector directly out of them, since JS source can't represent NaNs with noncanonical bits. Instead, create a int SIMD vector and cast it to float one to detour to the SIMD vector with correct bits intact. Fixes emscripten-core/emscripten#2840, emscripten-core/emscripten#3560, emscripten-core/emscripten#3010 and emscripten-core/emscripten#3403.
…rns in a SIMD vector, don't attempt to create a float SIMD vector directly out of them, since JS source can't represent NaNs with noncanonical bits. Instead, create a int SIMD vector and cast it to float one to detour to the SIMD vector with correct bits intact. Fixes emscripten-core/emscripten#2840, emscripten-core/emscripten#3560, emscripten-core/emscripten#3010 and emscripten-core/emscripten#3403.
Fixed in the above PR, works in current incoming. |
…rns in a SIMD vector, don't attempt to create a float SIMD vector directly out of them, since JS source can't represent NaNs with noncanonical bits. Instead, create a int SIMD vector and cast it to float one to detour to the SIMD vector with correct bits intact. Fixes emscripten-core/emscripten#2840, emscripten-core/emscripten#3560, emscripten-core/emscripten#3010 and emscripten-core/emscripten#3403.
…rns in a SIMD vector, don't attempt to create a float SIMD vector directly out of them, since JS source can't represent NaNs with noncanonical bits. Instead, create a int SIMD vector and cast it to float one to detour to the SIMD vector with correct bits intact. Fixes emscripten-core/emscripten#2840, emscripten-core/emscripten#3560, emscripten-core/emscripten#3010 and emscripten-core/emscripten#3403.
Build the following code:
Running in FF Nightly prints out
[7FC00000,7FC00000,7FC00000,7FC00000]
, whereas it should print[FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF]
.The text was updated successfully, but these errors were encountered: