Skip to content

Commit 4d421be

Browse files
authored
Merge pull request #35 from lemire/dlemire/add_windows_arm_checks
Adding ARM checks under Windows.
2 parents 1a4ac1c + 890b60d commit 4d421be

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/vs16-arm-ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: VS16-ARM-CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
ci:
7+
name: windows-vs16
8+
runs-on: windows-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- {arch: ARM}
14+
- {arch: ARM64}
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v2
18+
- name: Use cmake
19+
run: |
20+
cmake -A ${{ matrix.arch }} -DCMAKE_CROSSCOMPILING=1 -DFASTFLOAT_TEST=ON -B build &&
21+
cmake --build build --verbose

include/ewah/ewahutil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static inline uint32_t ctz16(uint16_t n) {
155155
inline uint32_t countOnes(uint32_t x) {
156156
return static_cast<uint32_t>(__builtin_popcount(x));
157157
}
158-
#elif defined(_MSC_VER) && _MSC_VER >= 1400
158+
#elif defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_M_ARM)&& !defined(_M_ARM64)
159159
inline uint32_t countOnes(uint32_t x) { return __popcnt(x); }
160160
#else
161161
inline uint32_t countOnes(uint32_t v) {
@@ -173,7 +173,7 @@ inline uint32_t countOnes(uint32_t v) {
173173
inline uint32_t countOnes(uint64_t x) {
174174
return static_cast<uint32_t>(__builtin_popcountll(x));
175175
}
176-
#elif defined(_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1400
176+
#elif defined(_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_M_ARM64)
177177
inline uint32_t countOnes(uint64_t x) {
178178
return static_cast<uint32_t>(__popcnt64(static_cast<__int64>(x)));
179179
}

0 commit comments

Comments
 (0)