From 41f3c60b22c4d3ba6ded15c420fc2f157f38a150 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Sat, 24 Jan 2015 23:41:09 +0000 Subject: [PATCH] Use aligned SSE register load intrinsic. The code goes to the trouble of ensuring that data is aligned at a 16-byte boundary, then goes ahead and uses the unaligned form of the load intrinsic _mm_loadu_si128. Either the code shouldn't bother aligning the data to the start of the whitespace, or it should use the aligned form of the intrinsic. --- include/rapidjson/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index 2394407..f0aa318 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -277,7 +277,7 @@ inline const char *SkipWhitespace_SIMD(const char* p) { // The rest of string using SIMD static const char whitespace[16] = " \n\r\t"; - const __m128i w = _mm_loadu_si128((const __m128i *)&whitespace[0]); + const __m128i w = _mm_load_si128((const __m128i *)&whitespace[0]); for (;; p += 16) { const __m128i s = _mm_load_si128((const __m128i *)p);