From patchwork Mon Jul 17 06:04:23 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: 121045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp929247vqt; Sun, 16 Jul 2023 23:05:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlFIn46iT6sO1szSmjyx1BFOjq9oz+yuUExULRKEj4xMxZfS+r5s/9gbz5DGN2QvQk/XB4pt X-Received: by 2002:aa7:dad4:0:b0:51e:278a:3627 with SMTP id x20-20020aa7dad4000000b0051e278a3627mr11846525eds.7.1689573905243; Sun, 16 Jul 2023 23:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689573905; cv=none; d=google.com; s=arc-20160816; b=WQEUGC6wjCWcPkWFxk+dNhUK592zFFjc23pUC7CSMf+s+xbPtKNaUMLGEPrRzRYfpc B9oVOKya1wEiD0d9FOgwT0LmCWhoE27SXe7jd/GbHwBqqDHsEOPMFzR5QDGz3mu0/EA5 NLIVWZyIljlGonbHrxifoq6jQKPeJBEUyGMsiXjHtdHuE2lkdFGU4S2TCXiNd0cxdXwM 5SE57rzms+3k4kAnqjmkuVVRDn3eDzR6aln5gghu9sws5R47DLLUbRuYBiUGNjjehQXN DR0l6DKaoW3kBq55zUa8DVLbQx4kqktti1g3zPX859l9d31eQHeZ27V6T10jNMalecae 4gqg== 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=2aSoplRQ6cUpNRFeAFJ9FjzujgnVh7CpMEDwhQ9/Q9Y=; fh=A5KfYyLae2VJud+3//iVCX8Ygg3g2cCQTl1Ix4k544I=; b=MIZRMso5CKialfwMtp5n6esUfRBfQGRekD9fO0PFU2KG6JA1zDaIZh3mjn9BRfo080 OsBjQNwVZK/A+GpwOgO59BMw+ivXwZXzFIhbhcZdZVdQwv5nLsZCbgHPq6y5/FFLu/+Q 44aru2z57S+D8pKIcyjjQdJsXftB8ZynvwnhbEfoZTkseVpEp6bPmjabyoIqTfSsJUES Fh4GYyMS7YELaqO/QNDo06j9copym3WJ8fePt2Luydru55xtGvNy0xJ/WJRgozM1n6Vz lCCFxA9rB9SwEYc8nQmuJcQioHtCYDBo8yMywcxIXEAqK0yWItNVGkPU1IarkBiH7tL+ r8PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ba4-20020a0564021ac400b0051e26b9696dsi14067567edb.518.2023.07.16.23.05.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jul 2023 23:05:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 40DFA3858C2A for ; Mon, 17 Jul 2023 06:05:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by sourceware.org (Postfix) with ESMTPS id 2B12A3858D1E for ; Mon, 17 Jul 2023 06:04:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2B12A3858D1E 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: bizesmtp91t1689573868tf6g8swm Received: from server1.localdomain ( [58.60.1.22]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 17 Jul 2023 14:04:27 +0800 (CST) X-QQ-SSF: 01400000000000G0T000000A0000000 X-QQ-FEAT: zT6n3Y95oi1bOmOdz3TO+x9uH1iDsckXDiUXqYmU4GpTkseChL9JXEbHqlkLg CQHQr/C2y4ffV2TlnrWN+xOc1MHw9p1Z1w8WBmgNpcUfgwsZhHfuX/RShSFPWkrAnIeff4n 6MtrFipB4ezyNkCOqBKbr1Sq/4YhzQGMRh7TUDEP/hvqmSTq02Boqf7At6Ofymzpr0DZXsM Kd97NjwbxA9jZ0i9UodGgmBuwy5NglciCLnVSDJE79N9gxtKNF6J3Qm9rauAYlzyrGcSgxi pF8WVI5JpKeerecZ8TEMTevOGoIWwMnv2jHzzAegB26mPlbpJrNbPAKJ7Wd232egISFeFk1 YEB8QR9Uyc6mCilU2iMRj7mE6myXQkfyGRWPxJVIQ13CLve6lFEFjedzIzLLpRDb9cu27Ov X-QQ-GoodBg: 2 X-BIZMAIL-ID: 285459182590708209 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, palmer@dabbelt.com, palmer@rivosinc.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [PATCH] RISC-V: Add TARGET_MIN_VLEN > 4096 check Date: Mon, 17 Jul 2023 14:04:23 +0800 Message-Id: <20230717060423.31423-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, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, 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: 1771646647027125214 X-GMAIL-MSGID: 1771646647027125214 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_option_override): Report ERROR for TARGET_MIN_VLEN > 4096 --- gcc/config/riscv/riscv.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 6ed735d6983..ce523eea9ba 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) + error ( + "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 (); }