Skip to content

Commit

Permalink
Checking for intrisics
Browse files Browse the repository at this point in the history
  • Loading branch information
hivert committed Jan 13, 2018
1 parent fb6a882 commit 94cde3f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ project(HPCombi)
set(DESCRIPTION "High Performance Combinatorics in C++ using vector instructions" CACHE STRING "Project description.")
set(VERSION_MAJOR 0 CACHE STRING "Project major version number.")
set(VERSION_MINOR 0 CACHE STRING "Project minor version number.")
set(VERSION_PATCH 1 CACHE STRING "Project patch version number.")
set(VERSION_PATCH 2 CACHE STRING "Project patch version number.")
mark_as_advanced(VERSION_MAJOR VERSION_MINOR VERSION_PATCH)

message(STATUS "**** Build type = ${CMAKE_BUILD_TYPE}")
Expand Down Expand Up @@ -76,7 +76,7 @@ configure_file(${CMAKE_SOURCE_DIR}/VERSION.in ${CMAKE_BINARY_DIR}/VERSION)
####################
# Install Misc
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION ".")
install (FILES ${CMAKE_SOURCE_DIR}/AUTHORS DESTINATION ".")
install (FILES ${CMAKE_SOURCE_DIR}/README.md DESTINATION ".")
install (FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ".")
install (FILES ${CMAKE_SOURCE_DIR}/list_intrin.txt DESTINATION ".")
###################
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# HPCombi
High Performance Combinatorics in C++ using vector instructions v0.0.1
High Performance Combinatorics in C++ using vector instructions v0.0.2

SSE and AVX insctuction sets allows for very fast permutation manipulation for
vectors or permutations of size smaller than 16. This repo contains some
Expand Down
28 changes: 14 additions & 14 deletions list_intrin.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
_mm_blendv_epi8;{},{},{}
_mm_cmpeq_epi8;{},{}
_mm_cmpestri;{},1,{},1,1
_mm_cmpestrm;{},1,{},1,1
_mm_cmplt_epi8;{},{}
_mm_extract_epi64;{},1
_mm_max_epi8;{},{}
_mm_max_epu8;{},{}
_mm_min_epi8;{},{}
_mm_min_epu8;{},{}
_mm_movemask_epi8;{}
_mm_popcnt_u32;{}
_mm_blendv_epi8;__m128i{},__m128i{},__m128i{}
_mm_cmpeq_epi8;__m128i{},__m128i{}
_mm_cmpestri;__m128i{},1,__m128i{},1,1
_mm_cmpestrm;__m128i{},1,__m128i{},1,1
_mm_cmplt_epi8;__m128i{},__m128i{}
_mm_extract_epi64;__m128i{},1
_mm_max_epi8;__m128i{},__m128i{}
_mm_max_epu8;__m128i{},__m128i{}
_mm_min_epi8;__m128i{},__m128i{}
_mm_min_epu8;__m128i{},__m128i{}
_mm_movemask_epi8;__m128i{}
_mm_popcnt_u32;1
_mm_set_epi64x;1,1
_mm_shuffle_epi8;{},{}
_mm_slli_epi32;{},1
_mm_shuffle_epi8;__m128i{},__m128i{}
_mm_slli_epi32;__m128i{},1
16 changes: 16 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# http://www.gnu.org/licenses/ #
#****************************************************************************#

include(CheckCXXSymbolExists)
include(CheckIncludeFileCXX)
include(CheckCXXSourceCompiles)

check_include_file_cxx("experimental/numeric" HPCOMBI_HAVE_EXPERIMENTAL_NUMERIC)
if (HPCOMBI_HAVE_EXPERIMENTAL_NUMERIC)
check_cxx_source_compiles(
Expand All @@ -36,6 +38,20 @@ check_cxx_source_compiles(
"
HPCOMBI_CONSTEXPR_FUN_ARGS)

check_include_file_cxx("x86intrin.h" HPCOMBI_HAVE_X86INTRIN)
if (NOT ${HPCOMBI_HAVE_X86INTRIN})
message(FATAL_ERROR "No SSE or AVX compiler intrinsics")
endif()
file(READ ${CMAKE_SOURCE_DIR}/list_intrin.txt hpcombi_intrinsics)
string(REPLACE ";" "|" hpcombi_intrinsics "${hpcombi_intrinsics}")
string(REPLACE "\n" ";" hpcombi_intrinsics "${hpcombi_intrinsics}")
foreach (intrin ${hpcombi_intrinsics})
string(REPLACE "|" ";" intrin "${intrin}")
list(GET intrin 0 intrin_name)
check_cxx_symbol_exists("${intrin_name}" "x86intrin.h"
"HPCOMBI_HAVE_${intrin_name}")
endforeach()

set(AUTOGENERATED_WARNING "WARNING: THIS IS A CMAKE AUTO-GENERATED FILE.")

include_directories(${CMAKE_SOURCE_DIR}/include ${PROJECT_BINARY_DIR})
Expand Down

0 comments on commit 94cde3f

Please sign in to comment.