Commit 4c12379d authored by Xiao Shi's avatar Xiao Shi Committed by Facebook Github Bot

separate out F14_VECTOR_INTRINSICS_AVAILABLE check

Summary:
This check is useful for other platforms and in other context where F14 is
included. For the sake of fast compilation, separate this macro out so that one
doesn't have to pull in the entire F14Map/Set headers to use this macro.

Reviewed By: yfeldblum

Differential Revision: D7300144

fbshipit-source-id: d1aeb7e3c5d2f15703dd356fc54622751e3fa71a
parent faed3cec
......@@ -59,6 +59,7 @@ nobase_follyinclude_HEADERS = \
container/Access.h \
container/Array.h \
container/detail/BitIteratorDetail.h \
container/detail/F14IntrinsicsAvailability.h \
container/detail/F14Memory.h \
container/detail/F14Policy.h \
container/detail/F14Table.h \
......
/*
* Copyright 2018-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <folly/Portability.h>
// clang-format off
// F14 is only available on x86 with SSE2 intrinsics (so far)
#ifndef FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
# if FOLLY_SSE >= 2
# define FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE 1
# else
# define FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE 0
# pragma message \
"Vector intrinsics unavailable on this platform, " \
"falling back to std::unordered_map / set"
# endif
#endif
// clang-format on
......@@ -42,22 +42,9 @@
#include <folly/portability/Builtins.h>
#include <folly/portability/TypeTraits.h>
#include <folly/container/detail/F14IntrinsicsAvailability.h>
#include <folly/container/detail/F14Memory.h>
// clang-format off
// F14 is only available on x86 with SSE2 intrinsics (so far)
#ifndef FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
# if FOLLY_SSE >= 2
# define FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE 1
# else
# define FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE 0
# pragma message \
"Vector intrinsics unavailable on this platform, " \
"falling back to std::unordered_map / set"
# endif
#endif
// clang-format on
#if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
#include <immintrin.h> // __m128i intrinsics
#include <xmmintrin.h> // _mm_prefetch
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment