Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- windows-2019
include:
- os: windows-2019
name: Windows 2019
name: Windows 2019 x64
generator: Visual Studio 16 2019
platform: x64
- os: windows-2019
name: Windows 2019 Win32
generator: Visual Studio 16 2019
platform: Win32
env:
ARROW_BOOST_USE_SHARED: OFF
ARROW_BUILD_BENCHMARKS: ON
Expand All @@ -222,7 +225,7 @@ jobs:
ARROW_WITH_ZLIB: ON
ARROW_WITH_ZSTD: ON
BOOST_SOURCE: BUNDLED
CMAKE_ARGS: '-A x64 -DOPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64'
CMAKE_ARGS: '-A ${{ matrix.platform }} -DOPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64'
CMAKE_GENERATOR: ${{ matrix.generator }}
CMAKE_INSTALL_LIBDIR: bin
CMAKE_INSTALL_PREFIX: /usr
Expand Down
14 changes: 10 additions & 4 deletions cpp/src/arrow/util/bit_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ static constexpr uint8_t kBytePopcount[] = {
5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6,
4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8};

static inline uint64_t PopCount(uint64_t bitmap) { return ARROW_POPCOUNT64(bitmap); }
static inline uint64_t PopCount(uint64_t bitmap) {
#if defined(_MSC_VER) && !defined(_M_AMD64) && !defined(_M_X64)
return ARROW_POPCOUNT32((bitmap >> 32) & UINT32_MAX) + ARROW_POPCOUNT32(bitmap & UINT32_MAX);
#else
return ARROW_POPCOUNT64(bitmap);
#endif
}
static inline uint32_t PopCount(uint32_t bitmap) { return ARROW_POPCOUNT32(bitmap); }

//
Expand Down Expand Up @@ -199,7 +205,7 @@ static inline int CountLeadingZeros(uint64_t value) {
#if defined(__clang__) || defined(__GNUC__)
if (value == 0) return 64;
return static_cast<int>(__builtin_clzll(value));
#elif defined(_MSC_VER)
#elif defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_X64))
unsigned long index; // NOLINT
if (_BitScanReverse64(&index, value)) { // NOLINT
return 63 - static_cast<int>(index);
Expand Down Expand Up @@ -245,7 +251,7 @@ static inline int CountTrailingZeros(uint64_t value) {
#if defined(__clang__) || defined(__GNUC__)
if (value == 0) return 64;
return static_cast<int>(__builtin_ctzll(value));
#elif defined(_MSC_VER)
#elif defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_X64))
unsigned long index; // NOLINT
if (_BitScanForward64(&index, value)) {
return static_cast<int>(index);
Expand All @@ -255,7 +261,7 @@ static inline int CountTrailingZeros(uint64_t value) {
#else
int bitpos = 0;
if (value) {
while (value & 1 == 0) {
while ((value & 1) == 0) {
value >>= 1;
++bitpos;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/util/io_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ Status MemoryAdviseWillNeed(const std::vector<MemoryRegion>& regions) {
PrefetchEntry(const MemoryRegion& region) // NOLINT runtime/explicit
: VirtualAddress(region.addr), NumberOfBytes(region.size) {}
};
using PrefetchVirtualMemoryFunc = BOOL (*)(HANDLE, ULONG_PTR, PrefetchEntry*, ULONG);
using PrefetchVirtualMemoryFunc = BOOL (__stdcall *)(HANDLE, ULONG_PTR, PrefetchEntry*, ULONG);
static const auto prefetch_virtual_memory = reinterpret_cast<PrefetchVirtualMemoryFunc>(
GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "PrefetchVirtualMemory"));
if (prefetch_virtual_memory != nullptr) {
Expand Down