1 // Copyright 2018 The Abseil Authors.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // https://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 // Shared config probing for SSE instructions used in Swiss tables.
16 #ifndef ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_
17 #define ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_
19 #ifndef SWISSTABLE_HAVE_SSE2
20 #if defined(__SSE2__) || \
21 (defined(_MSC_VER) && \
22 (defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2)))
23 #define SWISSTABLE_HAVE_SSE2 1
25 #define SWISSTABLE_HAVE_SSE2 0
29 #ifndef SWISSTABLE_HAVE_SSSE3
31 #define SWISSTABLE_HAVE_SSSE3 1
33 #define SWISSTABLE_HAVE_SSSE3 0
37 #if SWISSTABLE_HAVE_SSSE3 && !SWISSTABLE_HAVE_SSE2
38 #error "Bad configuration!"
41 #if SWISSTABLE_HAVE_SSE2
42 #include <emmintrin.h>
45 #if SWISSTABLE_HAVE_SSSE3
46 #include <tmmintrin.h>
49 #endif // ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_