From patchwork Mon Jul 17 14:20:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 121356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1142847vqt; Mon, 17 Jul 2023 07:20:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlHEiYIKNJUM1+gtpdZqrG7nzR5mefm4CM/CuG590Ou+kOWQRGx7wkLg5snBWTTn31Q+yYDc X-Received: by 2002:a17:907:7e8a:b0:992:74e0:6f76 with SMTP id qb10-20020a1709077e8a00b0099274e06f76mr12645162ejc.4.1689603652757; Mon, 17 Jul 2023 07:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689603652; cv=none; d=google.com; s=arc-20160816; b=ezOBkm3WLHxwbE7NWz50+sTBr8SZ3w3egCFM59apyDE4oDMRoqpZDFUTAzcvkCxmUQ 6JcumMP7nPo621DwIcDeGc23Zi6vENvxSrxPhfB1ZXLEJj01b61ufBkHPHSqmei/lPHt LlNm2xV3dYJNpBuitwS05EPkGvWkm8dqR6G5aKU8X73tyBuyc6lOeID1H+k9JO2nrKS5 AoXvVQo6oDOPXRSPC+a304IQb4eONqzVDupKwCI2nGoR1r1PG5kH1ZWRhPlB/MmnnkMh 1EANEs9lowTywBvk8CYUdCHwrgT7OFYO8S6is+vCYFuRPVs76e7iPr1VKr0kKj26vZJc fP0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=5NG+S2Te40crS8/qqZy9MjEvMMf6yrMyQR1qHko80WU=; fh=oO8OCoEnET5fCeP4yYnIpYYACKE1BfmKq8XZYrUaHGc=; b=OK+rbHbdNmMaNEQnim1v7O0oh5G7s5LtA8kmSnuDIBP2M0ERouVdc4VaUn25PQQJ45 7uUs0RKh/3HvDUZm7RD+pCAayEzGn/Qfc1G8I/9IxQYeobAbHMgZRxCCwwqE7ANiR25S eiTQAniu+NVhyE/ZzuaeI4Kqdt8qZ6vITaS2A47BEQVAA5oK8vL2Wd+cytR0CBPvbwI5 QZpQ78+nXjeDLUHG31zDh2SfdGoh7m2JuuswxCbCAFuHQnq35MqWpewrlnnYzqCpgQKU UDq2md9Lo7aHP8Lm4ijV+nC3j6ldRysUqVZEJ6sRy01tXaUZbepWgRSAst0RjB002CJA +rhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id w4-20020a170906384400b0097391f75082si12740799ejc.838.2023.07.17.07.20.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 07:20:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 340B13857707 for ; Mon, 17 Jul 2023 14:20:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by sourceware.org (Postfix) with ESMTPS id B998C3858D28 for ; Mon, 17 Jul 2023 14:20:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B998C3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp81t1689603606td1k344x Received: from server1.localdomain ( [58.60.1.22]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 17 Jul 2023 22:20:05 +0800 (CST) X-QQ-SSF: 01400000000000G0T000000A0000000 X-QQ-FEAT: PS/N6jJLnDZTesopcX1dg9uLoZZ8y3vEjzFJ9sQz5j+8yeShGIxn9hI5re86j MbT2xAjbiD7i6tQTbrFKmnP2dph9BeKGsf4PLtQgHnpLeGQCWRVkmUxadwXBwHArzVketJB h+FhQVoWUpOsP5pN9BSq7K9HdcO8TtsVxu5yoGWwbED+tBaDecLv48nu/U/QzQNyZQvvOh8 TcsVGgfJdKpVMK5IU1NanrVtdpv5BSQAy1nHZs+pioOuQ9GWr95t9RNGueQcnh7l6R+9IpH jQQV0kToioU9dL4V9QAJv/H5wdQDXTboHD9y4Mk937edUK4keqPBe1/SZSaRdhAyNo2UWIP H1TKuniqTkw54o3JP+McmuQrx4twXLGWkAzNOq+GJfXkDTqm/NLpHlSM/r9J7zE2l1pY11w pN2QIW+lptg= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 11691211917986755279 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: kito.cheng@sifive.com, palmer@rivosinc.com, rdapp.gcc@gmail.com, jeffreyalaw@gmail.com, kito.cheng@gmail.com, Juzhe-Zhong Subject: [PATCH V3] RISC-V: Add TARGET_MIN_VLEN > 4096 check Date: Mon, 17 Jul 2023 22:20:02 +0800 Message-Id: <20230717142002.295213-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771648167378576444 X-GMAIL-MSGID: 1771677839732004420 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_option_override): Add sorry check. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/zvl-unimplemented-1.c: New test. * gcc.target/riscv/rvv/base/zvl-unimplemented-2.c: New test. --- gcc/config/riscv/riscv.cc | 8 ++++++++ .../gcc.target/riscv/rvv/base/zvl-unimplemented-1.c | 4 ++++ .../gcc.target/riscv/rvv/base/zvl-unimplemented-2.c | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 6ed735d6983..82e7c27b057 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -6672,6 +6672,14 @@ riscv_option_override (void) riscv_stack_protector_guard_offset = offs; } + /* FIXME: We don't allow TARGET_MIN_VLEN > 4096 since the datatypes of + both GET_MODE_SIZE and GET_MODE_BITSIZE are poly_uint16. + + We can only allow TARGET_MIN_VLEN * 8 (LMUL) < 65535. */ + if (TARGET_MIN_VLEN > 4096) + sorry ( + "Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension"); + /* Convert -march to a chunks count. */ riscv_vector_chunks = riscv_convert_vector_bits (); } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c new file mode 100644 index 00000000000..03f67035ca4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl8192b -mabi=lp64d --param riscv-autovec-preference=fixed-vlmax" } */ + +void foo () {} // { dg-excess-errors "sorry, unimplemented: Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension" } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c new file mode 100644 index 00000000000..075112f2f81 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl8192b -mabi=lp64d --param riscv-autovec-preference=scalable" } */ + +void foo () {} // { dg-excess-errors "sorry, unimplemented: Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension" }