Comments (5)
Sorry about that. I get an error on all the other instruction set flags too, so I opted to bypass the entire code block.
from joltphysics.
Shouldn't Jolt be adding the -msimd128 flag itself instead, as well as any -msse* flags, based on the relevant CMake options?
Yes it should. I've just submitted a change that adds a cmake option USE_WASM_SIMD
which will add the needed flags.
Was SSE 4.2 just brought up as an example, or is there some limitation with Jolt and Emscripten that prevents targeting SSE2?
Emscripten just translates the SSE/AVX instructions to WASM SIMD instructions. The reason why I didn't pick AVX is that Jolt uses 256 bit SIMD instructions when AVX is enabled, which is not supported by emscripten. I picked the next highest which is SSE 4.2. I don't think it matters which SSE version you pick as it all gets converted to WASM instructions and the browser is responsible for translating them to native (SSE / NEON) instructions based on the CPU architecture.
It may be that rewriting Jolt to use the WASM intrinsics gives better performance, but having the SSE instructions automatically convert to WASM instructions was a lot less work.
from joltphysics.
Yes it should. I've just submitted a change that adds a cmake option
USE_WASM_SIMD
which will add the needed flags.
Great, thank you! Now there's just the dilemma of whether to actually enable it or not I guess. 😅
I don't think it matters which SSE version you pick as it all gets converted to WASM instructions and the browser is responsible for translating them to native (SSE / NEON) instructions based on the CPU architecture.
I'm a bit surprised that the minimum hardware requirements for WASM SIMD isn't explicitly mentioned anywhere for any of the major browsers (that I could find at least). I had to dig through the V8 source code to find that it's SSE4.1 for Chromium-based browsers. The one SSE4.2 intrinsic that's mappable to WASM SIMD (_mm_cmpgt_epi64
) seems to have an SSE3 fallback in V8, as far as I can tell, so I assume they aim for everything to run on the minimum instruction set (i.e. SSE4.1).
from joltphysics.
Awesome! Thank you!
from joltphysics.
I'm a bit confused by this.
Shouldn't Jolt be adding the -msimd128
flag itself instead, as well as any -msse*
flags, based on the relevant CMake options? From what I can tell from Emscripten's documentation it still supports all these flags just fine, albeit with some gaps/emulation in the instructions themselves by the looks of it.
Clearly mfpmath=sse
isn't supported though, judging by the error here, but seeing as how the user is forced to append the rest of them through something like CMAKE_CXX_FLAGS
anyway I don't quite see the point in omitting them from Jolt altogether.
I'm also curious about the specific mention of -msse4.2
here:
Line 623 in 6e0b867
Was SSE 4.2 just brought up as an example, or is there some limitation with Jolt and Emscripten that prevents targeting SSE2?
(I realize SSE 4.2 has pretty much 100% coverage these days, but Godot is still hanging on to SSE2 for now.)
EDIT: I see now that the browser coverage isn't great for WebAssembly SIMD in general, but that's beside the point I guess.
from joltphysics.
Related Issues (20)
- HingeConstraint does not behave as expected HOT 2
- -mfpmath=sse is not added in 32bits build HOT 10
- Kinematic `BoxShape` sensor versus `MeshShape` fails to report contacts HOT 5
- Sample CharacterTest.cpp HOT 1
- LinearCast Body missed in Sensor contact HOT 4
- NonCopyable is missing move operations HOT 3
- Crash on Mutex::lock() - 0x00007ffbd9232ff0 MSVCP140.dll!UnknownFunction HOT 2
- Spheres collide with internal edges despite mitigations HOT 6
- Compilation fails with g++ on Ubuntu 22.04 HOT 5
- Missing documentation on how to destroy a physics object. HOT 2
- Request for official vcpkg support HOT 8
- Serialized arrays are not compatible between 32 and 64 bit systems HOT 1
- VS2022_CL build fails with warning C4514 HOT 2
- Linux-on-ARM compile errors HOT 6
- Core.h defines JPH_USE_NEON HOT 3
- Error when generating build files for Ninja and clang-cl HOT 6
- Request for Anisotropic Friction HOT 1
- Compiles but doesn't run in Arch linux HOT 2
- [Feature request] Implement gravity override for all bodies and not just vehicle constraints
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joltphysics.