Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

IQ-TREE for ARM NEON #212

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,48 @@ build/
/GTAGS
/.dir-locals.el
/iqtree_config.h
eigen/*
CPackConfig.cmake
CPackSourceConfig.cmake
Makefile
alignment/CMakeFiles/
alignment/Makefile
alignment/cmake_install.cmake
cmake_utils/neon_test_build/*
example
gsl/CmakeFiles/
gsl/Makefile
gsl/cmake_install.cmake
lbfgsb/CMakeFiles/
lbfgsb/Makefile
lbfgsb/cmake_install.cmake
model/CMakeFiles/
model/cmake_install.cmake
model/Makefile
ncl/CMakeFiles/
ncl/cmake_install.cmake
ncl/Makefile
nclextra/CMakeFiles/
nclextra/cmake_install.cmake
nclextra/Makefile
neon_test_build
pda/CMakeFiles/
pda/cmake_install.cmake
pda/Makefile
sprng/CMakeFiles/
sprng/cmake_install.cmake
sprng/Makefile
tree/CMakeFiles/
tree/cmake_install.cmake
tree/Makefile
cmake_install.cmake
utils/CMakeFiles/
utils/cmake_install.cmake
utils/Makefile
vectorclass/CMakeFiles/
vectorclass/cmake_install.cmake
vectorclass/Makefile
whtest/CMakeFiles/
whtest/cmake_install.cmake
whtest/Makefile
includelog
45 changes: 39 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ endif()

include_directories("${PROJECT_SOURCE_DIR}")

# Check if __ARM_NEON is defined
include(cmake_utls/check_neon_exists.cmake)
if (NEON)
set (__ARM_NEON "TRUE")
message("__ARM_NEON DETECTED : TRUE")
else()
message("__ARM_NEON DETECTED : FALSE")
endif()

##################################################################
# Detect target platforms
##################################################################
Expand Down Expand Up @@ -120,7 +129,11 @@ set(CLANG "FALSE") # Clang compiler
set(ICC "FALSE") # Intel compiler
set(VCC "FALSE") # MS Visual C Compiler, note that it is different from MSVC variable
# using C++11 standard
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated")
# disable AVX for NEON
if (__ARM_NEON)
set(IQTREE_FLAGS "${IQTREE_FLAGS} novx")
endif()

if (CMAKE_COMPILER_IS_GNUCXX)
message("Compiler : GNU Compiler (gcc)")
Expand Down Expand Up @@ -306,9 +319,17 @@ SET(AVX_FLAGS "-D__SSE3 -D__AVX")
if (VCC)
set(AVX_FLAGS "${AVX_FLAGS} /arch:AVX")
elseif (CLANG)
set(AVX_FLAGS "${AVX_FLAGS} -mavx")
if (__ARM_NEON)
set(AVX_FLAGS "${AVX_FLAGS} -march=armv8-a+fp+simd+crypto+crc")
else()
set(AVX_FLAGS "${AVX_FLAGS} -mavx")
endif()
elseif (GCC)
set(AVX_FLAGS "${AVX_FLAGS} -mavx -fabi-version=0")
if (__ARM_NEON)
set(AVX_FLAGS "${AVX_FLAGS} -march=armv8-a+fp+simd+crypto+crc") #-mavx -fabi-version=0")
else()
set(AVX_FLAGS "${AVX_FLAGS} -mavx -fabi-version=0")
endif()
elseif (ICC)
if (WIN32)
set(AVX_FLAGS "${AVX_FLAGS} /arch:avx")
Expand All @@ -321,7 +342,11 @@ SET(SSE_FLAGS "-D__SSE3")
if (VCC)
set(SSE_FLAGS "${SSE_FLAGS} /arch:SSE2 -D__SSE3__")
elseif (GCC OR CLANG)
set(SSE_FLAGS "${SSE_FLAGS} -msse3")
if (__ARM_NEON)
set(SSE_FLAGS "${SSE_FLAGS} -march=armv8-a+fp+simd+crypto+crc") # changed from -msse3
else()
set(SSE_FLAGS "${SSE_FLAGS} -msse3")
endif()
elseif (ICC)
if (WIN32)
set(SSE_FLAGS "${SSE_FLAGS} /arch:sse3")
Expand All @@ -334,9 +359,17 @@ SET(FMA_FLAGS "-D__SSE3 -D__AVX")
if (VCC)
set(FMA_FLAGS "${FMA_FLAGS} /arch:AVX2")
elseif (CLANG)
set(FMA_FLAGS "${FMA_FLAGS} -mavx -mfma")
if (__ARM_NEON)
set(FMA_FLAGS "${FMA_FLAGS} -march=armv8-a+fp+simd+crypto+crc") #-mavx -mfma")
else()
set(FMA_FLAGS "${FMA_FLAGS} -mavx -mfma")
endif()
elseif (GCC)
set(FMA_FLAGS "${FMA_FLAGS} -mavx -fabi-version=0 -mfma")
if (__ARM_NEON)
set(FMA_FLAGS "${FMA_FLAGS} -march=armv8-a+fp+simd+crypto+crc") #-mavx -fabi-version=0 -mfma")
else()
set(FMA_FLAGS "${FMA_FLAGS} -mavx -fabi-version=0 -mfma")
endif()
elseif (ICC)
if (WIN32)
set(FMA_FLAGS "${FMA_FLAGS} /arch:core-avx2")
Expand Down
17 changes: 17 additions & 0 deletions cmake_utls/check_neon_exists.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 2.8.12)

if (DEFINED NEON)
return()
endif()

set(NEON 0)

enable_language(C)
enable_language(CXX)

try_compile(test_for_neon_worked ${PROJECT_BINARY_DIR}/neon_test_build ${CMAKE_CURRENT_LIST_DIR}/test_for_neon
neon_test)

if(test_for_neon_worked)
set(NEON 1)
endif()
4 changes: 4 additions & 0 deletions cmake_utls/test_for_neon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)

project(neon_test)
add_library(neon_test STATIC neon_test.cpp)
5 changes: 5 additions & 0 deletions cmake_utls/test_for_neon/neon_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifdef __ARM_NEON
#else
#error "No NEON"
#endif
int main(){}
18,852 changes: 0 additions & 18,852 deletions example/example.cf

This file was deleted.

9 changes: 0 additions & 9 deletions example/example.nex

This file was deleted.

18 changes: 0 additions & 18 deletions example/example.phy

This file was deleted.

955 changes: 0 additions & 955 deletions example/models.nex

This file was deleted.

33 changes: 33 additions & 0 deletions intrinsics
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
_mm_andnot_pd’ was not declared in this scope;
_mm_and_pd’ was not declared in this scope;
_mm_blendv_pd’ was not declared in this scope;
_mm_blendv_ps’ was not declared in this scope;
_mm_castpd_ps’ was not declared in this scope;
_mm_castpd_si128’ was not declared in this scope;
_mm_castps_pd’ was not declared in this scope;
_mm_castsi128_pd’ was not declared in this scope;
_mm_cmpeq_pd’ was not declared in this scope;
_mm_cmple_pd’ was not declared in this scope;
_mm_cmplt_pd’ was not declared in this scope;
_mm_cmpneq_pd’ was not declared in this scope;
_mm_cvtepi32_pd’ was not declared in this scope;
_mm_cvtpd_epi32’ was not declared in this scope;
_mm_cvtpd_ps’ was not declared in this scope;
_mm_cvtps_pd’ was not declared in this scope;
_mm_cvtsd_f64’ was not declared in this scope;
_mm_cvttpd_epi32’ was not declared in this scope;
_mm_div_pd’ was not declared in this scope;
_mm_getcsr’ was not declared in this scope;
_mm_hadd_pd’ was not declared in this scope;
_mm_movemask_pd’ was not declared in this scope;
_mm_mulhi_epu16’ was not declared in this scope;
_mm_mul_pd’ was not declared in this scope;
_mm_or_pd’ was not declared in this scope;
_mm_setcsr’ was not declared in this scope;
_mm_setr_pd’ was not declared in this scope;
_mm_set_sd’ was not declared in this scope;
_mm_setzero_pd’ was not declared in this scope;
_mm_shuffle_pd’ was not declared in this scope;
_mm_store_sd’ was not declared in this scope;
_mm_testc_si128’ was not declared in this scope;
_mm_testz_si128’ was not declared in this scope;
Empty file added lib/.!14422!libiomp5md.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!14423!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36032 `
Binary file added lib/.!14424!libompstatic.a
Binary file not shown.
Empty file added lib/.!14425!pthreadGC2.dll
Empty file.
Empty file added lib/.!14426!pthreadGC2_64.dll
Empty file.
Empty file added lib/.!14427!pthreadVC2.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!14428!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338093862 0 7120 `
Empty file added lib/.!2826!libiomp5md.dll
Empty file.
Empty file added lib/.!2826!libiomp5md.dllr
Empty file.
2 changes: 2 additions & 0 deletions lib/.!2827!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36032 `
2 changes: 2 additions & 0 deletions lib/.!2827!libomp.ar
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36032 `
Binary file added lib/.!2828!libompstatic.a
Binary file not shown.
Binary file added lib/.!2828!libompstatic.ar
Binary file not shown.
Empty file added lib/.!2829!pthreadGC2.dll
Empty file.
Empty file added lib/.!2829!pthreadGC2.dllr
Empty file.
Empty file added lib/.!2830!pthreadGC2_64.dll
Empty file.
Empty file added lib/.!2830!pthreadGC2_64.dllr
Empty file.
Empty file added lib/.!2831!pthreadVC2.dll
Empty file.
Empty file added lib/.!2831!pthreadVC2.dllr
Empty file.
2 changes: 2 additions & 0 deletions lib/.!2832!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338093862 0 7120 `
2 changes: 2 additions & 0 deletions lib/.!2832!pthreadVC2.libr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338093862 0 7120 `
Empty file added lib/.!6100!libiomp5md.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!6101!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36032 `
Binary file added lib/.!6102!libompstatic.a
Binary file not shown.
Empty file added lib/.!6103!pthreadGC2.dll
Empty file.
Empty file added lib/.!6104!pthreadGC2_64.dll
Empty file.
Empty file added lib/.!6105!pthreadVC2.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!6106!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338093862 0 7120 `
Empty file added lib/.!7279!libiomp5md.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!7280!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36032 `
Binary file added lib/.!7281!libompstatic.a
Binary file not shown.
Empty file added lib/.!7282!pthreadGC2.dll
Empty file.
Empty file added lib/.!7283!pthreadGC2_64.dll
Empty file.
Empty file added lib/.!7284!pthreadVC2.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!7285!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338093862 0 7120 `
Empty file added lib/.!9636!libiomp5md.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!9637!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36032 `
Binary file added lib/.!9638!libompstatic.a
Binary file not shown.
Empty file added lib/.!9639!pthreadGC2.dll
Empty file.
Empty file added lib/.!9640!pthreadGC2_64.dll
Empty file.
Empty file added lib/.!9641!pthreadVC2.dll
Empty file.
2 changes: 2 additions & 0 deletions lib/.!9642!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338093862 0 7120 `
Empty file added lib32/.!14473!libiomp5md.dll
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!14475!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36018 `
Empty file added lib32/.!14476!pthreadVC2.dll
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!14477!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338046565 0 7360 `
Empty file added lib32/.!2833!libiomp5md.dll
Empty file.
Empty file added lib32/.!2833!libiomp5md.dllr
Empty file.
Empty file added lib32/.!2834!libiomp5md.lib.dll
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!2835!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36018 `
2 changes: 2 additions & 0 deletions lib32/.!2835!libomp.ar
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36018 `
Empty file added lib32/.!2836!pthreadVC2.dll
Empty file.
Empty file added lib32/.!2836!pthreadVC2.dllr
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!2837!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338046565 0 7360 `
2 changes: 2 additions & 0 deletions lib32/.!2837!pthreadVC2.libr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338046565 0 7360 `
Empty file added lib32/.!6112!libiomp5md.dll
Empty file.
Empty file added lib32/.!6113!libiomp5md.lib.dll
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!6114!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36018 `
Empty file added lib32/.!6115!pthreadVC2.dll
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!6116!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338046565 0 7360 `
Empty file added lib32/.!7301!libiomp5md.dll
Empty file.
Empty file added lib32/.!7302!libiomp5md.lib.dll
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!7303!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 0 0 0 0 36018 `
Empty file added lib32/.!7304!pthreadVC2.dll
Empty file.
2 changes: 2 additions & 0 deletions lib32/.!7305!pthreadVC2.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
/ 1338046565 0 7360 `
2 changes: 2 additions & 0 deletions libmac/.!14485!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
#1/20 1530061535 502 20 100644 39820 `
2 changes: 2 additions & 0 deletions libmac/.!2838!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
#1/20 1530061535 502 20 100644 39820 `
2 changes: 2 additions & 0 deletions libmac/.!2838!libomp.ar
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
#1/20 1530061535 502 20 100644 39820 `
2 changes: 2 additions & 0 deletions libmac/.!6118!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
#1/20 1530061535 502 20 100644 39820 `
2 changes: 2 additions & 0 deletions libmac/.!7309!libomp.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!<arch>
#1/20 1530061535 502 20 100644 39820 `
Loading