Fix wrong SSE version (#1330)
Summary:
For some reasons, I only allow my compiler (gcc 10.0.1) to use x86 SSE, SSE2 and SSE3 instructions. When I compile, I get the following error:
```
In file included from /opt/1A/toolchain/x86_64-v20.0.12/lib/gcc/x86_64-1a-linux-gnu/10.0.1/include/smmintrin.h:32,
from /opt/1A/toolchain/x86_64-v20.0.12/lib/gcc/x86_64-1a-linux-gnu/10.0.1/include/nmmintrin.h:31,
from /home/docker/opensource/folly/folly/GroupVarint.h:43,
from /home/docker/opensource/folly/folly/test/GroupVarintTest.cpp:17:
/home/docker/opensource/folly/folly/GroupVarint.h: In function 'folly::GroupVarint<unsigned int>::decode(char const*, unsigned int*, unsigned int*, unsigned int*, unsigned int*)':
/opt/1A/toolchain/x86_64-v20.0.12/lib/gcc/x86_64-1a-linux-gnu/10.0.1/include/tmmintrin.h:136:1: error: inlining failed in call to 'always_inline' '_mm_shuffle_epi8(long long __vector(2), long long __vector(2))': target specific option mismatch
136 | _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
| ^~~~~~~~~~~~~~~~
```
After some searches, it seems the requested instructions are defined in SSE4.1 as we can see in `nmmintrin.h`:
```
#ifndef _NMMINTRIN_H_INCLUDED
#define _NMMINTRIN_H_INCLUDED
/* We just include SSE4.1 header file. */
#include <smmintrin.h>
#endif /* _NMMINTRIN_H_INCLUDED */
```
This PR fix the code accordingly.
Pull Request resolved: https://github.com/facebook/folly/pull/1330
Reviewed By: Orvid
Differential Revision: D20323400
Pulled By: yfeldblum
fbshipit-source-id: 9913cc5eb378d180403094589b852d45e70978bc
Showing
Please register or sign in to comment