-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Add SIMD option to compile system and implement SIMD for vector4. #86340
base: master
Are you sure you want to change the base?
Add SIMD option to compile system and implement SIMD for vector4. #86340
Conversation
I believe that we can support arm64 and x86_64 simd. #83648 so I support this. I tried to do some work in the mikktspace pr. Edited: My changes were moved to https://github.com/V-Sekai/godot/tree/mikktspace-optimization-simd |
faba070
to
a8d745f
Compare
a8d745f
to
693a941
Compare
While this is a great addition IMO there needs to be some way to make the code readable, some helper methods or macros for example, this code is very hard to follow with the many options |
693a941
to
cedeec4
Compare
cedeec4
to
14d8314
Compare
I have not idea about improving readable. The current is already the best implementation I can achieve. |
Imo it's a better idea to keep the results in the post rather than a separate file, which provides a barrier to people reading it (and it is important to show that the gains here are minimal). There have been several discussions regarding SIMD in proposals: Bear in mind we need to come to a consensus on a proposal before adding a new feature. This has happened a few times with new contributors not understanding the proposal / pre-approval process. There are several problems to consider here:
On the plus side, just ensuring that these single instruction functions take full advantage of SIMD may still be worth doing as they require little changes to most code, and might get a reasonable gain. I'm personally of the opinion that eventually offering both some conversion for existing single instructions (as this PR does), and offering single instruction multiple data function APIs (as in godotengine/godot-proposals#290 is a good way forward. |
To implement SIMD in godot math is a huge work, this is the firt step.
I'm not sure if it's worth, and this change lack of testing.
If this is not worth, I will stop progress and remain in my branch.
CPU: I7-8750H
Build options: platform=windows arch=x86_x64 target=template_release debug_symbols=no bits=64 tests=yes optimize=speed
Results:
test_results.md
As the results show, SIMD does not always bring better speed, I don't know whether there have mistakes in this pr.
I remaind my test in "test_vector4.h", please check it.
And I have arm platform, build with "simd_type=neon" need test by others.