Skip to content

Instantly share code, notes, and snippets.

@dakcarto
Created April 30, 2014 23:26
Show Gist options
  • Save dakcarto/ad89e0235376f90a1323 to your computer and use it in GitHub Desktop.
Save dakcarto/ad89e0235376f90a1323 to your computer and use it in GitHub Desktop.
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 7c8986f..b48c081 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -3585,7 +3585,7 @@ static inline __m128i mergeQuestionMarks(__m128i chunk)
{
const __m128i questionMark = _mm_set1_epi16('?');
-# ifdef __SSE4_2__
+# if defined(QT_HAVE_SSE4_2) && defined(__SSE4_2__)
// compare the unsigned shorts for the range 0x0100-0xFFFF
// note on the use of _mm_cmpestrm:
// The MSDN documentation online (http://technet.microsoft.com/en-us/library/bb514080.aspx)
@@ -3615,7 +3615,7 @@ static inline __m128i mergeQuestionMarks(__m128i chunk)
const __m128i signedChunk = _mm_add_epi16(chunk, signedBitOffset);
const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask);
-# ifdef __SSE4_1__
+# if defined(QT_HAVE_SSE4_1) && defined(__SSE4_1__)
// replace the non-Latin 1 characters in the chunk with question marks
chunk = _mm_blendv_epi8(chunk, questionMark, offLimitMask);
# else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment