Don't abort when calling qfind_first_byte_of_sse42 without compiler support for SSE 4.2
authorChristopher Dykes <cdykes@fb.com>
Fri, 28 Oct 2016 21:20:34 +0000 (14:20 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Fri, 28 Oct 2016 21:23:30 +0000 (14:23 -0700)
Summary:
If Folly was compiled without support for SSE 4.2, but this function ends up getting called, we'd abort due to the check failing.
To solve this, just don't do the check and fall back to the non-sse version.

This is reasonable because it means that the code calling `qfind_first_byte_of_sse42` only needs to care whether there is CPU support for SSE 4.2, not whether we were able to actually implement the search with SSE 4.2 based on compiler support.

Reviewed By: yfeldblum

Differential Revision: D4096645

fbshipit-source-id: d26a791c09f61595e40c84c47a7a2596b9b69c1e

folly/detail/RangeSse42.cpp

index 09e37781e943a5b3de2932681f5d4008947dcfc3..79dfe74e4d80b56fbeaf883481e81a5cf6a4361d 100644 (file)
@@ -29,7 +29,6 @@ namespace folly {
 namespace detail {
 size_t qfind_first_byte_of_sse42(const StringPieceLite haystack,
                                  const StringPieceLite needles) {
-  CHECK(false) << "Function " << __func__ << " only works with SSE42!";
   return qfind_first_byte_of_nosse(haystack, needles);
 }
 }