Fix #153 by checking for SSE4.2 support#1876
Merged
adamnovak merged 2 commits intovgteam:masterfrom Sep 18, 2018
Merged
Conversation
|
Jenkins vg tests complete for PR 1876. View the full report here. 19 tests passed, 0 tests failed and 10 tests skipped in 22141 seconds Tests produced 2680 warnings. 2679 were for lower-than-expected alignment scores |
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.
I've made vg check the CPUID bits as the first thing it does, using methodology borrowed from what dlib does, and bail out if SSE2 is not available.
I've also added -msse4.2 to the vg cflags, because
dozeu.hwas warning that it was forcing SSE4.1 on one of its functions, since the default was to build vg itself without any fancy instructions. This should let the majority of vg code use SSE4.2 instructions when the compiler thinks it appropriate, and quash the warning. The code that checks for SSE4.2 support and complains if it can't find it is built to run on lowest-common-denominator x86-64, and works in practice on my machine which lacks SSE4.2:This is a bit blunt, but it should make it much more clear what the problem is than a signal 4 and a crash report that makes it look like vg has a terrible bug.
Since GCC and Clang now have function multi-versioning, we really should be able to have the appropriate implementation (SSE4.2 or not) for anything that requires it chosen at runtime automatically, if we want to support systems without SSE4.2.