From patchwork Mon Oct 9 21:52:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1845505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=g02ftHks; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S4CTJ20Qpz23jb for ; Tue, 10 Oct 2023 08:53:20 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 472AF3858410 for ; Mon, 9 Oct 2023 21:53:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 839593858D28 for ; Mon, 9 Oct 2023 21:53:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 839593858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4060b623e64so30289965e9.0 for ; Mon, 09 Oct 2023 14:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1696888383; x=1697493183; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=yxqoLWk4tN/bOu2DgwZvKL2H3S/KTedtymep3v7SMvU=; b=g02ftHksMHy0rWvabEOZO3CnFrvh/ai1UTFPLvH/jv6wep9rxQsMlqUuTiwQo3kUzV oyuB35y+4+mYQkPze4ajO+/QiF2NHbMgiDOrLCDM9yu+Vem//GNfdyKIQBxwHsrB40bg 8Sw4oRJInAljW+LyUJK1kSNTeNgQt4Siz8pxO19rIjsFow1suFySQn+Bo0qJuJfs45Hk ADk4/1V3gLKOPVT/DdCOPJBPjIZbDGVHHSqAA2KiL2IK3f8iEJ4IK0KnAHbpoq6AYb3V ptyk6uAl6ecqPEK8UWXcKtJnH64krjoPYRRpDvGS9WVntE9LdVI8kg6tzFcKtPC2QJI7 fOUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696888383; x=1697493183; h=mime-version:user-agent:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yxqoLWk4tN/bOu2DgwZvKL2H3S/KTedtymep3v7SMvU=; b=qjtGMd4PuvXIoAkG2+4AAAO+5ETLlVKjXbHwb3bZv4/7YwbJOD1b9IU8HbUggorqjg MFgWw31CSFQw3TPtG7t2E+lFs/6ck9XlsXPner+cgk6FGTdixLG/hshFEqdXgwc9Jhbu 0H7IMcQ3dwiIhTdguEq4r/CKu77np/OdDH9oLTMm2bdrqufbZ2FIWYqxse/t23J38wYt ZE/lEKLrFtFZUz5j3p3OVDHD1Moy1/gbmMQX374R1wl162OPkba3Sv8rDfy8QnLe+RS/ Wce2loJ+Q67U3NkBLRwOwpOpKb1MwStTMO7AtSBhKXFAieDS4jsY3snbu6qeLRXwaBT6 LS0w== X-Gm-Message-State: AOJu0YwhXWvFh1r1VvuyMuS19zjRV0zmPPbGvz3R56IChzdWnmbapx9I ABJASqNd/jWIulW/cfEb8r+aLkWoNVBTcja+JDk= X-Google-Smtp-Source: AGHT+IEtW1QD5Ao3dpNTWvtaWtjS21utCN3lnSmwqaLMBewLmX/wA8DHA3pb01sJvdQD8O7vxauswg== X-Received: by 2002:a05:600c:4f02:b0:401:609f:7f9a with SMTP id l2-20020a05600c4f0200b00401609f7f9amr11608049wmq.8.1696888383113; Mon, 09 Oct 2023 14:53:03 -0700 (PDT) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [2001:8b0:154:0:ea6a:64ff:fe24:f2fc]) by smtp.gmail.com with ESMTPSA id c12-20020adfe74c000000b003258934a4bfsm10729989wrn.36.2023.10.09.14.53.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2023 14:53:02 -0700 (PDT) Date: Mon, 9 Oct 2023 22:52:59 +0100 (BST) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: Andrew Waterman , Jim Wilson , Kito Cheng , Palmer Dabbelt Subject: [PATCH] RISC-V/testsuite: Enable `vect_pack_trunc' Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Despite not defining `vec_pack_trunc_' standard named patterns the backend provides vector pack operations via its own `@pred_trunc' set of patterns and they do trigger in vectorization producing narrowing VNCVT.X.X.W assembly instructions as expected. Enable the `vect_pack_trunc' setting for RISC-V targets then, improving GCC C test results in `-march=rv64gcv' testing as follows: -FAIL: gcc.dg/vect/pr57705.c scan-tree-dump-times vect "vectorized 1 loop" 2 +PASS: gcc.dg/vect/pr57705.c scan-tree-dump-times vect "vectorized 1 loop" 3 +PASS: gcc.dg/vect/pr59354.c scan-tree-dump vect "vectorized 1 loop" -UNSUPPORTED: gcc.dg/vect/pr97678.c +PASS: gcc.dg/vect/pr97678.c (test for excess errors) +PASS: gcc.dg/vect/pr97678.c execution test +XFAIL: gcc.dg/vect/pr97678.c scan-tree-dump vect "vectorizing stmts using SLP" -UNSUPPORTED: gcc.dg/vect/vect-bool-cmp.c +PASS: gcc.dg/vect/vect-bool-cmp.c (test for excess errors) +PASS: gcc.dg/vect/vect-bool-cmp.c execution test +PASS: gcc.dg/vect/vect-iv-4.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-multitypes-14.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-multitypes-8.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-reduc-dot-u16b.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-strided-store-u16-i4.c scan-tree-dump-times vect "vectorized 1 loops" 2 -PASS: gcc.dg/vect/slp-13-big-array.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2 +XFAIL: gcc.dg/vect/slp-13-big-array.c scan-tree-dump-times vect "vectorizing stmts using SLP" 3 -PASS: gcc.dg/vect/slp-13.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2 +XFAIL: gcc.dg/vect/slp-13.c scan-tree-dump-times vect "vectorizing stmts using SLP" 3 +PASS: gcc.dg/vect/slp-multitypes-10.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-10.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 +PASS: gcc.dg/vect/slp-multitypes-5.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-5.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 +PASS: gcc.dg/vect/slp-multitypes-6.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-6.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 +PASS: gcc.dg/vect/slp-multitypes-9.c scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-9.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 -UNSUPPORTED: gcc.dg/vect/slp-perm-12.c +PASS: gcc.dg/vect/slp-perm-12.c (test for excess errors) +PASS: gcc.dg/vect/slp-perm-12.c execution test -UNSUPPORTED: gcc.dg/vect/bb-slp-11.c +PASS: gcc.dg/vect/bb-slp-11.c (test for excess errors) +PASS: gcc.dg/vect/bb-slp-11.c execution test -FAIL: gcc.dg/vect/pr57705.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loop" 2 +PASS: gcc.dg/vect/pr57705.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loop" 3 +PASS: gcc.dg/vect/pr59354.c -flto -ffat-lto-objects scan-tree-dump vect "vectorized 1 loop" -UNSUPPORTED: gcc.dg/vect/pr97678.c -flto -ffat-lto-objects +PASS: gcc.dg/vect/pr97678.c -flto -ffat-lto-objects (test for excess errors) +PASS: gcc.dg/vect/pr97678.c -flto -ffat-lto-objects execution test +XFAIL: gcc.dg/vect/pr97678.c -flto -ffat-lto-objects scan-tree-dump vect "vectorizing stmts using SLP" -UNSUPPORTED: gcc.dg/vect/vect-bool-cmp.c -flto -ffat-lto-objects +PASS: gcc.dg/vect/vect-bool-cmp.c -flto -ffat-lto-objects (test for excess errors) +PASS: gcc.dg/vect/vect-bool-cmp.c -flto -ffat-lto-objects execution test +PASS: gcc.dg/vect/vect-iv-4.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-multitypes-14.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-multitypes-8.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-reduc-dot-u16b.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/vect-strided-store-u16-i4.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 2 -PASS: gcc.dg/vect/slp-13-big-array.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 2 +XFAIL: gcc.dg/vect/slp-13-big-array.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 3 -PASS: gcc.dg/vect/slp-13.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 2 +XFAIL: gcc.dg/vect/slp-13.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 3 +PASS: gcc.dg/vect/slp-multitypes-10.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-10.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 +PASS: gcc.dg/vect/slp-multitypes-5.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-5.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 +PASS: gcc.dg/vect/slp-multitypes-6.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-6.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 +PASS: gcc.dg/vect/slp-multitypes-9.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 +PASS: gcc.dg/vect/slp-multitypes-9.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 -UNSUPPORTED: gcc.dg/vect/slp-perm-12.c -flto -ffat-lto-objects +PASS: gcc.dg/vect/slp-perm-12.c -flto -ffat-lto-objects (test for excess errors) +PASS: gcc.dg/vect/slp-perm-12.c -flto -ffat-lto-objects execution test -UNSUPPORTED: gcc.dg/vect/bb-slp-11.c -flto -ffat-lto-objects +PASS: gcc.dg/vect/bb-slp-11.c -flto -ffat-lto-objects (test for excess errors) +PASS: gcc.dg/vect/bb-slp-11.c -flto -ffat-lto-objects execution test -XPASS: gcc.dg/vect/no-scevccp-outer-21.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED." 1 +PASS: gcc.dg/vect/no-scevccp-outer-21.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED." 1 New XFAIL results are legitimate as they are currently expected for `vect_variable_length' targets such the RISC-V one is. The new condition for `vect_pack_trunc' does not check for `riscv_v', because we don't support different RISC-V vector extensions that might or might not support the vector demotion operation, so we know it is supported as long as vector operations are in general, and individual tests are supposed to check for overall vector operation support via `vect_int' or suchlike. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_pack_trunc): Also succeed for `riscv*-*-*' targets. --- Hi, Overall GCC C test results have improved from: === gcc Summary === # of expected passes 187616 # of unexpected failures 672 # of unexpected successes 14 # of expected failures 1436 # of unresolved testcases 615 # of unsupported tests 4731 to: === gcc Summary === # of expected passes 187659 # of unexpected failures 670 # of unexpected successes 13 # of expected failures 1442 # of unresolved testcases 615 # of unsupported tests 4723 with no changes (except for intermittent Python failures for C++) with the remaining testsuites. There are a few of regressions in `-march=rv64gc' testing: +FAIL: gcc.dg/vect/pr97678.c scan-tree-dump vect "vectorizing stmts using SLP" +FAIL: gcc.dg/vect/slp-13-big-array.c scan-tree-dump-times vect "vectorizing stmts using SLP" 3 +FAIL: gcc.dg/vect/slp-13.c scan-tree-dump-times vect "vectorizing stmts using SLP" 3 +FAIL: gcc.dg/vect/pr97678.c -flto -ffat-lto-objects scan-tree-dump vect "vectorizing stmts using SLP" +FAIL: gcc.dg/vect/slp-13-big-array.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 3 +FAIL: gcc.dg/vect/slp-13.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 3 but they are a problem presumably with `vect_int' enabling these tests for a non-vector target rather than my change and may have been fixed since (I haven't double-checked) as I have only run smoke-testing with a slightly outdated tree from Sep 29th. NB I don't know why it works despite the lack of `vec_pack_trunc_' patterns in the backend. Perhaps something has changed in the middle end since our documentation has been last updated in the relevant area. If it is the case, then I think it would be good to update our documentation and whoever knows what is going on will be best suited to do so. Questions, comments, OK to apply? Maciej --- gcc/testsuite/lib/target-supports.exp | 1 + 1 file changed, 1 insertion(+) gcc-test-riscv-vect-pack-trunc.diff Index: gcc/gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc.orig/gcc/testsuite/lib/target-supports.exp +++ gcc/gcc/testsuite/lib/target-supports.exp @@ -7981,6 +7981,7 @@ proc check_effective_target_vect_pack_trunc { } { && [check_effective_target_arm_little_endian]) || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) + || [istarget riscv*-*-*] || ([istarget s390*-*-*] && [check_effective_target_s390_vx]) || [istarget amdgcn*-*-*] }}]