3 # check_simd <srcdir> <builddir> <CXXFLAGS>
4 # Read config from $CHECK_SIMD_CONFIG file or $target_list
6 scriptdir
="$(cd "${0%/*}" && pwd)"
10 testdir
="$builddir/testsuite"
12 CXX
="$("$builddir/scripts
/testsuite_flags
" --build-cxx)"
13 CXXFLAGS
="$("$builddir/scripts
/testsuite_flags
" --cxxflags) $1 -Wno-psabi"
15 INCLUDES
="$("$builddir/scripts
/testsuite_flags
" --build-includes)"
17 target_triplet
=$
($CXX -dumpmachine)
23 eval "$name=\"flags=\\\"$flags\\\"
27 if [ -f "$CHECK_SIMD_CONFIG" ]; then
28 .
"$CHECK_SIMD_CONFIG"
29 elif [ -z "$CHECK_SIMD_CONFIG" ]; then
30 if [ -z "$target_list" ]; then
32 case "$target_triplet" in
33 x86_64-
*) target_list
="unix/-march=native" ;;
34 i?
86-*) target_list
="unix/-march=native" ;;
35 powerpc64le-
*) target_list
="unix/-mcpu=power8" ;;
36 aarch64-
*) target_list
="unix/-mcpu=cortex-a53" ;;
37 arm-
*) target_list
="unix/-mcpu=cortex-a7" ;;
41 echo "Error: File not found: \$CHECK_SIMD_CONFIG='$CHECK_SIMD_CONFIG'" 1>&2
45 # define unix with no flags and no simulator:
50 # expand a{b,c} to a/b a/c
51 while [ "${list#*\{}" != "${list}" ]; do
52 list
="$(echo "$list" | \
53 sed -e 's#\([^ ]\+\){\([^{},]*\),\([^{}]*\)}\(/[^ ]*\)\?#\1/\2\4 \1{\3}\4#g' \
54 -e 's#{\([^{},]*\)}#/\1#g' \
55 -e 's#/ # #g' -e 's#/$##')"
58 # per a/b/c block extract flags and simulator, then make check-simd
59 while [ ${#list} -gt 0 ]; do
61 if [ "$a" = "$list" ]; then
68 flags
="${flags}$(echo "${a#${b}}"|sed 's#/# #g')"
69 subdir
="simd/$(echo "$flags" | sed 's#[= /-]##g')"
70 rm -f "${subdir}/Makefile"
71 $srcdir/testsuite
/experimental
/simd
/generate_makefile.sh \
72 --destination="$testdir/$subdir" --sim="$sim" --testflags="$flags" \
73 $CXX $INCLUDES $CXXFLAGS -static-libgcc -static-libstdc++