Simd math and isa integration#1680
Open
marauder2k7 wants to merge 15 commits intoTorqueGameEngines:developmentfrom
Open
Simd math and isa integration#1680marauder2k7 wants to merge 15 commits intoTorqueGameEngines:developmentfrom
marauder2k7 wants to merge 15 commits intoTorqueGameEngines:developmentfrom
Conversation
find avx2 and avx512
setup libraries for different simd isa's add float4 functions for c sse2 and avx2 (placeholder file for neon to be implemented on mac)
fix mac build
mac implementation had _mm_div (x86 intrinsic)
note: 64bit only
working for both neon32 and neon64 Update math_backend.cpp further sse simd additions avx2 float3 added added normalize_magnitude added divide fast to float3 may copy to float4 move static spheremesh to drawSphere (initialize on first use) so platform has a chance to load the math backend all float3 and float4 functions and isas completed all options of float3 and float4 functions in isas and math_c neon still to be done but that will be on mac. Update math_backend.cpp mac isa neon update added float3 restructured the classes to look more like the final version of the x86 classes linux required changes Update build-macos-clang.yml Update build-macos-clang.yml Revert "Update build-macos-clang.yml" This reverts commit 29dfc56. Revert "Update build-macos-clang.yml" This reverts commit 2abad2b. Update CMakeLists.txt fix macs stupid build remove god awful rolling average from frame time tracker.... use intrinsic headers instead each isa implementation now uses a header for that isa's intrinsic functions these are then used in the impl files. This will make it easier for matrix functions when those are implemented. fixed comment saying 256 when it should be 512 for avx512 consolidated initializers for function tables Update neon_intrinsics.h fixes for some neon intrinsics no idea if this is the best way to do these but they work at least v_cross is especially messy at the moment we basically just do it as a c math function need to look into getting this done correctly
most matrix functions are converted over, no benefit to converting over the project/ortho because they would be scalar anyway but may need to move them regardless.
removed some x86 intrinsic functions that were in the mat44_impl file reinstated some mMath_C functions and mMathFn ptrs trying to diagnose an issue. Had to come up with a different way to initialize the scalar table if the isa tables are not initialized yet. Mac did not like the static initialization. Had to change neon over to using explicit masks for shifting, cross product was failing during bakes and matrix calculations
MSVC doesnt use __builtin_expect it is a GCC only flag
fix tests by adding an explicit inverse to function copy 3rd row into dst it seems original was not touching this at all.
should use original matrix translation not the dst matrix
safety no longer needed due to safe initializers
missed convolve and convolveInverse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds ISA backends to the math functions.
These implementations are protected by use of an object library type so it will only be seen by compatible archs. This may not be the best way to do this would require further investigation. There are some more functions that need to be implemented
TODO: Batch functions, get rid of mMath_C mMath_SSE mMath_ASM.
Future improvements could be to directly use the intrinsics with our public math types eg mPoint3 mPoint4 etc. This way we can avoid multiple load and store calls which are the heaviest functions in the simd pipelines.
The feature was request by Abbey after discovering that simd instructions were not be utilized in our backend math classes.