From patchwork Wed Jan 27 20:41:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwWJ2fjyz9sS8 for ; Thu, 28 Jan 2021 07:41:48 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 52B0A398B814; Wed, 27 Jan 2021 20:41:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id D20E23894C3E; Wed, 27 Jan 2021 20:41:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D20E23894C3E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id AD0862050D05; Wed, 27 Jan 2021 21:41:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id U_OIuXpfDaLx; Wed, 27 Jan 2021 21:41:38 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 8DD932050D00; Wed, 27 Jan 2021 21:41:38 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:41:38 +0100 From: Matthias Kretz To: , Subject: [PATCH 01/16] Support skip, only, expensive, and xfail markers Date: Wed, 27 Jan 2021 21:41:37 +0100 Message-ID: <7036910.unVi0tRuQf@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex4.Campus.gsi.de (10.10.4.36) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: Implement skip, only, expensive, and xfail markers. They can select on type, ABI tag subset number, target-triplet, and compiler flags. * testsuite/experimental/simd/generate_makefile.sh: The summary now includes lines for unexpected passes and expected failures. If the skip or only markers are only conditional on the type, do not generate rules for those types. * testsuite/experimental/simd/tests/abs.cc: Mark test expensive for ABI tag subsets 1-9. * testsuite/experimental/simd/tests/algorithms.cc: Ditto. * testsuite/experimental/simd/tests/broadcast.cc: Ditto. * testsuite/experimental/simd/tests/casts.cc: Ditto. * testsuite/experimental/simd/tests/generator.cc: Ditto. * testsuite/experimental/simd/tests/integer_operators.cc: Ditto. * testsuite/experimental/simd/tests/loadstore.cc: Ditto. * testsuite/experimental/simd/tests/mask_broadcast.cc: Ditto. * testsuite/experimental/simd/tests/mask_conversions.cc: Ditto. * testsuite/experimental/simd/tests/mask_implicit_cvt.cc: Ditto. * testsuite/experimental/simd/tests/mask_loadstore.cc: Ditto. * testsuite/experimental/simd/tests/mask_operator_cvt.cc: Ditto. * testsuite/experimental/simd/tests/mask_operators.cc: Ditto. * testsuite/experimental/simd/tests/mask_reductions.cc: Ditto. * testsuite/experimental/simd/tests/operator_cvt.cc: Ditto. * testsuite/experimental/simd/tests/operators.cc: Ditto. * testsuite/experimental/simd/tests/reductions.cc: Ditto. * testsuite/experimental/simd/tests/simd.cc: Ditto. * testsuite/experimental/simd/tests/split_concat.cc: Ditto. * testsuite/experimental/simd/tests/splits.cc: Ditto. * testsuite/experimental/simd/tests/where.cc: Ditto. * testsuite/experimental/simd/tests/fpclassify.cc: Ditto. In addition replace "test only floattypes" marker by unconditional "float|double|ldouble" only marker. * testsuite/experimental/simd/tests/frexp.cc: Ditto. * testsuite/experimental/simd/tests/hypot3_fma.cc: Ditto. * testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc: Ditto. * testsuite/experimental/simd/tests/logarithm.cc: Ditto. * testsuite/experimental/simd/tests/math_1arg.cc: Ditto. * testsuite/experimental/simd/tests/math_2arg.cc: Ditto. * testsuite/experimental/simd/tests/remqo.cc: Ditto. * testsuite/experimental/simd/tests/trigonometric.cc: Ditto. * testsuite/experimental/simd/tests/trunc_ceil_floor.cc: Ditto. * testsuite/experimental/simd/tests/sincos.cc: Ditto. In addition, xfail on run because the reference data is missing. --- .../testsuite/experimental/simd/driver.sh | 114 +++++++++++++--- .../experimental/simd/generate_makefile.sh | 122 ++++++++++++------ .../testsuite/experimental/simd/tests/abs.cc | 1 + .../experimental/simd/tests/algorithms.cc | 1 + .../experimental/simd/tests/broadcast.cc | 1 + .../experimental/simd/tests/casts.cc | 1 + .../experimental/simd/tests/fpclassify.cc | 3 +- .../experimental/simd/tests/frexp.cc | 3 +- .../experimental/simd/tests/generator.cc | 1 + .../experimental/simd/tests/hypot3_fma.cc | 3 +- .../simd/tests/integer_operators.cc | 1 + .../simd/tests/ldexp_scalbn_scalbln_modf.cc | 3 +- .../experimental/simd/tests/loadstore.cc | 1 + .../experimental/simd/tests/logarithm.cc | 3 +- .../experimental/simd/tests/mask_broadcast.cc | 1 + .../simd/tests/mask_conversions.cc | 1 + .../simd/tests/mask_implicit_cvt.cc | 1 + .../experimental/simd/tests/mask_loadstore.cc | 1 + .../simd/tests/mask_operator_cvt.cc | 1 + .../experimental/simd/tests/mask_operators.cc | 1 + .../simd/tests/mask_reductions.cc | 1 + .../experimental/simd/tests/math_1arg.cc | 3 +- .../experimental/simd/tests/math_2arg.cc | 3 +- .../experimental/simd/tests/operator_cvt.cc | 1 + .../experimental/simd/tests/operators.cc | 1 + .../experimental/simd/tests/reductions.cc | 1 + .../experimental/simd/tests/remqo.cc | 3 +- .../testsuite/experimental/simd/tests/simd.cc | 1 + .../experimental/simd/tests/sincos.cc | 4 +- .../experimental/simd/tests/split_concat.cc | 1 + .../experimental/simd/tests/splits.cc | 1 + .../experimental/simd/tests/trigonometric.cc | 3 +- .../simd/tests/trunc_ceil_floor.cc | 3 +- .../experimental/simd/tests/where.cc | 1 + 34 files changed, 225 insertions(+), 66 deletions(-) -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de std::experimental::simd https://github.com/VcDevel/std-simd ────────────────────────────────────────────────────────────────────────── diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++-v3/testsuite/experimental/simd/driver.sh index aabef316f47..84f3829c2d4 100755 --- a/libstdc++-v3/testsuite/experimental/simd/driver.sh +++ b/libstdc++-v3/testsuite/experimental/simd/driver.sh @@ -138,28 +138,38 @@ if [ -n "$only" ]; then fi if [ $abi -eq 0 ]; then - abi="" + abiflag="" elif [ $abi -gt 0 -a $abi -lt 10 ]; then - abi="-DEXTENDEDTESTS=$((abi-1))" + abiflag="-DEXTENDEDTESTS=$((abi-1))" else echo "Error: The -a argument must be a value between 0 and 9 (inclusive)." >&2 exit 1 fi fail() { - echo "FAIL: $src $type $abi ($*)" | tee -a "$sum" "$log" + echo "FAIL: $src $type $abiflag ($*)" | tee -a "$sum" "$log" +} + +xpass() { + echo "XPASS: $src $type $abiflag ($*)" | tee -a "$sum" "$log" +} + +xfail() { + $quiet || echo "XFAIL: $src $type $abiflag ($*)" + echo "XFAIL: $src $type $abiflag ($*)" >> "$sum" + echo "XFAIL: $src $type $abiflag ($*)" >> "$log" } pass() { - $quiet || echo "PASS: $src $type $abi ($*)" - echo "PASS: $src $type $abi ($*)" >> "$sum" - echo "PASS: $src $type $abi ($*)" >> "$log" + $quiet || echo "PASS: $src $type $abiflag ($*)" + echo "PASS: $src $type $abiflag ($*)" >> "$sum" + echo "PASS: $src $type $abiflag ($*)" >> "$log" } unsupported() { - $quiet || echo "UNSUPPORTED: $src $type $abi ($*)" - echo "UNSUPPORTED: $src $type $abi ($*)" >> "$sum" - echo "UNSUPPORTED: $src $type $abi ($*)" >> "$log" + $quiet || echo "UNSUPPORTED: $src $type $abiflag ($*)" + echo "UNSUPPORTED: $src $type $abiflag ($*)" >> "$sum" + echo "UNSUPPORTED: $src $type $abiflag ($*)" >> "$log" } verify_compilation() { @@ -173,6 +183,8 @@ verify_compilation() { elif ! $quiet; then grep -i 'warning:' "$log" | head -n5 fi + elif [ "$xfail" = "compile" ]; then + xpass "test for excess errors" else pass "test for excess errors" fi @@ -181,7 +193,12 @@ verify_compilation() { fail "timeout: test for excess errors" else errors=$(grep -ic 'error:' "$log") - fail "excess errors:" $errors + if [ "$xfail" = "compile" ]; then + xfail "excess errors:" $errors + exit 0 + else + fail "excess errors:" $errors + fi fi if $verbose; then cat "$log" @@ -196,11 +213,18 @@ verify_test() { failed=$1 if [ $failed -eq 0 ]; then rm "$exe" - pass "execution test" + if [ "$xfail" = "run" ]; then + xpass "execution test" + else + pass "execution test" + fi else $keep_failed || rm "$exe" if [ $failed -eq 124 ]; then fail "timeout: execution test" + elif [ "$xfail" = "run" ]; then + xfail "execution test" + exit 0 else fail "execution test" fi @@ -225,16 +249,74 @@ write_log_and_verbose() { fi } +matches() { + eval "case '$1' in + $2) return 0;; esac" + return 1 +} + +test_selector() { + string="$1" + pat_type="${string%% *}" + if matches "$shorttype" "$pat_type"; then + string="${string#* }" + pat_abi="${string%% *}" + if matches "$abi" "$pat_abi"; then + string="${string#* }" + pat_triplet="${string%% *}" + [ -z "$target_triplet" ] && target_triplet=$($CXX -dumpmachine) + if matches "$target_triplet" "$pat_triplet"; then + pat_flags="${string#* }" + if matches "$CXXFLAGS" "$pat_flags"; then + return 0 + fi + fi + fi + fi + return 1 +} + rm -f "$log" "$sum" touch "$log" "$sum" -if ! $run_expensive && [ -n "$abi" ]; then - unsupported "skip expensive tests" - exit 0 +skip="$(head -n25 "$src" | grep '^//\s*skip: ')" +if [ -n "$skip" ]; then + skip="$(echo "$skip" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" + if test_selector "$skip"; then + # silently skip this test + exit 0 + fi +fi +only="$(head -n25 "$src" | grep '^//\s*only: ')" +if [ -n "$only" ]; then + only="$(echo "$only" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" + if ! test_selector "$only"; then + # silently skip this test + exit 0 + fi +fi +if ! $run_expensive; then + expensive="$(head -n25 "$src" | grep '^//\s*expensive: ')" + if [ -n "$expensive" ]; then + expensive="$(echo "$expensive" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" + if test_selector "$expensive"; then + unsupported "skip expensive tests" + exit 0 + fi + fi +fi +xfail="$(head -n25 "$src" | grep '^//\s*xfail: ')" +if [ -n "$xfail" ]; then + xfail="$(echo "$xfail" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" + if test_selector "${xfail#* }"; then + xfail="${xfail%% *}" + else + unset xfail + fi fi -write_log_and_verbose "$CXX $src $@ -D_GLIBCXX_SIMD_TESTTYPE=$type $abi -o $exe" -timeout $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abi -o "$exe" >> "$log" 2>&1 +write_log_and_verbose "$CXX $src $@ -D_GLIBCXX_SIMD_TESTTYPE=$type $abiflag -o $exe" +timeout $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abiflag -o "$exe" >> "$log" 2>&1 verify_compilation $? if [ -n "$sim" ]; then write_log_and_verbose "$sim ./$exe" diff --git a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh index ab5970554c3..553bc98f60b 100755 --- a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh +++ b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh @@ -99,53 +99,97 @@ all: simd_testsuite.sum simd_testsuite.sum: simd_testsuite.log @printf "\n\t\t=== simd_testsuite \$(TESTFLAGS) Summary ===\n\n"\\ "# of expected passes:\t\t\$(shell grep -c '^PASS:' \$@)\n"\\ + "# of unexpected passes:\t\t\$(shell grep -c '^XPASS:' \$@)\n"\\ "# of unexpected failures:\t\$(shell grep -c '^FAIL:' \$@)\n"\\ + "# of expected failures:\t\t\$(shell grep -c '^XFAIL:' \$@)\n"\\ "# of unsupported tests:\t\t\$(shell grep -c '^UNSUPPORTED:' \$@)\n"\\ | tee -a \$@ EOF +matches() { + eval "case '$1' in + $2) return 0;; esac" + return 1 +} + +cxx_type() { + case "$1" in + ldouble) echo "long double";; + ullong) echo "unsigned long long";; + ulong) echo "unsigned long";; + llong) echo "long long";; + uint) echo "unsigned int";; + ushort) echo "unsigned short";; + uchar) echo "unsigned char";; + schar) echo "signed char";; + *) echo "$1";; + esac +} + +filter_types() { + only="$1" + skip="$2" + shift 2 + if [ -z "$only" -a -z "$skip" ]; then + for x in "$@"; do + cxx_type "$x" + echo "$x" + done + elif [ -z "$skip" ]; then + for x in "$@"; do + if matches "$x" "$only"; then + cxx_type "$x" + echo "$x" + fi + done + elif [ -z "$only" ]; then + for x in "$@"; do + matches "$x" "$skip" && continue + cxx_type "$x" + echo "$x" + done + else + for x in "$@"; do + matches "$x" "$skip" && continue + if matches "$x" "$only"; then + cxx_type "$x" + echo "$x" + fi + done + fi +} + all_types() { src="$1" - cat <. +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include // abs & sqrt diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc b/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc index 78bce35f59c..0762686d5e8 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/algorithms.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc b/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc index c107de3380b..6060ade8e7a 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/broadcast.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc b/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc index df169e100de..49d56009081 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/casts.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/conversions.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc b/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc index eef26108f5f..b367073168a 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/fpclassify.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc b/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc index e2d90dd1e3f..028ca80a71a 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/frexp.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc b/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc index 221064dc476..f4780de38b2 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/generator.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc b/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc index 0c8e55983a2..689a90c10a5 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc b/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc index 975e69a9e35..21380c4e13e 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc b/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc index 6d994572bf8..c867d365f39 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc b/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc index 994227c7d5a..dd7d6c30e8c 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/conversions.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc b/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc index 29c686db697..2065d1cd7ac 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/logarithm.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/mathreference.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc index 7fc8201caf6..494b582633c 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_broadcast.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc index 8cec912250a..a44753adf9a 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_conversions.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" namespace stdx = std::experimental; diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc index e1760e3f37f..562be4b3293 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_implicit_cvt.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc index 0f43428b7c6..0590d7a16d0 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_loadstore.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" // simd_mask generator functions diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc index 738b97c3dca..ab08a047e8c 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operator_cvt.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc index 58255cf1e1b..ce4b61f8a4d 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_operators.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc index 1190eaf5457..be1ed9fd742 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/mask_reductions.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc b/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc index bce01264f3c..441b3406a22 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/math_1arg.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc b/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc index 57b7b3aeb5c..018328de6cb 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/math_2arg.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc index a04cd34e3d4..1836af56f1b 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc b/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc index cee696cc69b..27fdbbb01f9 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/operators.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc index 6f4ba40133f..9d897d5ccd6 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc b/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc index bdbacc6ef8e..0a666b2c329 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/remqo.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc b/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc index 657646c0ac5..5f30a43a6e5 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/simd.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" template diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc b/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc index acef488e214..bcf6c738f19 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/sincos.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,9 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// xfail: run * * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/mathreference.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc b/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc index 3a79a1f8e3d..477221f515a 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/split_concat.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/conversions.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc b/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc index 8b61635c2a6..5c662b00121 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/splits.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" template diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc b/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc index 24730f1856c..f8b1d2a45ec 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/trigonometric.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" #include "bits/test_values.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc b/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc index e516926ae1d..2dbc89364e7 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/trunc_ceil_floor.cc @@ -1,4 +1,3 @@ -// test only floattypes // Copyright (C) 2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// only: float|double|ldouble * * * +// expensive: * [1-9] * * #include "bits/test_values.h" #include "bits/verify.h" diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/where.cc b/libstdc++-v3/testsuite/experimental/simd/tests/where.cc index 5e73a3b1989..5eab176ba4c 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/where.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/where.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// expensive: * [1-9] * * #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/metahelpers.h" From patchwork Wed Jan 27 20:41:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwWX022Rz9sS8 for ; Thu, 28 Jan 2021 07:41:59 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 10A0E398B893; Wed, 27 Jan 2021 20:41:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id D244F398B87F; Wed, 27 Jan 2021 20:41:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D244F398B87F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 055A22050D05; Wed, 27 Jan 2021 21:41:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id D3Nsi3KTsh3w; Wed, 27 Jan 2021 21:41:44 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id E07002050D00; Wed, 27 Jan 2021 21:41:44 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:41:44 +0100 From: Matthias Kretz To: , Subject: [PATCH 02/16] Fix NEON intrinsic types usage Date: Wed, 27 Jan 2021 21:41:44 +0100 Message-ID: <5803344.vAW0rqQIy0@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex3.Campus.gsi.de (10.10.4.16) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz Intrinsics types for NEON differ from gnu::vector_size types now. This requires explicit specializations for __intrinsic_type and a new __is_intrinsic_type trait. libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (__is_intrinsic_type): New internal type trait. Alias for __is_vector_type on x86. (_VectorTraitsImpl): Enable for __intrinsic_type in addition for __vector_type. (__intrin_bitcast): Allow casting to & from vector & intrinsic types. (__intrinsic_type): Explicitly specialize for NEON intrinsic vector types. --- libstdc++-v3/include/experimental/bits/simd.h | 70 +++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) using type = _Tp; using value_type = remove_reference_t()[0])>; @@ -1457,7 +1479,8 @@ template _GLIBCXX_SIMD_INTRINSIC constexpr _To __intrin_bitcast(_From __v) { - static_assert(__is_vector_type_v<_From> && __is_vector_type_v<_To>); + static_assert((__is_vector_type_v<_From> || __is_intrinsic_type_v<_From>) + && (__is_vector_type_v<_To> || __is_intrinsic_type_v<_To>)); if constexpr (sizeof(_To) == sizeof(_From)) return reinterpret_cast<_To>(__v); else if constexpr (sizeof(_From) > sizeof(_To)) @@ -2183,16 +2206,55 @@ template #endif // _GLIBCXX_SIMD_HAVE_SSE_ABI // __intrinsic_type (ARM){{{ #if _GLIBCXX_SIMD_HAVE_NEON +template <> + struct __intrinsic_type + { using type = float32x2_t; }; + +template <> + struct __intrinsic_type + { using type = float32x4_t; }; + +#if _GLIBCXX_SIMD_HAVE_NEON_A64 +template <> + struct __intrinsic_type + { using type = float64x1_t; }; + +template <> + struct __intrinsic_type + { using type = float64x2_t; }; +#endif + +#define _GLIBCXX_SIMD_ARM_INTRIN(_Bits, _Np) \ +template <> \ + struct __intrinsic_type<__int_with_sizeof_t<_Bits / 8>, \ + _Np * _Bits / 8, void> \ + { using type = int##_Bits##x##_Np##_t; }; \ +template <> \ + struct __intrinsic_type>, \ + _Np * _Bits / 8, void> \ + { using type = uint##_Bits##x##_Np##_t; } +_GLIBCXX_SIMD_ARM_INTRIN(8, 8); +_GLIBCXX_SIMD_ARM_INTRIN(8, 16); +_GLIBCXX_SIMD_ARM_INTRIN(16, 4); +_GLIBCXX_SIMD_ARM_INTRIN(16, 8); +_GLIBCXX_SIMD_ARM_INTRIN(32, 2); +_GLIBCXX_SIMD_ARM_INTRIN(32, 4); +_GLIBCXX_SIMD_ARM_INTRIN(64, 1); +_GLIBCXX_SIMD_ARM_INTRIN(64, 2); +#undef _GLIBCXX_SIMD_ARM_INTRIN + template struct __intrinsic_type<_Tp, _Bytes, enable_if_t<__is_vectorizable_v<_Tp> && _Bytes <= 16>> { - static constexpr int _S_VBytes = _Bytes <= 8 ? 8 : 16; + static constexpr int _SVecBytes = _Bytes <= 8 ? 8 : 16; using _Ip = __int_for_sizeof_t<_Tp>; using _Up = conditional_t< is_floating_point_v<_Tp>, _Tp, conditional_t, make_unsigned_t<_Ip>, _Ip>>; - using type [[__gnu__::__vector_size__(_S_VBytes)]] = _Up; + static_assert(!is_same_v<_Tp, _Up> || _SVecBytes != _Bytes, + "should use explicit specialization above"); + using type = typename __intrinsic_type<_Up, _SVecBytes>::type; }; #endif // _GLIBCXX_SIMD_HAVE_NEON diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/ include/experimental/bits/simd.h index 00eec50d64f..d56176210df 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -1379,13 +1379,35 @@ template template inline constexpr bool __is_vector_type_v = __is_vector_type<_Tp>::value; +// }}} +// __is_intrinsic_type {{{ +#if _GLIBCXX_SIMD_HAVE_SSE_ABI +template + using __is_intrinsic_type = __is_vector_type<_Tp>; +#else // not SSE (x86) +template > + struct __is_intrinsic_type : false_type {}; + +template + struct __is_intrinsic_type< + _Tp, void_t()[0])>, sizeof(_Tp)>::type>> + : is_same<_Tp, typename __intrinsic_type< + remove_reference_t()[0])>, + sizeof(_Tp)>::type> {}; +#endif + +template + inline constexpr bool __is_intrinsic_type_v = __is_intrinsic_type<_Tp>::value; + // }}} // _VectorTraits{{{ template > struct _VectorTraitsImpl; template - struct _VectorTraitsImpl<_Tp, enable_if_t<__is_vector_type_v<_Tp>>> + struct _VectorTraitsImpl<_Tp, enable_if_t<__is_vector_type_v<_Tp> + || __is_intrinsic_type_v<_Tp>>> { From patchwork Wed Jan 27 20:42:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwWl5K04z9sSs for ; Thu, 28 Jan 2021 07:42:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54990398B89C; Wed, 27 Jan 2021 20:42:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 4087438930F1; Wed, 27 Jan 2021 20:42:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4087438930F1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 676B82050D05; Wed, 27 Jan 2021 21:42:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WFAyXllQQulN; Wed, 27 Jan 2021 21:42:01 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 4F0372050D00; Wed, 27 Jan 2021 21:42:01 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:00 +0100 From: Matthias Kretz To: , Subject: [PATCH 03/16] Support -mlong-double-64 on PPC Date: Wed, 27 Jan 2021 21:42:00 +0100 Message-ID: <7614121.znU0eCzeS4@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex1.Campus.gsi.de (10.10.4.11) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Let __intrinsic_type be valid if sizeof(long double) == sizeof(double) and use a __vector double as member type. --- libstdc++-v3/include/experimental/bits/simd.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/ include/experimental/bits/simd.h index d56176210df..64cf8d32328 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -2285,7 +2285,9 @@ template struct __intrinsic_type<_Tp, _Bytes, enable_if_t<__is_vectorizable_v<_Tp> && _Bytes <= 16>> { - static_assert(!is_same_v<_Tp, long double>, + static constexpr bool _S_is_ldouble = is_same_v<_Tp, long double>; + // allow _Tp == long double with -mlong-double-64 + static_assert(!(_S_is_ldouble && sizeof(long double) > sizeof(double)), "no __intrinsic_type support for long double on PPC"); #ifndef __VSX__ static_assert(!is_same_v<_Tp, double>, @@ -2297,8 +2299,11 @@ template "no __intrinsic_type support for integers larger than 4 Bytes " "on PPC w/o POWER8 vectors"); #endif - using type = typename __intrinsic_type_impl, _Tp, __int_for_sizeof_t<_Tp>>>::type; + using type = + typename __intrinsic_type_impl< + conditional_t, + conditional_t<_S_is_ldouble, double, _Tp>, + __int_for_sizeof_t<_Tp>>>::type; }; #endif // __ALTIVEC__ From patchwork Wed Jan 27 20:42:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwWs4Kpgz9sS8 for ; Thu, 28 Jan 2021 07:42:17 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2344398B89B; Wed, 27 Jan 2021 20:42:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 92AF638930F1; Wed, 27 Jan 2021 20:42:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92AF638930F1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id B48EB2050D08; Wed, 27 Jan 2021 21:42:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VvgLpvvouqMy; Wed, 27 Jan 2021 21:42:03 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 9C6632050D00; Wed, 27 Jan 2021 21:42:03 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:03 +0100 From: Matthias Kretz To: , Subject: [PATCH 04/16] Fix simd_mask on POWER w/o POWER8 Date: Wed, 27 Jan 2021 21:42:03 +0100 Message-ID: <9754798.ERE229jn0y@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex3.Campus.gsi.de (10.10.4.16) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Remove unnecessary static assertion. Allow sizeof(8) integer __intrinsic_type to enable the necessary mask type. --- libstdc++-v3/include/experimental/bits/simd.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/ include/experimental/bits/simd.h index 64cf8d32328..9685df0be9e 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -2292,12 +2292,6 @@ template #ifndef __VSX__ static_assert(!is_same_v<_Tp, double>, "no __intrinsic_type support for double on PPC w/o VSX"); -#endif -#ifndef __POWER8_VECTOR__ - static_assert( - !(is_integral_v<_Tp> && sizeof(_Tp) > 4), - "no __intrinsic_type support for integers larger than 4 Bytes " - "on PPC w/o POWER8 vectors"); #endif using type = typename __intrinsic_type_impl< From patchwork Wed Jan 27 20:42:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwX24MVfz9sS8 for ; Thu, 28 Jan 2021 07:42:26 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BEA95398B8A9; Wed, 27 Jan 2021 20:42:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id B96AD398B88E; Wed, 27 Jan 2021 20:42:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B96AD398B88E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id E04FA2050D05; Wed, 27 Jan 2021 21:42:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id z2rP6r0bKlvW; Wed, 27 Jan 2021 21:42:09 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id C4FC02050D00; Wed, 27 Jan 2021 21:42:09 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:09 +0100 From: Matthias Kretz To: , Subject: [PATCH 05/16] Fix several check-simd interaction issues Date: Wed, 27 Jan 2021 21:42:09 +0100 Message-ID: <6973196.SbB2uZ23bb@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex1.Campus.gsi.de (10.10.4.11) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh (verify_test): Print test output on run xfail. Do not repeat lines from the log that were already printed on stdout. (test_selector): Make the compiler flags pattern usable as a substring selector. (toplevel): Trap on SIGINT and remove the log and sum files. Call timout with --foreground to quickly terminate on SIGINT. * testsuite/experimental/simd/generate_makefile.sh: Simplify run targets via target patterns. Default DRIVEROPTS to -v for run targets. Remove log and sum files after completion of the run target (so that it's always recompiled). Place help text into text file for reasonable 'make help' performance. --- .../testsuite/experimental/simd/driver.sh | 16 +++-- .../experimental/simd/generate_makefile.sh | 70 +++++++++---------- 2 files changed, 44 insertions(+), 42 deletions(-) -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de std::experimental::simd https://github.com/VcDevel/std-simd ────────────────────────────────────────────────────────────────────────── diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++-v3/testsuite/experimental/simd/driver.sh index 84f3829c2d4..cf07ff9ad85 100755 --- a/libstdc++-v3/testsuite/experimental/simd/driver.sh +++ b/libstdc++-v3/testsuite/experimental/simd/driver.sh @@ -224,16 +224,17 @@ verify_test() { fail "timeout: execution test" elif [ "$xfail" = "run" ]; then xfail "execution test" - exit 0 else fail "execution test" fi if $verbose; then - if [ $(cat "$log"|wc -l) -gt 1000 ]; then + lines=$(wc -l < "$log") + lines=$((lines-3)) + if [ $lines -gt 1000 ]; then echo "[...]" tail -n1000 "$log" else - cat "$log" + tail -n$lines "$log" fi elif ! $quiet; then grep -i fail "$log" | head -n5 @@ -267,7 +268,7 @@ test_selector() { [ -z "$target_triplet" ] && target_triplet=$($CXX -dumpmachine) if matches "$target_triplet" "$pat_triplet"; then pat_flags="${string#* }" - if matches "$CXXFLAGS" "$pat_flags"; then + if matches "$CXXFLAGS" "*$pat_flags*"; then return 0 fi fi @@ -276,6 +277,7 @@ test_selector() { return 1 } +trap "rm -f '$log' '$sum'; exit" INT rm -f "$log" "$sum" touch "$log" "$sum" @@ -316,15 +318,15 @@ if [ -n "$xfail" ]; then fi write_log_and_verbose "$CXX $src $@ -D_GLIBCXX_SIMD_TESTTYPE=$type $abiflag -o $exe" -timeout $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abiflag -o "$exe" >> "$log" 2>&1 +timeout --foreground $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abiflag -o "$exe" >> "$log" 2>&1 verify_compilation $? if [ -n "$sim" ]; then write_log_and_verbose "$sim ./$exe" - timeout $timeout $sim "./$exe" >> "$log" 2>&1 <&- + timeout --foreground $timeout $sim "./$exe" >> "$log" 2>&1 <&- else write_log_and_verbose "./$exe" timeout=$(awk "BEGIN { print int($timeout / 2) }") - timeout $timeout "./$exe" >> "$log" 2>&1 <&- + timeout --foreground $timeout "./$exe" >> "$log" 2>&1 <&- fi verify_test $? diff --git a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh index 553bc98f60b..8d642a2941a 100755 --- a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh +++ b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh @@ -240,7 +240,7 @@ EOF %-$type.log: %-$type-0.log %-$type-1.log %-$type-2.log %-$type-3.log \ %-$type-4.log %-$type-5.log %-$type-6.log %-$type-7.log \ %-$type-8.log %-$type-9.log - @cat $^ > \$@ + @cat \$^ > \$@ @cat \$(^:log=sum) > \$(@:log=sum)${rmline} EOF @@ -252,47 +252,47 @@ EOF EOF done done - echo 'run-%: export GCC_TEST_RUN_EXPENSIVE=yes' - all_tests | while read file && read name; do - echo "run-$name: $name.log" - all_types "$file" | while read t && read type; do - echo "run-$name-$type: $name-$type.log" - for i in $(seq 0 9); do - echo "run-$name-$type-$i: $name-$type-$i.log" - done - done - echo - done cat < to pass the following options:\n"\\ - "-q, --quiet Only print failures.\n"\\ - "-v, --verbose Print compiler and test output on failure.\n"\\ - "-k, --keep-failed Keep executables of failed tests.\n"\\ - "--sim Path to an executable that is prepended to the test\n"\\ - " execution binary (default: the value of\n"\\ - " GCC_TEST_SIMULATOR).\n"\\ - "--timeout-factor \n"\\ - " Multiply the default timeout with x.\n"\\ - "--run-expensive Compile and run tests marked as expensive (default:\n"\\ - " true if GCC_TEST_RUN_EXPENSIVE is set, false otherwise).\n"\\ - "--only Compile and run only tests matching the given pattern.\n\n" - @echo "use TESTFLAGS= to pass additional compiler flags" - @echo - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all" - @echo "... clean" - @echo "... help" +run-%: export GCC_TEST_RUN_EXPENSIVE=yes +run-%: DRIVEROPTS=-v +run-%: %.log + @rm \$^ \$(^:log=sum) + +help: .make_help.txt + @cat \$< + +EOF + dsthelp="${dst%Makefile}.make_help.txt" + cat < "$dsthelp" +use DRIVEROPTS= to pass the following options: +-q, --quiet Only print failures. +-v, --verbose Print compiler and test output on failure. +-k, --keep-failed Keep executables of failed tests. +--sim Path to an executable that is prepended to the test + execution binary (default: the value of + GCC_TEST_SIMULATOR). +--timeout-factor + Multiply the default timeout with x. +--run-expensive Compile and run tests marked as expensive (default: + true if GCC_TEST_RUN_EXPENSIVE is set, false otherwise). +--only Compile and run only tests matching the given pattern. + +use TESTFLAGS= to pass additional compiler flags + +The following are some of the valid targets for this Makefile: +... all +... clean +... help" EOF all_tests | while read file && read name; do - printf "\t@echo '... run-${name}'\n" + echo "... run-${name}" all_types | while read t && read type; do - printf "\t@echo '... run-${name}-${type}'\n" + echo "... run-${name}-${type}" for i in $(seq 0 9); do - printf "\t@echo '... run-${name}-${type}-$i'\n" + echo "... run-${name}-${type}-$i" done done - done + done >> "$dsthelp" cat < X-Patchwork-Id: 1432357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwXB6pVhz9sS8 for ; Thu, 28 Jan 2021 07:42:34 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F11B398B8BB; Wed, 27 Jan 2021 20:42:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id D6AE6398B8B2; Wed, 27 Jan 2021 20:42:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D6AE6398B8B2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 09DC62050D05; Wed, 27 Jan 2021 21:42:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZDdil4OTbKUw; Wed, 27 Jan 2021 21:42:13 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id E5B612050D00; Wed, 27 Jan 2021 21:42:13 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:13 +0100 From: Matthias Kretz To: , Subject: [PATCH 06/16] Fix DRIVEROPTS and TESTFLAGS processing Date: Wed, 27 Jan 2021 21:42:13 +0100 Message-ID: <9312568.6WO6ZSibLh@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex4.Campus.gsi.de (10.10.4.36) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/generate_makefile.sh: Use different variables internally than documented for user overrides. This makes internal append/prepend work as intended. --- .../testsuite/experimental/simd/generate_makefile.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh b/ libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh index 8d642a2941a..4fb710c7767 100755 --- a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh +++ b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh @@ -85,19 +85,20 @@ CXX="$1" shift echo "TESTFLAGS ?=" > "$dst" -[ -n "$testflags" ] && echo "TESTFLAGS := $testflags \$(TESTFLAGS)" >> "$dst" -echo CXXFLAGS = "$@" "\$(TESTFLAGS)" >> "$dst" +echo "test_flags := $testflags \$(TESTFLAGS)" >> "$dst" +echo CXXFLAGS = "$@" "\$(test_flags)" >> "$dst" [ -n "$sim" ] && echo "export GCC_TEST_SIMULATOR = $sim" >> "$dst" cat >> "$dst" < X-Patchwork-Id: 1432358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwXM2G09z9sS8 for ; Thu, 28 Jan 2021 07:42:43 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 81910398BC04; Wed, 27 Jan 2021 20:42:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 87257398BC04; Wed, 27 Jan 2021 20:42:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 87257398BC04 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id AE4032050D05; Wed, 27 Jan 2021 21:42:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DAxkrlO4wF3L; Wed, 27 Jan 2021 21:42:17 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 96D922050D00; Wed, 27 Jan 2021 21:42:17 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:17 +0100 From: Matthias Kretz To: , Subject: [PATCH 07/16] Fix incorrect display of old test summaries Date: Wed, 27 Jan 2021 21:42:17 +0100 Message-ID: <5767243.eMUbO1HJkO@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex1.Campus.gsi.de (10.10.4.11) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/Makefile.am: Ensure .simd.summary is empty before collecting a new summary. * testsuite/Makefile.in: Regenerate. --- libstdc++-v3/testsuite/Makefile.am | 1 + libstdc++-v3/testsuite/Makefile.in | 1 + 2 files changed, 2 insertions(+) while read subdir; do \ $(MAKE) -C "$${subdir}"; \ diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/ Makefile.am index 5dd109b40c9..2d3ad481dba 100644 --- a/libstdc++-v3/testsuite/Makefile.am +++ b/libstdc++-v3/testsuite/Makefile.am @@ -191,6 +191,7 @@ check-simd: $(srcdir)/experimental/simd/ generate_makefile.sh \ ${glibcxx_srcdir}/scripts/check_simd \ testsuite_files_simd \ ${glibcxx_builddir}/scripts/testsuite_flags + @rm -f .simd.summary ${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "$ {glibcxx_builddir}" "$(CXXFLAGS)" | \ while read subdir; do \ $(MAKE) -C "$${subdir}"; \ diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/ Makefile.in index 3900d6d87b4..ac6207ae75c 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -716,6 +716,7 @@ check-simd: $(srcdir)/experimental/simd/ generate_makefile.sh \ ${glibcxx_srcdir}/scripts/check_simd \ testsuite_files_simd \ ${glibcxx_builddir}/scripts/testsuite_flags + @rm -f .simd.summary ${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "$ {glibcxx_builddir}" "$(CXXFLAGS)" | \ From patchwork Wed Jan 27 20:42:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwXW6MYKz9sS8 for ; Thu, 28 Jan 2021 07:42:51 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4EFC2398B8B8; Wed, 27 Jan 2021 20:42:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 11EE0398B86D; Wed, 27 Jan 2021 20:42:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 11EE0398B86D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 38F6F2050D05; Wed, 27 Jan 2021 21:42:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iZCa9-ehOhiv; Wed, 27 Jan 2021 21:42:24 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 1EC232050D00; Wed, 27 Jan 2021 21:42:24 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:23 +0100 From: Matthias Kretz To: , Subject: [PATCH 08/16] Immediate feedback with -v Date: Wed, 27 Jan 2021 21:42:23 +0100 Message-ID: <37658268.xCRyjBS7g1@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex3.Campus.gsi.de (10.10.4.16) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: Remove executable on SIGINT. Process compiler and test executable output: In verbose mode print messages immediately, limited to 1000 lines and breaking long lines to below $COLUMNS (or 1024 if not set). Communicating the exit status of the compiler / test with the necessary pipe is done via a message through stdout/-in. --- .../testsuite/experimental/simd/driver.sh | 194 +++++++++++------- 1 file changed, 116 insertions(+), 78 deletions(-) -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de std::experimental::simd https://github.com/VcDevel/std-simd ────────────────────────────────────────────────────────────────────────── diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++-v3/testsuite/experimental/simd/driver.sh index cf07ff9ad85..314c6a16f86 100755 --- a/libstdc++-v3/testsuite/experimental/simd/driver.sh +++ b/libstdc++-v3/testsuite/experimental/simd/driver.sh @@ -172,81 +172,14 @@ unsupported() { echo "UNSUPPORTED: $src $type $abiflag ($*)" >> "$log" } -verify_compilation() { - failed=$1 - if [ $failed -eq 0 ]; then - warnings=$(grep -ic 'warning:' "$log") - if [ $warnings -gt 0 ]; then - fail "excess warnings:" $warnings - if $verbose; then - cat "$log" - elif ! $quiet; then - grep -i 'warning:' "$log" | head -n5 - fi - elif [ "$xfail" = "compile" ]; then - xpass "test for excess errors" - else - pass "test for excess errors" - fi - else - if [ $failed -eq 124 ]; then - fail "timeout: test for excess errors" - else - errors=$(grep -ic 'error:' "$log") - if [ "$xfail" = "compile" ]; then - xfail "excess errors:" $errors - exit 0 - else - fail "excess errors:" $errors - fi - fi - if $verbose; then - cat "$log" - elif ! $quiet; then - grep -i 'error:' "$log" | head -n5 - fi - exit 0 - fi -} - -verify_test() { - failed=$1 - if [ $failed -eq 0 ]; then - rm "$exe" - if [ "$xfail" = "run" ]; then - xpass "execution test" - else - pass "execution test" - fi - else - $keep_failed || rm "$exe" - if [ $failed -eq 124 ]; then - fail "timeout: execution test" - elif [ "$xfail" = "run" ]; then - xfail "execution test" - else - fail "execution test" - fi - if $verbose; then - lines=$(wc -l < "$log") - lines=$((lines-3)) - if [ $lines -gt 1000 ]; then - echo "[...]" - tail -n1000 "$log" - else - tail -n$lines "$log" - fi - elif ! $quiet; then - grep -i fail "$log" | head -n5 - fi - exit 0 - fi -} - write_log_and_verbose() { echo "$*" >> "$log" if $verbose; then - echo "$*" + if [ -z "$COLUMNS" ] || ! type fmt>/dev/null; then + echo "$*" + else + echo "$*" | fmt -w $COLUMNS -s - || cat + fi fi } @@ -277,7 +210,7 @@ test_selector() { return 1 } -trap "rm -f '$log' '$sum'; exit" INT +trap "rm -f '$log' '$sum' $exe; exit" INT rm -f "$log" "$sum" touch "$log" "$sum" @@ -317,17 +250,122 @@ if [ -n "$xfail" ]; then fi fi +log_output() { + if $verbose; then + maxcol=${1:-1024} + awk " +BEGIN { count = 0 } +/^###exitstatus### [0-9]+$/ { exit \$2 } +{ + print >> \"$log\" + if (count >= 1000) next + ++count + if (length(\$0) > $maxcol) { + i = 1 + while (i + $maxcol <= length(\$0)) { + len = $maxcol + line = substr(\$0, i, len) + len = match(line, / [^ ]*$/) + if (len <= 0) { + len = match(substr(\$0, i), / [^ ]/) + if (len <= 0) len = $maxcol + } + print substr(\$0, i, len) + i += len + } + print substr(\$0, i) + } else { + print + } +} +END { close(\"$log\") } +" + else + awk " +/^###exitstatus### [0-9]+$/ { exit \$2 } +{ print >> \"$log\" } +END { close(\"$log\") } +" + fi +} + +verify_compilation() { + log_output $COLUMNS + exitstatus=$? + if [ $exitstatus -eq 0 ]; then + warnings=$(grep -ic 'warning:' "$log") + if [ $warnings -gt 0 ]; then + fail "excess warnings:" $warnings + if ! $verbose && ! $quiet; then + grep -i 'warning:' "$log" | head -n5 + fi + elif [ "$xfail" = "compile" ]; then + xpass "test for excess errors" + else + pass "test for excess errors" + fi + return 0 + else + if [ $exitstatus -eq 124 ]; then + fail "timeout: test for excess errors" + else + errors=$(grep -ic 'error:' "$log") + if [ "$xfail" = "compile" ]; then + xfail "excess errors:" $errors + exit 0 + else + fail "excess errors:" $errors + fi + fi + if ! $verbose && ! $quiet; then + grep -i 'error:' "$log" | head -n5 + fi + return 1 + fi +} + +verify_test() { + log_output $COLUMNS + exitstatus=$? + if [ $exitstatus -eq 0 ]; then + if [ "$xfail" = "run" ]; then + $keep_failed || rm "$exe" + xpass "execution test" + else + rm "$exe" + pass "execution test" + fi + return 0 + else + $keep_failed || rm "$exe" + if ! $verbose && ! $quiet; then + grep -i fail "$log" | head -n5 + fi + if [ $exitstatus -eq 124 ]; then + fail "timeout: execution test" + elif [ "$xfail" = "run" ]; then + xfail "execution test" + else + fail "execution test" + fi + return 1 + fi +} + write_log_and_verbose "$CXX $src $@ -D_GLIBCXX_SIMD_TESTTYPE=$type $abiflag -o $exe" -timeout --foreground $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abiflag -o "$exe" >> "$log" 2>&1 -verify_compilation $? +{ + timeout --foreground $timeout "$CXX" "$src" "$@" "-D_GLIBCXX_SIMD_TESTTYPE=$type" $abiflag -o "$exe" 2>&1 <&- + printf "###exitstatus### %d\n" $? +} | verify_compilation || exit 0 if [ -n "$sim" ]; then write_log_and_verbose "$sim ./$exe" - timeout --foreground $timeout $sim "./$exe" >> "$log" 2>&1 <&- else write_log_and_verbose "./$exe" timeout=$(awk "BEGIN { print int($timeout / 2) }") - timeout --foreground $timeout "./$exe" >> "$log" 2>&1 <&- fi -verify_test $? +{ + timeout --foreground $timeout $sim "./$exe" 2>&1 <&- + printf "###exitstatus### %d\n" $? +} | verify_test || exit 0 # vim: sw=2 et cc=81 si From patchwork Wed Jan 27 20:42:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwXm1mYtz9sS8 for ; Thu, 28 Jan 2021 07:43:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F56F398BC12; Wed, 27 Jan 2021 20:42:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id CAFAD398B85A; Wed, 27 Jan 2021 20:42:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CAFAD398B85A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id F1F0B2050D05; Wed, 27 Jan 2021 21:42:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Rq7uK_sPYUhj; Wed, 27 Jan 2021 21:42:27 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id D93942050D00; Wed, 27 Jan 2021 21:42:27 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:27 +0100 From: Matthias Kretz To: , Subject: [PATCH 09/16] Fix mask reduction of simd_mask on POWER7 Date: Wed, 27 Jan 2021 21:42:27 +0100 Message-ID: <51484814.jc7mZyZMxp@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex3.Campus.gsi.de (10.10.4.16) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz POWER7 does not support __vector long long reductions, making the generic _S_popcount implementation ill-formed. Specializing _S_popcount for PPC allows optimization and avoids the issue. libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Add __have_power10vec conditional on _ARCH_PWR10. * include/experimental/bits/simd_builtin.h: Forward declare _MaskImplPpc and use it as _MaskImpl when __ALTIVEC__ is defined. (_MaskImplBuiltin::_S_some_of): Call _S_popcount from the _SuperImpl for optimizations and correctness. * include/experimental/bits/simd_ppc.h: Add _MaskImplPpc. (_MaskImplPpc::_S_popcount): Implement via vec_cntm for POWER10. Otherwise, for >=int use -vec_sums divided by a sizeof factor. For struct _MaskImplX86; template struct _SimdImplNeon; template struct _MaskImplNeon; template struct _SimdImplPpc; +template struct _MaskImplPpc; // simd_abi::_VecBuiltin {{{ template @@ -959,10 +960,11 @@ template using _CommonImpl = _CommonImplBuiltin; #ifdef __ALTIVEC__ using _SimdImpl = _SimdImplPpc<_VecBuiltin<_UsedBytes>>; + using _MaskImpl = _MaskImplPpc<_VecBuiltin<_UsedBytes>>; #else using _SimdImpl = _SimdImplBuiltin<_VecBuiltin<_UsedBytes>>; -#endif using _MaskImpl = _MaskImplBuiltin<_VecBuiltin<_UsedBytes>>; +#endif #endif // }}} @@ -2899,7 +2901,7 @@ template _GLIBCXX_SIMD_INTRINSIC static bool _S_some_of(simd_mask<_Tp, _Abi> __k) { - const int __n_true = _S_popcount(__k); + const int __n_true = _SuperImpl::_S_popcount(__k); return __n_true > 0 && __n_true < int(_S_size<_Tp>); } diff --git a/libstdc++-v3/include/experimental/bits/simd_ppc.h b/libstdc++-v3/ include/experimental/bits/simd_ppc.h index c00d2323ac6..1d649931eb9 100644 --- a/libstdc++-v3/include/experimental/bits/simd_ppc.h +++ b/libstdc++-v3/include/experimental/bits/simd_ppc.h @@ -30,6 +30,7 @@ #ifndef __ALTIVEC__ #error "simd_ppc.h may only be included when AltiVec/VMX is available" #endif +#include _GLIBCXX_SIMD_BEGIN_NAMESPACE @@ -114,10 +115,42 @@ template // }}} }; +// }}} +// _MaskImplPpc {{{ +template + struct _MaskImplPpc : _MaskImplBuiltin<_Abi> + { + using _Base = _MaskImplBuiltin<_Abi>; + + // _S_popcount {{{ + template + _GLIBCXX_SIMD_INTRINSIC static int _S_popcount(simd_mask<_Tp, _Abi> __k) + { + const auto __kv = __as_vector(__k); + if constexpr (__have_power10vec) + { + return vec_cntm(__to_intrin(__kv), 1); + } + else if constexpr (sizeof(_Tp) >= sizeof(int)) + { + using _Intrin = __intrinsic_type16_t; + const int __sum = -vec_sums(__intrin_bitcast<_Intrin>(__kv), _Intrin())[3]; + return __sum / (sizeof(_Tp) / sizeof(int)); + } + else + { + const auto __summed_to_int = vec_sum4s(__to_intrin(__kv), __intrinsic_type16_t()); + return -vec_sums(__summed_to_int, __intrinsic_type16_t())[3]; + } + } + + // }}} + }; + // }}} _GLIBCXX_SIMD_END_NAMESPACE #endif // __cplusplus >= 201703L From patchwork Wed Jan 27 20:42:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432361 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwXv0Wm0z9sS8 for ; Thu, 28 Jan 2021 07:43:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C30E0398B8B7; Wed, 27 Jan 2021 20:42:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 0FA01398B85A; Wed, 27 Jan 2021 20:42:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0FA01398B85A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 367CD2050D05; Wed, 27 Jan 2021 21:42:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id PhG8ZyenoIej; Wed, 27 Jan 2021 21:42:31 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 1E3DC2050D00; Wed, 27 Jan 2021 21:42:31 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:30 +0100 From: Matthias Kretz To: , Subject: [PATCH 10/16] Skip testing hypot3 for long double on PPC Date: Wed, 27 Jan 2021 21:42:30 +0100 Message-ID: <5973499.ZsUzbmURod@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex4.Campus.gsi.de (10.10.4.36) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz std::hypot(a, b, c) is imprecise and makes this test fail even though the failure is unrelated to simd. libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/hypot3_fma.cc: Add skip: markup for long double on powerpc64*. --- libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc b/ libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc index 689a90c10a5..94d267fccfb 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/hypot3_fma.cc @@ -16,6 +16,7 @@ // . // only: float|double|ldouble * * * +// skip: ldouble * powerpc64* * // expensive: * [1-9] * * #include "bits/verify.h" #include "bits/metahelpers.h" From patchwork Wed Jan 27 20:42:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwY162yVz9sS8 for ; Thu, 28 Jan 2021 07:43:17 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F2DF398BC2A; Wed, 27 Jan 2021 20:42:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id D2A87398BC20; Wed, 27 Jan 2021 20:42:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D2A87398BC20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 0580B2050D05; Wed, 27 Jan 2021 21:42:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XCSpCSD9g-BR; Wed, 27 Jan 2021 21:42:34 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id E26452050D00; Wed, 27 Jan 2021 21:42:34 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:34 +0100 From: Matthias Kretz To: , Subject: [PATCH 11/16] Abort test after 1000 lines of output Date: Wed, 27 Jan 2021 21:42:34 +0100 Message-ID: <5748025.5r07IH9sy9@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex4.Campus.gsi.de (10.10.4.36) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz Handle overly large output by aborting the log and thus the test. This is a similar condition to a timeout. libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: When handling the pipe to log (and on verbose to stdout) count the lines. If it exceeds 1000 log the issue and exit 125, which is then handled as a failure. --- .../testsuite/experimental/simd/driver.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++- v3/testsuite/experimental/simd/driver.sh index 314c6a16f86..719e4db8e68 100755 --- a/libstdc++-v3/testsuite/experimental/simd/driver.sh +++ b/libstdc++-v3/testsuite/experimental/simd/driver.sh @@ -258,7 +258,11 @@ BEGIN { count = 0 } /^###exitstatus### [0-9]+$/ { exit \$2 } { print >> \"$log\" - if (count >= 1000) next + if (count >= 1000) { + print \"Aborting: too much output\" >> \"$log\" + print \"Aborting: too much output\" + exit 125 + } ++count if (length(\$0) > $maxcol) { i = 1 @@ -282,8 +286,17 @@ END { close(\"$log\") } " else awk " +BEGIN { count = 0 } /^###exitstatus### [0-9]+$/ { exit \$2 } -{ print >> \"$log\" } +{ + print >> \"$log\" + if (count >= 1000) { + print \"Aborting: too much output\" >> \"$log\" + print \"Aborting: too much output\" + exit 125 + } + ++count +} END { close(\"$log\") } " fi From patchwork Wed Jan 27 20:42:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwYC6DfRz9sS8 for ; Thu, 28 Jan 2021 07:43:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CADFA398BC1B; Wed, 27 Jan 2021 20:42:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 5D71A398BC1B; Wed, 27 Jan 2021 20:42:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5D71A398BC1B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 84C862050D05; Wed, 27 Jan 2021 21:42:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5rKbsaZECgJA; Wed, 27 Jan 2021 21:42:39 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 6CE1A2050D00; Wed, 27 Jan 2021 21:42:39 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:39 +0100 From: Matthias Kretz To: , Subject: [PATCH 12/16] Support timeout and timeout-factor options Date: Wed, 27 Jan 2021 21:42:38 +0100 Message-ID: <7726077.7O1Wp1SQZX@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: SRVEX2.campus.gsi.de (10.10.4.15) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: Abstract reading test options into read_src_option function. Read skip, only, expensive, and xfail via read_src_option. Add timeout and timeout-factor options and adjust timeout variable accordingly. * testsuite/experimental/simd/tests/loadstore.cc: Set timeout-factor 2. --- .../testsuite/experimental/simd/driver.sh | 38 +++++++++++++------ .../experimental/simd/tests/loadstore.cc | 1 + 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++- v3/testsuite/experimental/simd/driver.sh index 719e4db8e68..71e0c7d5ee8 100755 --- a/libstdc++-v3/testsuite/experimental/simd/driver.sh +++ b/libstdc++-v3/testsuite/experimental/simd/driver.sh @@ -214,35 +214,43 @@ trap "rm -f '$log' '$sum' $exe; exit" INT rm -f "$log" "$sum" touch "$log" "$sum" -skip="$(head -n25 "$src" | grep '^//\s*skip: ')" -if [ -n "$skip" ]; then - skip="$(echo "$skip" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" +read_src_option() { + local key tmp var + key="$1" + var="$2" + [ -z "$var" ] && var="$1" + local tmp="$(head -n25 "$src" | grep "^//\\s*${key}: ")" + if [ -n "$tmp" ]; then + tmp="$(echo "${tmp#//*${key}: }" | sed -e 's/ \+/ /g' -e 's/^ //' -e 's/ $//')" + eval "$var=\"$tmp\"" + else + return 1 + fi +} + +if read_src_option skip; then if test_selector "$skip"; then # silently skip this test exit 0 fi fi -only="$(head -n25 "$src" | grep '^//\s*only: ')" -if [ -n "$only" ]; then - only="$(echo "$only" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" +if read_src_option only; then if ! test_selector "$only"; then # silently skip this test exit 0 fi fi + if ! $run_expensive; then - expensive="$(head -n25 "$src" | grep '^//\s*expensive: ')" - if [ -n "$expensive" ]; then - expensive="$(echo "$expensive" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" + if read_src_option expensive; then if test_selector "$expensive"; then unsupported "skip expensive tests" exit 0 fi fi fi -xfail="$(head -n25 "$src" | grep '^//\s*xfail: ')" -if [ -n "$xfail" ]; then - xfail="$(echo "$xfail" | sed -e 's/^.*:\s*//' -e 's/ \+/ /g')" + +if read_src_option xfail; then if test_selector "${xfail#* }"; then xfail="${xfail%% *}" else @@ -250,6 +258,12 @@ if [ -n "$xfail" ]; then fi fi +read_src_option timeout + +if read_src_option timeout-factor factor; then + timeout=$(awk "BEGIN { print int($timeout * $factor) }") +fi + log_output() { if $verbose; then maxcol=${1:-1024} diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc b/ libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc index dd7d6c30e8c..cd27c3a7426 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/loadstore.cc @@ -16,6 +16,7 @@ // . // expensive: * [1-9] * * +// timeout-factor: 2 #include "bits/verify.h" #include "bits/make_vec.h" #include "bits/conversions.h" From patchwork Wed Jan 27 20:42:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432364 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwYK4Z9mz9sS8 for ; Thu, 28 Jan 2021 07:43:33 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 90492398BC37; Wed, 27 Jan 2021 20:42:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 7B3FE398BC21; Wed, 27 Jan 2021 20:42:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7B3FE398BC21 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id A29532050D05; Wed, 27 Jan 2021 21:42:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bkOf47_UvDQ6; Wed, 27 Jan 2021 21:42:43 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 8BE0A2050D00; Wed, 27 Jan 2021 21:42:43 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:43 +0100 From: Matthias Kretz To: , Subject: [PATCH 13/16] Improve test codegen for interpreting assembly Date: Wed, 27 Jan 2021 21:42:42 +0100 Message-ID: <18217938.xuKvIAzr1H@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: SRVEX2.campus.gsi.de (10.10.4.15) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz In many failure cases it is helpful to inspect the instructions leading up to the test failure. After this change the location is easier to find and the branch after failure is easier to find. libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/bits/verify.h (verify): Add instruction pointer data member. Ensure that the `if (m_failed)` branch is always inlined into the calling code. The body of the conditional can still be a function call. Move the get_ip call into the verify ctor to simplify the ctor calls. (COMPARE): Don't mention the use of all_of for reduction of a simd_mask. It only distracts from the real issue. --- .../experimental/simd/tests/bits/verify.h | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) #endif #define VERIFY(_test) \ - verify(_test, verify::get_ip(), __FILE__, __LINE__, __PRETTY_FUNCTION__, \ - #_test) + verify(_test, __FILE__, __LINE__, __PRETTY_FUNCTION__, #_test) // ulp_distance_signed can raise FP exceptions and thus must be conditionally // executed @@ -245,9 +245,9 @@ template [&](auto&& _aa, auto&& _bb) { \ const bool success = std::experimental::all_of( \ vir::test::ulp_distance(_aa, _bb) <= (_allowed_distance)); \ - return verify(success, verify::get_ip(), __FILE__, __LINE__, \ - __PRETTY_FUNCTION__, "all_of(" #_a " ~~ " #_b ")", \ - #_a " = ", _aa, "\n" #_b " = ", _bb, "\ndistance = ", \ + return verify(success, __FILE__, __LINE__, __PRETTY_FUNCTION__, \ + #_a " ~~ " #_b, #_a " = ", _aa, "\n" #_b " = ", _bb, \ + "\ndistance = ", \ success ? 0 : vir::test::ulp_distance_signed(_aa, _bb)); \ }((_a), (_b)) diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h b/ libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h index 5da47b35536..17bda71b77e 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h +++ b/libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h @@ -60,6 +60,7 @@ template class verify { const bool m_failed = false; + size_t m_ip = 0; template () @@ -129,20 +130,21 @@ class verify public: template - verify(bool ok, size_t ip, const char* file, const int line, + [[gnu::always_inline]] + verify(bool ok, const char* file, const int line, const char* func, const char* cond, const Ts&... extra_info) - : m_failed(!ok) + : m_failed(!ok), m_ip(get_ip()) { if (m_failed) - { + [&] { __builtin_fprintf(stderr, "%s:%d: (%s):\nInstruction Pointer: %x\n" "Assertion '%s' failed.\n", - file, line, func, ip, cond); + file, line, func, m_ip, cond); (print(extra_info, int()), ...); - } + }(); } - ~verify() + [[gnu::always_inline]] ~verify() { if (m_failed) { @@ -152,26 +154,27 @@ public: } template + [[gnu::always_inline]] const verify& operator<<(const T& x) const { if (m_failed) - { - print(x, int()); - } + print(x, int()); return *this; } template + [[gnu::always_inline]] const verify& on_failure(const Ts&... xs) const { if (m_failed) - (print(xs, int()), ...); + [&] { (print(xs, int()), ...); }(); return *this; } - [[gnu::always_inline]] static inline size_t + [[gnu::always_inline]] static inline + size_t get_ip() { size_t _ip = 0; @@ -220,24 +223,21 @@ template #define COMPARE(_a, _b) \ [&](auto&& _aa, auto&& _bb) { \ - return verify(std::experimental::all_of(_aa == _bb), verify::get_ip(), \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, \ - "all_of(" #_a " == " #_b ")", #_a " = ", _aa, \ + return verify(std::experimental::all_of(_aa == _bb), __FILE__, __LINE__, \ + __PRETTY_FUNCTION__, #_a " == " #_b, #_a " = ", _aa, \ "\n" #_b " = ", _bb); \ }(force_fp_truncation(_a), force_fp_truncation(_b)) #else #define COMPARE(_a, _b) \ [&](auto&& _aa, auto&& _bb) { \ - return verify(std::experimental::all_of(_aa == _bb), verify::get_ip(), \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, \ - "all_of(" #_a " == " #_b ")", #_a " = ", _aa, \ + return verify(std::experimental::all_of(_aa == _bb), __FILE__, __LINE__, \ + __PRETTY_FUNCTION__, #_a " == " #_b, #_a " = ", _aa, \ "\n" #_b " = ", _bb); \ }((_a), (_b)) From patchwork Wed Jan 27 20:42:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwYX2SZwz9sS8 for ; Thu, 28 Jan 2021 07:43:44 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B3193398C004; Wed, 27 Jan 2021 20:42:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id F084D398B81E; Wed, 27 Jan 2021 20:42:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F084D398B81E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 230212050D05; Wed, 27 Jan 2021 21:42:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9yRH3JeAe0Ey; Wed, 27 Jan 2021 21:42:51 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 084B52050D00; Wed, 27 Jan 2021 21:42:51 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:50 +0100 From: Matthias Kretz To: , Subject: [PATCH 14/16] Implement hmin and hmax Date: Wed, 27 Jan 2021 21:42:50 +0100 Message-ID: <6999407.PJNiXcIEje@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: SRVEX2.campus.gsi.de (10.10.4.15) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz From 9.7.4 in Parallelism TS 2. For some reason I overlooked these two functions. Implement them via call to _S_reduce. libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Add __detail::_Minimum and __detail::_Maximum to use them as _BinaryOperation to _S_reduce. Add hmin and hmax overloads for simd and const_where_expression. * include/experimental/bits/simd_scalar.h (_SimdImplScalar::_S_reduce): Make unused _BinaryOperation parameter const-ref to allow calling _S_reduce with an rvalue. * testsuite/experimental/simd/tests/reductions.cc: Add tests for hmin and hmax. Since the compiler statically determined that all tests pass, repeat the test after a call to make_value_unknown. --- libstdc++-v3/include/experimental/bits/simd.h | 78 ++++++++++++++++++- .../include/experimental/bits/simd_scalar.h | 2 +- .../experimental/simd/tests/reductions.cc | 21 +++++ 3 files changed, 99 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/ include/experimental/bits/simd.h index 14179491f9d..f08ef4c027d 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -204,6 +204,27 @@ template template using _SizeConstant = integral_constant; +namespace __detail { + struct _Minimum { + template + _GLIBCXX_SIMD_INTRINSIC constexpr + _Tp + operator()(_Tp __a, _Tp __b) const { + using std::min; + return min(__a, __b); + } + }; + struct _Maximum { + template + _GLIBCXX_SIMD_INTRINSIC constexpr + _Tp + operator()(_Tp __a, _Tp __b) const { + using std::max; + return max(__a, __b); + } + }; +} // namespace __detail + // unrolled/pack execution helpers // __execute_n_times{{{ template @@ -3408,7 +3429,7 @@ template // }}}1 // reductions [simd.reductions] {{{1 - template > +template > _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR _Tp reduce(const simd<_Tp, _Abi>& __v, _BinaryOperation __binary_op = _BinaryOperation()) @@ -3454,6 +3475,61 @@ template reduce(const const_where_expression<_M, _V>& __x, bit_xor<> __binary_op) { return reduce(__x, 0, __binary_op); } +template + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR _Tp + hmin(const simd<_Tp, _Abi>& __v) noexcept + { + return _Abi::_SimdImpl::_S_reduce(__v, __detail::_Minimum()); + } + +template + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR _Tp + hmax(const simd<_Tp, _Abi>& __v) noexcept + { + return _Abi::_SimdImpl::_S_reduce(__v, __detail::_Maximum()); + } + +template + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR + typename _V::value_type + hmin(const const_where_expression<_M, _V>& __x) noexcept + { + using _Tp = typename _V::value_type; + constexpr _Tp __id_elem = +#ifdef __FINITE_MATH_ONLY__ + __finite_max_v<_Tp>; +#else + __value_or<__infinity, _Tp>(__finite_max_v<_Tp>); +#endif + _V __tmp = __id_elem; + _V::_Impl::_S_masked_assign(__data(__get_mask(__x)), __data(__tmp), + __data(__get_lvalue(__x))); + return _V::abi_type::_SimdImpl::_S_reduce(__tmp, __detail::_Minimum()); + } + +template + _GLIBCXX_SIMD_INTRINSIC _GLIBCXX_SIMD_CONSTEXPR + typename _V::value_type + hmax(const const_where_expression<_M, _V>& __x) noexcept + { + using _Tp = typename _V::value_type; + constexpr _Tp __id_elem = +#ifdef __FINITE_MATH_ONLY__ + __finite_min_v<_Tp>; +#else + [] { + if constexpr (__value_exists_v<__infinity, _Tp>) + return -__infinity_v<_Tp>; + else + return __finite_min_v<_Tp>; + }(); +#endif + _V __tmp = __id_elem; + _V::_Impl::_S_masked_assign(__data(__get_mask(__x)), __data(__tmp), + __data(__get_lvalue(__x))); + return _V::abi_type::_SimdImpl::_S_reduce(__tmp, __detail::_Maximum()); + } + // }}}1 // algorithms [simd.alg] {{{ template diff --git a/libstdc++-v3/include/experimental/bits/simd_scalar.h b/libstdc++- v3/include/experimental/bits/simd_scalar.h index 7680bc39c30..7e480ecdb37 100644 --- a/libstdc++-v3/include/experimental/bits/simd_scalar.h +++ b/libstdc++-v3/include/experimental/bits/simd_scalar.h @@ -182,7 +182,7 @@ struct _SimdImplScalar // _S_reduce {{{2 template static constexpr inline _Tp - _S_reduce(const simd<_Tp, simd_abi::scalar>& __x, _BinaryOperation&) + _S_reduce(const simd<_Tp, simd_abi::scalar>& __x, const _BinaryOperation&) { return __x._M_data; } // _S_min, _S_max {{{2 diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/ libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc index 9d897d5ccd6..02df68fafbc 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc @@ -57,6 +57,8 @@ template } { + COMPARE(hmin(V(1)), T(1)); + COMPARE(hmax(V(1)), T(1)); const V z([](T i) { return i + 1; }); COMPARE(std::experimental::reduce(z, [](auto a, auto b) { @@ -79,6 +81,25 @@ template }), T(V::size() == 1 ? 117 : 2)) << "z: " << z; + COMPARE(hmin(z), T(1)); + COMPARE(hmax(z), T(V::size())); + if (V::size() > 1) + { + COMPARE(hmin(where(z > 1, z)), T(2)); + COMPARE(hmax(where(z > 1, z)), T(V::size())); + } + COMPARE(hmin(where(z < 4, z)), T(1)); + COMPARE(hmax(where(z < 4, z)), std::min(T(V::size()), T(3))); + const V zz = make_value_unknown(z); + COMPARE(hmin(zz), T(1)); + COMPARE(hmax(zz), T(V::size())); + if (V::size() > 1) + { + COMPARE(hmin(where(zz > 1, zz)), T(2)); + COMPARE(hmax(where(zz > 1, zz)), T(V::size())); + } + COMPARE(hmin(where(zz < 4, zz)), T(1)); + COMPARE(hmax(where(zz < 4, zz)), std::min(T(V::size()), T(3))); } test_values({}, {1000}, [](V x) { From patchwork Wed Jan 27 20:42:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwYd6TgTz9sS8 for ; Thu, 28 Jan 2021 07:43:49 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1E2E5398C013; Wed, 27 Jan 2021 20:42:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 289E7398C00A; Wed, 27 Jan 2021 20:42:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 289E7398C00A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 4F7BB2050D05; Wed, 27 Jan 2021 21:42:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Ghrh6dpFSmCU; Wed, 27 Jan 2021 21:42:55 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 36C152050D00; Wed, 27 Jan 2021 21:42:55 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:54 +0100 From: Matthias Kretz To: , Subject: [PATCH 15/16] Work around test failures using -mno-tree-vrp Date: Wed, 27 Jan 2021 21:42:54 +0100 Message-ID: <6547785.gN9NRCCTar@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: SRVEX2.campus.gsi.de (10.10.4.15) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Matthias Kretz This is necessary to avoid failures resulting from PR98834. libstdc++-v3/ChangeLog: * testsuite/Makefile.am: Warn about the workaround. Add -fno-tree-vrp to CXXFLAGS passed to the check_simd script. Improve initial user feedback from make check-simd. * testsuite/Makefile.in: Regenerated. --- libstdc++-v3/testsuite/Makefile.am | 4 +++- libstdc++-v3/testsuite/Makefile.in | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) {glibcxx_builddir}" "$(CXXFLAGS) -fno-tree-vrp" | \ while read subdir; do \ $(MAKE) -C "$${subdir}"; \ tail -n20 $${subdir}/simd_testsuite.sum | \ diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/ Makefile.am index 2d3ad481dba..ba5023a8b54 100644 --- a/libstdc++-v3/testsuite/Makefile.am +++ b/libstdc++-v3/testsuite/Makefile.am @@ -191,8 +191,10 @@ check-simd: $(srcdir)/experimental/simd/ generate_makefile.sh \ ${glibcxx_srcdir}/scripts/check_simd \ testsuite_files_simd \ ${glibcxx_builddir}/scripts/testsuite_flags + @echo "WARNING: Adding -fno-tree-vrp to CXXFLAGS to work around PR98834." @rm -f .simd.summary - ${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "$ {glibcxx_builddir}" "$(CXXFLAGS)" | \ + @echo "Generating simd testsuite subdirs and Makefiles ..." + @${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "$ {glibcxx_builddir}" "$(CXXFLAGS) -fno-tree-vrp" | \ while read subdir; do \ $(MAKE) -C "$${subdir}"; \ tail -n20 $${subdir}/simd_testsuite.sum | \ diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/ Makefile.in index ac6207ae75c..c9dd7f5da61 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -716,8 +716,10 @@ check-simd: $(srcdir)/experimental/simd/ generate_makefile.sh \ ${glibcxx_srcdir}/scripts/check_simd \ testsuite_files_simd \ ${glibcxx_builddir}/scripts/testsuite_flags + @echo "WARNING: Adding -fno-tree-vrp to CXXFLAGS to work around PR98834." @rm -f .simd.summary - ${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "$ {glibcxx_builddir}" "$(CXXFLAGS)" | \ + @echo "Generating simd testsuite subdirs and Makefiles ..." + @${glibcxx_srcdir}/scripts/check_simd "${glibcxx_srcdir}" "$ From patchwork Wed Jan 27 20:42:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 1432367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQwYn15Mlz9sSs for ; Thu, 28 Jan 2021 07:43:57 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0CBE1398C018; Wed, 27 Jan 2021 20:43:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 73DEB398C018; Wed, 27 Jan 2021 20:42:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 73DEB398C018 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=M.Kretz@gsi.de Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 9A84E2050D05; Wed, 27 Jan 2021 21:42:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id NXajYc0CR-Gb; Wed, 27 Jan 2021 21:42:58 +0100 (CET) Received: from srvex3.campus.gsi.de (srvex3.campus.gsi.de [10.10.4.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 81FC02050D00; Wed, 27 Jan 2021 21:42:58 +0100 (CET) Received: from excalibur.localnet (140.181.3.12) by srvex3.campus.gsi.de (10.10.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 27 Jan 2021 21:42:58 +0100 From: Matthias Kretz To: , Subject: [PATCH 16/16] Improve "find_first/last_set" for NEON Date: Wed, 27 Jan 2021 21:42:57 +0100 Message-ID: <7606387.ebMzRN9Arp@excalibur> Organization: GSI Helmholtzzentrum =?utf-8?q?f=C3=BCr?= Schwerionenforschung In-Reply-To: <4667217.5jz8CO7rxU@excalibur> References: <4667217.5jz8CO7rxU@excalibur> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex3.Campus.gsi.de (10.10.4.16) To srvex3.campus.gsi.de (10.10.4.16) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: yaozhongxiao find_first_set and find_last_set method is not optimal for neon, it need to be improved by synthesized with horizontal adds(vaddv) which will reduce the generated assembly code; in the following cases, vaddvq_s16 will generate 2 instructions but vpadd_s16 will generate 4 instrunctions: ``` # vaddvq_s16 vaddvq_s16(__asint); // addv h0, v1.8h // smov w1, v0.h[0] # vpadd_s16 vpaddq_s16(vpaddq_s16(vpaddq_s16(__asint, __zero), __zero), __zero)[0] // addp v1.8h,v1.8h,v2.8h // addp v1.8h,v1.8h,v2.8h // addp v1.8h,v1.8h,v2.8h // smov w1, v1.h[0] # ``` libstdc++-v3/ChangeLog: * include/experimental/bits/simd_neon.h: Replace repeated vpadd calls with a single vaddv for aarch64. --- .../include/experimental/bits/simd_neon.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) vpadd_s16(vpadd_s16(__lo64(__asint), __hi64(__asint)), __zero), @@ -328,7 +327,7 @@ struct _MaskImplNeonMixin }); __asint &= __bitsel; #ifdef __aarch64__ - return vpaddq_s32(vpaddq_s32(__asint, __zero), __zero)[0]; + return vaddvq_s32(__asint); #else return vpadd_s32(vpadd_s32(__lo64(__asint), __hi64(__asint)), __zero)[0]; @@ -351,8 +350,12 @@ struct _MaskImplNeonMixin return static_cast<_I>(__i < _Np ? 1 << __i : 0); }); __asint &= __bitsel; +#ifdef __aarch64__ + return vaddv_s8(__asint); +#else return vpadd_s8(vpadd_s8(vpadd_s8(__asint, __zero), __zero), __zero)[0]; +#endif } else if constexpr (sizeof(_Tp) == 2) { @@ -362,12 +365,20 @@ struct _MaskImplNeonMixin return static_cast<_I>(__i < _Np ? 1 << __i : 0); }); __asint &= __bitsel; +#ifdef __aarch64__ + return vaddv_s16(__asint); +#else return vpadd_s16(vpadd_s16(__asint, __zero), __zero)[0]; +#endif } else if constexpr (sizeof(_Tp) == 4) { __asint &= __make_vector<_I>(0x1, 0x2); +#ifdef __aarch64__ + return vaddv_s32(__asint); +#else return vpadd_s32(__asint, __zero)[0]; +#endif } else __assert_unreachable<_Tp>(); diff --git a/libstdc++-v3/include/experimental/bits/simd_neon.h b/libstdc++- v3/include/experimental/bits/simd_neon.h index a3a8ffe165f..0b8ccc17513 100644 --- a/libstdc++-v3/include/experimental/bits/simd_neon.h +++ b/libstdc++-v3/include/experimental/bits/simd_neon.h @@ -311,8 +311,7 @@ struct _MaskImplNeonMixin }); __asint &= __bitsel; #ifdef __aarch64__ - return vpaddq_s16(vpaddq_s16(vpaddq_s16(__asint, __zero), __zero), - __zero)[0]; + return vaddvq_s16(__asint); #else return vpadd_s16(