From bcd879653fd0044931db5387dca2ac22005e0101 Mon Sep 17 00:00:00 2001 From: miloyip Date: Mon, 13 Apr 2015 16:13:39 +0800 Subject: [PATCH] Enable SIMD macros in unit tests --- test/unittest/unittest.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unittest/unittest.h b/test/unittest/unittest.h index 800fbab..87bb083 100644 --- a/test/unittest/unittest.h +++ b/test/unittest/unittest.h @@ -40,6 +40,14 @@ #pragma GCC diagnostic ignored "-Weffc++" #endif +// __SSE2__ and __SSE4_2__ are recognized by gcc, clang, and the Intel compiler. +// We use -march=native with gmake to enable -msse2 and -msse4.2, if supported. +#if defined(__SSE4_2__) +# define RAPIDJSON_SSE42 +#elif defined(__SSE2__) +# define RAPIDJSON_SSE2 +#endif + #include "gtest/gtest.h" #include