You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/11/29 03:36:58 UTC
[arrow] branch master updated: ARROW-3844: [C++] Remove
ARROW_USE_SSE and ARROW_SSE3
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 7800684 ARROW-3844: [C++] Remove ARROW_USE_SSE and ARROW_SSE3
7800684 is described below
commit 780068478a4a3486d878b4849067f56d1ac46f4c
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Wed Nov 28 21:36:50 2018 -0600
ARROW-3844: [C++] Remove ARROW_USE_SSE and ARROW_SSE3
Those options can be detected programmatically (SSE3 and SSE4.2 are available on all recent x86-64 CPUs).
Instead we add a ARROW_USE_SIMD option that can be disabled to exercise non-SIMD fallback paths.
Author: Antoine Pitrou <an...@python.org>
Closes #3037 from pitrou/ARROW-3844-remove-sse-switches and squashes the following commits:
8adb98baf <Antoine Pitrou> ARROW-3844: Remove ARROW_USE_SSE and ARROW_SSE3
---
cpp/CMakeLists.txt | 9 +++------
cpp/cmake_modules/SetupCxxFlags.cmake | 4 ++--
cpp/src/arrow/util/bit-util.h | 5 -----
cpp/src/arrow/util/cpu-info.cc | 2 +-
cpp/src/arrow/util/sse-util.h | 4 ++--
5 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 5cdb804..8436e65 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -190,8 +190,9 @@ Pass multiple labels by dividing with semicolons")
"Build Arrow Fuzzing executables"
OFF)
- option(ARROW_SSE3
- "Build Arrow with SSE3"
+ # Disable this option to exercise non-SIMD fallbacks
+ option(ARROW_USE_SIMD
+ "Build with SIMD optimizations"
ON)
option(ARROW_ALTIVEC
@@ -222,10 +223,6 @@ Pass multiple labels by dividing with semicolons")
"Build the plasma object store java client"
OFF)
- option(ARROW_USE_SSE
- "Build with SSE4 optimizations"
- OFF)
-
option(ARROW_WITH_BROTLI
"Build with Brotli compression"
ON)
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index 6f379f9..d239d69 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -220,8 +220,8 @@ if (CXX_SUPPORTS_ALTIVEC AND ARROW_ALTIVEC)
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -maltivec")
endif()
-if (ARROW_USE_SSE)
- add_definitions(-DARROW_USE_SSE)
+if (ARROW_USE_SIMD)
+ add_definitions(-DARROW_USE_SIMD)
endif()
if (APPLE)
diff --git a/cpp/src/arrow/util/bit-util.h b/cpp/src/arrow/util/bit-util.h
index 0119c1f..cd3d5b0 100644
--- a/cpp/src/arrow/util/bit-util.h
+++ b/cpp/src/arrow/util/bit-util.h
@@ -62,11 +62,6 @@
#include "arrow/util/type_traits.h"
#include "arrow/util/visibility.h"
-#ifdef ARROW_USE_SSE
-#include "arrow/util/cpu-info.h"
-#include "arrow/util/sse-util.h"
-#endif
-
namespace arrow {
class Buffer;
diff --git a/cpp/src/arrow/util/cpu-info.cc b/cpp/src/arrow/util/cpu-info.cc
index 3f34882..514b862 100644
--- a/cpp/src/arrow/util/cpu-info.cc
+++ b/cpp/src/arrow/util/cpu-info.cc
@@ -279,7 +279,7 @@ void CpuInfo::VerifyCpuRequirements() {
}
bool CpuInfo::CanUseSSE4_2() const {
-#ifdef ARROW_USE_SSE
+#ifdef ARROW_USE_SIMD
return IsSupported(CpuInfo::SSE4_2);
#else
return false;
diff --git a/cpp/src/arrow/util/sse-util.h b/cpp/src/arrow/util/sse-util.h
index 0ff1ff3..edaf668 100644
--- a/cpp/src/arrow/util/sse-util.h
+++ b/cpp/src/arrow/util/sse-util.h
@@ -24,6 +24,8 @@
#undef ARROW_HAVE_SSE2
#undef ARROW_HAVE_SSE4_2
+#ifdef ARROW_USE_SIMD
+
// MSVC x86-64
#if (defined(_M_AMD64) || defined(_M_X64))
@@ -44,8 +46,6 @@
#include <nmmintrin.h>
#endif
-#if defined(ARROW_USE_SSE) && !defined(ARROW_HAVE_SSE2)
-#error "ARROW_USE_SSE enabled but no intrinsics available"
#endif
namespace arrow {