Attempt to consolidate SSE and ARM NEON SIMD code for GCC/clang and Visual Studio #252
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.
Hi,
This attempts to clean up the code a bit in
graphene-simd4f.h
andgraphene-simd4x4f.h
by trying to reduce the code duplication for SSE and ARM NEON SIMD implementation due to syntactical differences in Visual Studio and GCC/clang in regards to inlining, via:__extension__
and direct intrinsic call) supported by GCC/clang and Visual Studio, for calls that could be done as one-liners.graphene_simd4f_t
arrays from the 4 floats that we pass in, especially as we required C99 support for a while and the supported Visual Studio compilers have the needed support for this.graphene_msvc_
instead of just_
to make things clearer to people[1].[1]: Sadly, I was not able to do the cleanup for the SIMD code that are done in a function-like manner. I couldn't get the preprocessor happy in one shot for Visual Studio and clang, ugh :|, so I had to leave that alone, since preprocessors don't allow a working #define inside a macro and doesn't like splitting lines when set apart by #if/#ifdef's. So this is the best I could do for now. For instance:
(unrelated parts omitted for brevity, trying to remember things on top of my head, so there might be some mistakes below)
I understand that this PR might well conflict with the changes in #251, so if one of this or #251 goes through, I will fix things up as needed as soon as possible.
With blessings, thank you!