From patchwork Wed Apr 24 02:48:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 1926899 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=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=DydxRkWh; 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 4VPNjn5l87z1yZP for ; Wed, 24 Apr 2024 12:49:15 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E16C3849AE0 for ; Wed, 24 Apr 2024 02:49:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by sourceware.org (Postfix) with ESMTPS id B2DFA385840D for ; Wed, 24 Apr 2024 02:48:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2DFA385840D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B2DFA385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713926936; cv=none; b=BciYTHz8V8Puy82ptRcyigpc3kvfTJUvxasPG0ntlFP9oTzxpZq2vhJJ4o84FoWCOwETy2m0un90Xw+pvomK4zzdJRhUHqcCgwvDgItlW1gh9XLYxtg0w+BFPSTwbgtnitb/dK0D/0YPWDSXaF/J9nr8bfoM0kCoHz9pas2qas0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713926936; c=relaxed/simple; bh=inY4H9v41ab4CQXXAVd8sP7KPlJVIN+8ScWsX6LvpjI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=dpG50eFmLTSh/TSWPQ3IZwLYg2nMcO8y7FqnsexDVQ45U9YGqL+LafhvCg0sSvthNx01rqNTC9Yb/LzPk3lnbTZczZtbW+c2/6nnnQaT5tEKz8gwKB7sj9QMv/1hwhOhOF7b/vYoPQ9d1JZddjxIf4mDYAuCiDVwCsykNdERtbo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713926933; x=1745462933; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=inY4H9v41ab4CQXXAVd8sP7KPlJVIN+8ScWsX6LvpjI=; b=DydxRkWhdR1FgIL8GKViKfFHTSGsmjrjH+J+7QGua5C+xqVVNizCsjlh 42dKkr2Df4dOYPxUNJDN/doJYf1OpVVMmfVBCCQvyYz5eyvEE/f76fa9Y tVOjrlT1Lc8diGmNyTRem65aWLLl3ttnuX5v8u8/N1OBuPUlUzGlD0W19 L6lZ57v9zOtqvtuxpLfjrzbgrmw6mqWamdaU8nzTc+DcqmR+O+h6TQ1FV akLxeQZF7b1r+9VrIcQiGwNDJ9+RHsF8OpFxiiv6wnrKSxJ8/czCw67J3 ekdArOIpFlQ5P0fD6HRgLIunQissfKwfXgpH4Mtn1RXYCyHNGemcbKGs6 w==; X-CSE-ConnectionGUID: kRKl/9dtS+KDYB3cCuy+pw== X-CSE-MsgGUID: J2yRkwKXTj6HdRsI7k7N9Q== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9757885" X-IronPort-AV: E=Sophos;i="6.07,225,1708416000"; d="scan'208";a="9757885" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 19:48:52 -0700 X-CSE-ConnectionGUID: zmTP7AHhQGi/Zny7fArJPA== X-CSE-MsgGUID: QKVcW0h3Q4mz1og0x3pUwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,225,1708416000"; d="scan'208";a="29216430" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmviesa004.fm.intel.com with ESMTP; 23 Apr 2024 19:48:48 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail03.sh.intel.com (Postfix) with ESMTP id E45A81007C08; Wed, 24 Apr 2024 10:48:47 +0800 (CST) From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@gmail.com, rdapp.gcc@gmail.com, Pan Li Subject: [PATCH v1] RISC-V: Add xfail test case for highpart overlap of vext.vf Date: Wed, 24 Apr 2024 10:48:46 +0800 Message-Id: <20240424024846.32515-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, 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 From: Pan Li We reverted below patch for register group overlap, add the related insn test and mark it as xfail. And we will remove the xfail after we support the register overlap in GCC-15. 62685890d88 RISC-V: Support highpart overlap for vext.vf The below test suites are passed for this patch * The rv64gcv fully regression test with isl build. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/unop_v_constraint-2.c: Adjust asm check cond. * gcc.target/riscv/rvv/base/pr112431-4.c: New test. * gcc.target/riscv/rvv/base/pr112431-5.c: New test. * gcc.target/riscv/rvv/base/pr112431-6.c: New test. Signed-off-by: Pan Li Signed-off-by: Pan Li --- .../gcc.target/riscv/rvv/base/pr112431-4.c | 104 ++++++++++++++++++ .../gcc.target/riscv/rvv/base/pr112431-5.c | 68 ++++++++++++ .../gcc.target/riscv/rvv/base/pr112431-6.c | 51 +++++++++ .../riscv/rvv/base/unop_v_constraint-2.c | 2 +- 4 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-4.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-5.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-6.c diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-4.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-4.c new file mode 100644 index 00000000000..cecf796e10c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-4.c @@ -0,0 +1,104 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */ + +#include "riscv_vector.h" + +size_t __attribute__ ((noinline)) +sumation (size_t sum0, size_t sum1, size_t sum2, size_t sum3, size_t sum4, + size_t sum5, size_t sum6, size_t sum7, size_t sum8, size_t sum9, + size_t sum10, size_t sum11, size_t sum12, size_t sum13, size_t sum14, + size_t sum15) +{ + return sum0 + sum1 + sum2 + sum3 + sum4 + sum5 + sum6 + sum7 + sum8 + sum9 + + sum10 + sum11 + sum12 + sum13 + sum14 + sum15; +} + +size_t +foo (char const *buf, size_t len) +{ + size_t sum = 0; + size_t vl = __riscv_vsetvlmax_e8m8 (); + size_t step = vl * 4; + const char *it = buf, *end = buf + len; + for (; it + step <= end;) + { + vint8m1_t v0 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v1 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v2 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v3 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v4 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v5 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v6 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v7 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v8 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v9 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v10 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v11 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v12 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v13 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v14 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + vint8m1_t v15 = __riscv_vle8_v_i8m1 ((void *) it, vl); + it += vl; + + asm volatile("nop" ::: "memory"); + vint16m2_t vw0 = __riscv_vsext_vf2_i16m2 (v0, vl); + vint16m2_t vw1 = __riscv_vsext_vf2_i16m2 (v1, vl); + vint16m2_t vw2 = __riscv_vsext_vf2_i16m2 (v2, vl); + vint16m2_t vw3 = __riscv_vsext_vf2_i16m2 (v3, vl); + vint16m2_t vw4 = __riscv_vsext_vf2_i16m2 (v4, vl); + vint16m2_t vw5 = __riscv_vsext_vf2_i16m2 (v5, vl); + vint16m2_t vw6 = __riscv_vsext_vf2_i16m2 (v6, vl); + vint16m2_t vw7 = __riscv_vsext_vf2_i16m2 (v7, vl); + vint16m2_t vw8 = __riscv_vsext_vf2_i16m2 (v8, vl); + vint16m2_t vw9 = __riscv_vsext_vf2_i16m2 (v9, vl); + vint16m2_t vw10 = __riscv_vsext_vf2_i16m2 (v10, vl); + vint16m2_t vw11 = __riscv_vsext_vf2_i16m2 (v11, vl); + vint16m2_t vw12 = __riscv_vsext_vf2_i16m2 (v12, vl); + vint16m2_t vw13 = __riscv_vsext_vf2_i16m2 (v13, vl); + vint16m2_t vw14 = __riscv_vsext_vf2_i16m2 (v14, vl); + vint16m2_t vw15 = __riscv_vsext_vf2_i16m2 (v15, vl); + + asm volatile("nop" ::: "memory"); + size_t sum0 = __riscv_vmv_x_s_i16m2_i16 (vw0); + size_t sum1 = __riscv_vmv_x_s_i16m2_i16 (vw1); + size_t sum2 = __riscv_vmv_x_s_i16m2_i16 (vw2); + size_t sum3 = __riscv_vmv_x_s_i16m2_i16 (vw3); + size_t sum4 = __riscv_vmv_x_s_i16m2_i16 (vw4); + size_t sum5 = __riscv_vmv_x_s_i16m2_i16 (vw5); + size_t sum6 = __riscv_vmv_x_s_i16m2_i16 (vw6); + size_t sum7 = __riscv_vmv_x_s_i16m2_i16 (vw7); + size_t sum8 = __riscv_vmv_x_s_i16m2_i16 (vw8); + size_t sum9 = __riscv_vmv_x_s_i16m2_i16 (vw9); + size_t sum10 = __riscv_vmv_x_s_i16m2_i16 (vw10); + size_t sum11 = __riscv_vmv_x_s_i16m2_i16 (vw11); + size_t sum12 = __riscv_vmv_x_s_i16m2_i16 (vw12); + size_t sum13 = __riscv_vmv_x_s_i16m2_i16 (vw13); + size_t sum14 = __riscv_vmv_x_s_i16m2_i16 (vw14); + size_t sum15 = __riscv_vmv_x_s_i16m2_i16 (vw15); + + sum += sumation (sum0, sum1, sum2, sum3, sum4, sum5, sum6, sum7, sum8, + sum9, sum10, sum11, sum12, sum13, sum14, sum15); + } + return sum; +} + +/* { dg-final { scan-assembler-not {vmv1r} } } */ +/* { dg-final { scan-assembler-not {vmv2r} } } */ +/* { dg-final { scan-assembler-not {vmv4r} } } */ +/* { dg-final { scan-assembler-not {vmv8r} } } */ +/* { dg-final { scan-assembler-not {csrr} { xfail riscv*-*-* } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-5.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-5.c new file mode 100644 index 00000000000..b34a835b965 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-5.c @@ -0,0 +1,68 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */ + +#include "riscv_vector.h" + +size_t __attribute__ ((noinline)) +sumation (size_t sum0, size_t sum1, size_t sum2, size_t sum3, size_t sum4, + size_t sum5, size_t sum6, size_t sum7) +{ + return sum0 + sum1 + sum2 + sum3 + sum4 + sum5 + sum6 + sum7; +} + +size_t +foo (char const *buf, size_t len) +{ + size_t sum = 0; + size_t vl = __riscv_vsetvlmax_e8m8 (); + size_t step = vl * 4; + const char *it = buf, *end = buf + len; + for (; it + step <= end;) + { + vint8m2_t v0 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + vint8m2_t v1 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + vint8m2_t v2 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + vint8m2_t v3 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + vint8m2_t v4 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + vint8m2_t v5 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + vint8m2_t v6 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + vint8m2_t v7 = __riscv_vle8_v_i8m2 ((void *) it, vl); + it += vl; + + asm volatile("nop" ::: "memory"); + vint16m4_t vw0 = __riscv_vsext_vf2_i16m4 (v0, vl); + vint16m4_t vw1 = __riscv_vsext_vf2_i16m4 (v1, vl); + vint16m4_t vw2 = __riscv_vsext_vf2_i16m4 (v2, vl); + vint16m4_t vw3 = __riscv_vsext_vf2_i16m4 (v3, vl); + vint16m4_t vw4 = __riscv_vsext_vf2_i16m4 (v4, vl); + vint16m4_t vw5 = __riscv_vsext_vf2_i16m4 (v5, vl); + vint16m4_t vw6 = __riscv_vsext_vf2_i16m4 (v6, vl); + vint16m4_t vw7 = __riscv_vsext_vf2_i16m4 (v7, vl); + + asm volatile("nop" ::: "memory"); + size_t sum0 = __riscv_vmv_x_s_i16m4_i16 (vw0); + size_t sum1 = __riscv_vmv_x_s_i16m4_i16 (vw1); + size_t sum2 = __riscv_vmv_x_s_i16m4_i16 (vw2); + size_t sum3 = __riscv_vmv_x_s_i16m4_i16 (vw3); + size_t sum4 = __riscv_vmv_x_s_i16m4_i16 (vw4); + size_t sum5 = __riscv_vmv_x_s_i16m4_i16 (vw5); + size_t sum6 = __riscv_vmv_x_s_i16m4_i16 (vw6); + size_t sum7 = __riscv_vmv_x_s_i16m4_i16 (vw7); + + sum += sumation (sum0, sum1, sum2, sum3, sum4, sum5, sum6, sum7); + } + return sum; +} + +/* { dg-final { scan-assembler-not {vmv1r} } } */ +/* { dg-final { scan-assembler-not {vmv2r} } } */ +/* { dg-final { scan-assembler-not {vmv4r} } } */ +/* { dg-final { scan-assembler-not {vmv8r} } } */ +/* { dg-final { scan-assembler-not {csrr} { xfail riscv*-*-* } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-6.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-6.c new file mode 100644 index 00000000000..95af07166a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-6.c @@ -0,0 +1,51 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */ + +#include "riscv_vector.h" + +size_t __attribute__ ((noinline)) +sumation (size_t sum0, size_t sum1, size_t sum2, size_t sum3) +{ + return sum0 + sum1 + sum2 + sum3; +} + +size_t +foo (char const *buf, size_t len) +{ + size_t sum = 0; + size_t vl = __riscv_vsetvlmax_e8m8 (); + size_t step = vl * 4; + const char *it = buf, *end = buf + len; + for (; it + step <= end;) + { + vint8m4_t v0 = __riscv_vle8_v_i8m4 ((void *) it, vl); + it += vl; + vint8m4_t v1 = __riscv_vle8_v_i8m4 ((void *) it, vl); + it += vl; + vint8m4_t v2 = __riscv_vle8_v_i8m4 ((void *) it, vl); + it += vl; + vint8m4_t v3 = __riscv_vle8_v_i8m4 ((void *) it, vl); + it += vl; + + asm volatile("nop" ::: "memory"); + vint16m8_t vw0 = __riscv_vsext_vf2_i16m8 (v0, vl); + vint16m8_t vw1 = __riscv_vsext_vf2_i16m8 (v1, vl); + vint16m8_t vw2 = __riscv_vsext_vf2_i16m8 (v2, vl); + vint16m8_t vw3 = __riscv_vsext_vf2_i16m8 (v3, vl); + + asm volatile("nop" ::: "memory"); + size_t sum0 = __riscv_vmv_x_s_i16m8_i16 (vw0); + size_t sum1 = __riscv_vmv_x_s_i16m8_i16 (vw1); + size_t sum2 = __riscv_vmv_x_s_i16m8_i16 (vw2); + size_t sum3 = __riscv_vmv_x_s_i16m8_i16 (vw3); + + sum += sumation (sum0, sum1, sum2, sum3); + } + return sum; +} + +/* { dg-final { scan-assembler-not {vmv1r} } } */ +/* { dg-final { scan-assembler-not {vmv2r} } } */ +/* { dg-final { scan-assembler-not {vmv4r} } } */ +/* { dg-final { scan-assembler-not {vmv8r} } } */ +/* { dg-final { scan-assembler-not {csrr} { xfail riscv*-*-* } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/unop_v_constraint-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/unop_v_constraint-2.c index 3344d423525..f7a9e58292c 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/unop_v_constraint-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/unop_v_constraint-2.c @@ -30,7 +30,7 @@ void f1 (void * in, void *out) ** vle16\.v\tv[0-9]+,0\([a-x0-9]+\) ** vsext\.vf2\tv[0-9]+,\s*v[0-9]+ ** ... -** vsext\.vf2\tv[1-9][0-9]?,\s*v[0-9]+,\s*v0.t +** vsext\.vf2\tv[0-9]+,\s*v[0-9]+,\s*v0.t ** vse64\.v\tv[0-9]+,0\([a-x0-9]+\) ** ret */