Limit declaration of GroupVarint tables to SSE >= 2
authorSara Golemon <sgolemon@fb.com>
Wed, 16 Sep 2015 18:26:52 +0000 (11:26 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Wed, 16 Sep 2015 19:20:18 +0000 (12:20 -0700)
Summary: __m128i is only available in SSE 2 and later.
We technically only use it in folly/GroupVarint.h for SSE 3+,
but that's due to various other intrinsics and we could
potentially lower the requirement in certain contexts,
so do the right thing in the generated table.
Revisit the uses in folly/GroupVarint.h later.

Reviewed By: @yfeldblum

Differential Revision: D2445798

folly/build/generate_varint_tables.py

index 8fe9cd79532d891c6dbe65c2623a5179ccd60c2a..c2c9dbf7432a289de3036f00de86cfff7b9da555 100755 (executable)
@@ -54,7 +54,7 @@ def generate(f):
     f.write("""
 #include <folly/Portability.h>
 
-#if FOLLY_X64 || defined(__i386__)
+#if (FOLLY_X64 || defined(__i386__)) && (FOLLY_SSE >= 2)
 #include <stdint.h>
 #include <x86intrin.h>
 
@@ -98,7 +98,7 @@ extern const __m128i groupVarintSSEMasks[] = {
 
 }  // namespace detail
 }  // namespace folly
-#endif /* FOLLY_X64 || defined(__i386__) */
+#endif /* (FOLLY_X64 || defined(__i386__)) && (FOLLY_SSE >= 2) */
 """)
 
 def main():