-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Improve x86 intrinsics dependencies #1643
Conversation
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1643 +/- ##
===========================================
+ Coverage 82.97% 83.13% +0.16%
===========================================
Files 135 135
Lines 10885 10894 +9
Branches 2732 2816 +84
===========================================
+ Hits 9032 9057 +25
+ Misses 1143 1127 -16
Partials 710 710 ☔ View full report in Codecov by Sentry. |
Hmm, I think this looks good. FYI, there is a plan for making it possible to compile for a minimum arch of for example |
Maybe in this PR we should also remove checks for support for pre-AVX-512 intrinsics, since all supported compilers have these options? And drop support 32bit MacOS X? The
that was added in 2017 (d265bf7) Latest version supporting 32 bit applications - macOS Mojave (10.14). |
@Dead2 |
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
So from what I could tell, the "WITH_*" macros for those intrinsics weren't so much as detecting if they were supported but were for compiling support for those functions. E.g. you could turn one off if you wanted to. In general you probably didn't want to, though, as some of them called the lesser variants for shorter widths. |
@KungFuJesus |
I'm not saying it's a good idea to do so, but a possible motivating factor might be a smaller binary size. Honestly though that macro is guarding things which only need SSE2 but have no greater SSE4 variants so it's already a bad idea to turn off SSE2 in that case. |
I doubt this change has any negative side effects but I'll test it tonight. I'm otherwise good with it at face value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No discernible changes with compilation with this. I don't have a vpclmulqdq capable CPU to test that, and there's the always problematic "use native" being incompatible with build options, but I don't see anything here as an issue.
Maybe with WITH_NATIVE_INSTRUCTIONS could make cmake only use native capabilities for the WITH_ options, but maybe that warrants a different PR.
@KungFuJesus The last commit implements static dispatch using predefined compiler macros. I plan to propose this changes a bit later after minor tweaks. |
I don't think it is a good idea to completely remove support for older compilers just because they are not actively supported anymore. There are for example binary distributors that do static compiles on older distros so that their binary can be run on pretty much all distros, both old and new. We still try to retain support for older compilers if we can. But, compilers older than GCC 4.5 is probably few and far between, so I would be open to assuming the compiler supports up to sse4.2. Unless there are arguments against this of course.
Same as above, I don't think removing support is needed. It was released in 2018, so it is not really that old. I don't think anyone should still use that, but that is really none of my business, there will be users and corner-cases. And we don't really win anything by removing that support. |
AVX512 includes AVX2, ..., SSE(N+1) includes SSE(N).
I have not seen any compilers that violate this chain of inclusions.
We can remove unnecessary checks.