Skip to content

Commit

Permalink
Upgrade libsimdpp to 2.1 (hail-is#4210)
Browse files Browse the repository at this point in the history
* Upgrade libsimdpp to 2.1

* Update vector_popcnt to account for deprecations

* Update gitignore

* Retarget url

* Update prebuilt
  • Loading branch information
chrisvittal authored and Richard Cownie committed Aug 25, 2018
1 parent 29d1ed6 commit 02b7ad0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ python/**/*.pyc
.pytest_cache/
.*.crc
python/hail/docs/_build/*
src/main/c/libsimdpp-2.0-rc2.tar.gz
src/main/c/libsimdpp-2.0-rc2
src/main/c/libsimdpp-2*
src/main/c/headers
src/main/c/lib
target
Expand Down
Binary file modified prebuilt/lib/linux-x86-64/libhail.so
Binary file not shown.
12 changes: 6 additions & 6 deletions src/main/c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ifndef CXX
endif

# append existing flags so they override our flags
CXXFLAGS += -O3 -march=native $(CXXSTD) -Ilibsimdpp-2.0-rc2 -Wall -Werror
CXXFLAGS += -O3 -march=native $(CXXSTD) -Ilibsimdpp-2.1 -Wall -Werror
CXXFLAGS += -fPIC -ggdb -fno-strict-aliasing
CXXFLAGS += -I../resources/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(JAVA_MD)
LIBFLAGS += -fvisibility=default
Expand Down Expand Up @@ -98,13 +98,13 @@ Region.o: headers
# succeed without attempting to access the Internet.
# WGET ?= wget
WGET ?= curl -L -O
libsimdpp-2.0-rc2.tar.gz:
${WGET} https://storage.googleapis.com/hail-common/libsimdpp-2.0-rc2.tar.gz
libsimdpp-2.1.tar.gz:
${WGET} https://storage.googleapis.com/hail-common/$@

libsimdpp-2.0-rc2: libsimdpp-2.0-rc2.tar.gz
tar -xzf libsimdpp-2.0-rc2.tar.gz
libsimdpp-2.1: libsimdpp-2.1.tar.gz
tar -xzf $<

$(shared_library): libsimdpp-2.0-rc2 ${OBJECTS}
$(shared_library): libsimdpp-2.1 ${OBJECTS}
mkdir -p $(dir $(shared_library))
${CXX} ${LIBFLAGS} ${LIBDIRS} ${CXXFLAGS} ${OBJECTS} -o $@

8 changes: 4 additions & 4 deletions src/main/c/ibs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ uint64_t vector_popcnt(uint64vector x) {
count += __builtin_popcountll(extract<1>(x));
#endif
#elif UINT64_VECTOR_SIZE == 4
uint64_t count = __builtin_popcountll(_mm256_extract_epi64(x.operator __m256i(), 0));
count += __builtin_popcountll(_mm256_extract_epi64(x.operator __m256i(), 1));
count += __builtin_popcountll(_mm256_extract_epi64(x.operator __m256i(), 2));
count += __builtin_popcountll(_mm256_extract_epi64(x.operator __m256i(), 3));
uint64_t count = __builtin_popcountll(_mm256_extract_epi64(x.native(), 0));
count += __builtin_popcountll(_mm256_extract_epi64(x.native(), 1));
count += __builtin_popcountll(_mm256_extract_epi64(x.native(), 2));
count += __builtin_popcountll(_mm256_extract_epi64(x.native(), 3));
#else
#error "we do not support vectors longer than 4, please file an issue"
#endif
Expand Down

0 comments on commit 02b7ad0

Please sign in to comment.