Improvements to Constraint Solvers SIMD(btSequentialImpulseConstraintSolver.cpp) #3735
TrianglesPCT
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I made some local improvements to the SIMD constraint solver kernals, but my bullet has been modified so much it doesn't match with github anymore(among other things I replaced most of the manual SIMD code with my own library that wraps SSE/AVX)
So I am just going to show to places where improvements can be made to the solvers..
1. The upper and lower limit can be applied with much less code
The way the clamping is being done is not very efficient, and generates a bunch of unnecessary instructions..
Current Bullet code:
Improved version with same result(~9 instructions vs ~4 instructions)
I merged the Generic/LowerLimit version into a single function with compile time constant, as the only difference is this single min()
2. The giant dot product is very inefficient, it uses multiple horizontal operations when only 1 is needed. It also suffers from many rounding events because of this(reducing precision). ( _mm_dp_ps rounds has a rounding event after each internal op)
Instead do something like this, now we only have a single horizontal op at the end, and everything before is wide SIMD--the result is both faster and more accurate.
Beta Was this translation helpful? Give feedback.
All reactions