diff options
author | Bassam Tabbara <bassam@symform.com> | 2016-09-06 23:48:39 -0700 |
---|---|---|
committer | Bassam Tabbara <bassam@symform.com> | 2016-09-13 12:25:00 -0700 |
commit | ad11042132c7db78e8ae57a364c37df74572e8b6 (patch) | |
tree | 351db6b0ab5b08fc0ce0c4421fde5de26c0f3337 /tools | |
parent | 4339569f14c95a8895a347845f8ed6e18b345ace (diff) | |
download | gf-complete-ad11042132c7db78e8ae57a364c37df74572e8b6.tar.gz |
Simplify SIMD make scripts
ax_ext.m4 no longer performs any CPU checks. Instead it just checks
if the the compile supports SIMD flags.
Runtime detection will choose the right methods base on CPU
instructions available.
Intel AVX support is still done through the build since it would
require a major refactoring of the code base to support it at runtime.
For now I added a configuration flag --enable-avx that can be used
to compile with AVX support.
Also use cpu intrinsics instead of __asm__
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.am | 2 | ||||
-rwxr-xr-x | tools/test_simd.sh | 12 | ||||
-rwxr-xr-x | tools/test_simd_qemu.sh | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am index a9dd8b9..4ca9131 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,7 +1,7 @@ # GF-Complete 'tools' AM file AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -AM_CFLAGS = -O3 $(SIMD_FLAGS) -fPIC +AM_CFLAGS = -O3 -fPIC bin_PROGRAMS = gf_mult gf_div gf_add gf_time gf_methods gf_poly gf_inline_time diff --git a/tools/test_simd.sh b/tools/test_simd.sh index 1b0e319..6401590 100755 --- a/tools/test_simd.sh +++ b/tools/test_simd.sh @@ -27,6 +27,16 @@ test_functions() { return ${failed} } +# build with DEBUG_CPU_FUNCTIONS and print out CPU detection +test_detection() { + failed=0 + + { ./configure && make clean && make CFLAGS="-DDEBUG_CPU_DETECTION"; } || { echo "Compile FAILED" >> ${results}; return 1; } + { ${script_dir}/gf_methods 32 -ACD -L | grep '#' >> ${results}; } || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); } + + return ${failed} +} + compile_arm() { failed=0 @@ -167,7 +177,7 @@ runtime_intel_flags() { { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); } done - echo "====SSE2 support..." >> ${1} + echo "====SSE2 support..." >> ${1} export ax_cv_have_sse_ext=no export ax_cv_have_sse2_ext=yes export ax_cv_have_sse3_ext=no diff --git a/tools/test_simd_qemu.sh b/tools/test_simd_qemu.sh index 7b2cb1c..5771874 100755 --- a/tools/test_simd_qemu.sh +++ b/tools/test_simd_qemu.sh @@ -224,6 +224,8 @@ run_test_simd_basic() { { run_test $arch $cpu "unit" && echo "SUCCESS"; } || { echo "FAILED"; ((++failed)); } echo "=====running functions test" { run_test $arch $cpu "functions" && echo "SUCCESS"; } || { echo "FAILED"; ((++failed)); } + echo "=====running detection test" + { run_test $arch $cpu "detection" && echo "SUCCESS"; } || { echo "FAILED"; ((++failed)); } echo "=====running runtime test" { run_test $arch $cpu "runtime" && echo "SUCCESS"; } || { echo "FAILED"; ((++failed)); } stop_qemu |