From patchwork Tue Jul 25 02:26:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 125263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2185087vqg; Mon, 24 Jul 2023 19:27:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFPCn3Nij90imSspiwYLMgcCnlrbd6kCE49F+ccQjwbE9YhKqzmpta6l8tPoj/zsbm/PTzn X-Received: by 2002:a17:906:77c8:b0:977:e310:1ce7 with SMTP id m8-20020a17090677c800b00977e3101ce7mr12054355ejn.38.1690252030660; Mon, 24 Jul 2023 19:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690252030; cv=none; d=google.com; s=arc-20160816; b=CBQ4sEe66DovuJeyOGHhOzUlrmrBa8edLqw8rOzqPVSGoSwOvUk/Y1XMVu5daKwt2g h7Ifi1Y738iXhFd9aimCucnkbEaaE7fXRE8k1bURd7d/b7pGEtUQZf11Lzsq1JGQea+4 dqxt1A+wJp3k6FvVDHk2mk13GSKUOijYbrQJm8jW58ErjiW9RpE34BW/qe3UQj1Ok9DN ccHXJR5xoBXE1QN9T1ytag3hmHQm/a0QM0Xh2FOU47QqI6S59iqflfqtiYUNNNm+mjDh Yqf44InNRXqcAQtBU5hpqlZwk2Rmf7ID1PwX7OWPx2gvmnBCQB7VuZ+JqnwznfEDBN2o I1hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=XAf28w+ICeYtxTZdxZWLi3FaQRP8OFaO54t+Nc0IY1E=; fh=53cJj9TBSYR/wgWr2Q2wXVHUGiHHr7QV00QtBv5db8E=; b=dUk2f3Vb+2q00g0ov8HRthdiTCsoYHXo6FoCsl54ACrKLeG3BKI8sNjPmUsEuW0r/A WAHM7ohmCW2VrTDJ9BLUdkfOUJ9TSFQYz3eWIN8d8A5rXEvzKT3q9bQ9nX7HrcRhC2tc FZFMvEd28W9plJ7ZmfQxPdfezuoXTyxltxuCa0lNp2hjtQ9TKshevEF+IjLsnn8f5VI0 FkG5NaIZsn8ktOB5QyvP1TE6sJ4pvNgLQYIVdSSsxoJkEFBnT3OIqljoNo3BQVOYP+gl q8jmK4gNlk+Bc6gV6HN3RVCQgnM6aMNHUFqqdiSGB3LWzIn0uhBE4a6LKkRNE+l0cpgS NDew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=YdKeSDCs; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id kg8-20020a17090776e800b009888aa1da13si7536928ejc.752.2023.07.24.19.27.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 19:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=YdKeSDCs; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BD5C385771B for ; Tue, 25 Jul 2023 02:27:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BD5C385771B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690252028; bh=XAf28w+ICeYtxTZdxZWLi3FaQRP8OFaO54t+Nc0IY1E=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=YdKeSDCsKYfeupuw8+Dnvzi8byhhUxBjl7pqe1c9rtAK6ONQjqZcuLRUABnvmbNCv pnKRNUX1cCbvoa38rXHl2wXmhXti0yGCJtwlAkFh825JJfK3eH9LkGMqZSBpSjIW/N Prmk++A7eUli/mAX2O7d06Zw4k8E/THEr6PyAEFc= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id EC78D3857835 for ; Tue, 25 Jul 2023 02:27:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC78D3857835 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 45115300089; Tue, 25 Jul 2023 02:26:59 +0000 (UTC) To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org Subject: [PATCH 1/2] RISC-V: Remove RV64E conflict Date: Tue, 25 Jul 2023 02:26:44 +0000 Message-ID: <8082a035470d6f4c204cc5c0a45ff5ab2394d136.1690251857.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tsukasa OI via Binutils From: Tsukasa OI Reply-To: Tsukasa OI Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772357713453272838 X-GMAIL-MSGID: 1772357713453272838 From: Tsukasa OI Since RV32E *and* RV64E are ratified, RV64E is no longer invalid. This commit removes a restriction that prevents making base ISA with reduced GPRs with XLEN > 32. bfd/ChangeLog: * elfxx-riscv.c (riscv_parse_check_conflicts): Remove RV64E conflict since the ratified 'E' base ISAs include RV64E. gas/ChangeLog: * testsuite/gas/riscv/march-fail-base-02.d: Removed. * testsuite/gas/riscv/march-fail-base-02.l: Removed. Reviewed-by: Kito Cheng --- bfd/elfxx-riscv.c | 7 ------- gas/testsuite/gas/riscv/march-fail-base-02.d | 3 --- gas/testsuite/gas/riscv/march-fail-base-02.l | 2 -- 3 files changed, 12 deletions(-) delete mode 100644 gas/testsuite/gas/riscv/march-fail-base-02.d delete mode 100644 gas/testsuite/gas/riscv/march-fail-base-02.l diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index b43d2cfa0fab..205dd0766abe 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1933,13 +1933,6 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps) int xlen = *rps->xlen; bool no_conflict = true; - if (riscv_lookup_subset (rps->subset_list, "e", &subset) - && xlen > 32) - { - rps->error_handler - (_("rv%d does not support the `e' extension"), xlen); - no_conflict = false; - } if (riscv_lookup_subset (rps->subset_list, "q", &subset) && (subset->major_version < 2 || (subset->major_version == 2 && subset->minor_version < 2)) diff --git a/gas/testsuite/gas/riscv/march-fail-base-02.d b/gas/testsuite/gas/riscv/march-fail-base-02.d deleted file mode 100644 index cfe085ab21aa..000000000000 --- a/gas/testsuite/gas/riscv/march-fail-base-02.d +++ /dev/null @@ -1,3 +0,0 @@ -#as: -march=rv64e -#source: empty.s -#error_output: march-fail-base-02.l diff --git a/gas/testsuite/gas/riscv/march-fail-base-02.l b/gas/testsuite/gas/riscv/march-fail-base-02.l deleted file mode 100644 index 52fee96af368..000000000000 --- a/gas/testsuite/gas/riscv/march-fail-base-02.l +++ /dev/null @@ -1,2 +0,0 @@ -.*Assembler messages: -.*Error: rv64 does not support the `e' extension From patchwork Tue Jul 25 02:26:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 125264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2185423vqg; Mon, 24 Jul 2023 19:28:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlF53KluNlPTZulRW0hcgtwChdBz6HYsIkg28F5x1Bu9/JH3zoeSfalTxQI6NzABafDyZrK1 X-Received: by 2002:a17:906:8476:b0:989:450:e565 with SMTP id hx22-20020a170906847600b009890450e565mr963856ejc.23.1690252089026; Mon, 24 Jul 2023 19:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690252089; cv=none; d=google.com; s=arc-20160816; b=Gp/O21VKTORVkQQo93u2qdIKjeNjPoc/kyvLPUkk6zWEqtX8h9YVM4bX7Tbp+XOC4v VlbCQDdU59+88taR1eKWL+X5akF7/t7h0b6sPt2pGicIo/MY+XDJgUtUJmjhn0JTiiDa hAqg/YJ2EkcU11UXEjeyXEcPZd9KEb7IE9ibm54yOpMOYso467cUNEDlywZrksXskeC2 GgtmvdNal76IPE44qGihFIirI7K1J3XjttqVTnVCbF8/JrhNcqyoj5J1ewjj+kyVpUqZ veQHPKAbwdEVqMGLnFZz57TiQz7j9B4NBCfIZx2xa6g1xDY9L86a9sW4UK9fsHk0EWNm oxkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=ANnG8Lbch7QcN2mfo+yxyx4kwJXcqadih2GujCqpnOU=; fh=53cJj9TBSYR/wgWr2Q2wXVHUGiHHr7QV00QtBv5db8E=; b=hkEYCPoMGXQew2OX9+Y1fGTkPWySqYzrX/euBbNWSd/8TcHBHhoD3KBsd8p2PqsoRh rBrIhOqmt6U8kZEtufuEKPphY1IEhm4ECy/CthFa9BtWUJw4XotvEDYv9xs1larjo8SE vIYiYq1eoNLE9EP9JIIGc+KtlHgaDwwnSmCqA1VN6S3eQfU0ugPXLvd6ypcfGWMDlRBq 3/MLGamIam7fA5fSP2rY8ne9lcNIOmMPePzuLuYhYAjnazK8dYll7PxhWY1yGcBRtKcn wecFlk0XldXKvknURC3euGD85HAKC0tFAvABtPbTZLJbcN+JE+CMBe97cLITxTJe6gmv nYvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=l+4MmToW; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y13-20020a170906914d00b0099399ac6fe0si6717881ejw.206.2023.07.24.19.28.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 19:28:09 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=l+4MmToW; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF92538582BD for ; Tue, 25 Jul 2023 02:27:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF92538582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690252078; bh=ANnG8Lbch7QcN2mfo+yxyx4kwJXcqadih2GujCqpnOU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=l+4MmToWQw9lab8S7wRwZ8f6V8ZLzkYQZFYFVcTLnz0y0AcW16474dj8Roi9W8QPV nn3U7gJF/3eFxsAYjue+v39azEbpfl11whrHYFsbR++IigHkPdM2z0mMJZuxYkNhJG 6Ia9sSoY9i/IF0fOSPU+ATO/hcV1Kq4bnyNvJ+AQ= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id AE5DF3857341 for ; Tue, 25 Jul 2023 02:27:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AE5DF3857341 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 0404F300089; Tue, 25 Jul 2023 02:27:09 +0000 (UTC) To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org Subject: [PATCH 2/2] RISC-V: Add "lp64e" ABI support Date: Tue, 25 Jul 2023 02:26:45 +0000 Message-ID: <9a77cb454bd020e0010fc02543e3d3ae7564eb79.1690251857.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tsukasa OI via Binutils From: Tsukasa OI Reply-To: Tsukasa OI Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772357774806256207 X-GMAIL-MSGID: 1772357774806256207 From: Tsukasa OI Since RV32E and RV64E are now ratified, this commit prepares the ABI support for LP64E (LP64 with reduced GPRs). gas/ChangeLog: * config/tc-riscv.c (riscv_set_abi_by_arch): Update the error message. (md_parse_option): Accept "lp64e". * doc/c-riscv.texi: Update the documentation to allow "lp64e". * testsuite/gas/riscv/mabi-fail-rv32e-lp64f.l: Change error message. * testsuite/gas/riscv/mabi-fail-rv32e-lp64d.l: Likewise. * testsuite/gas/riscv/mabi-fail-rv32e-lp64q.l: Likewise. Reviewed-by: Kito Cheng --- gas/config/tc-riscv.c | 4 +++- gas/doc/c-riscv.texi | 5 ++--- gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64d.l | 2 +- gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64f.l | 2 +- gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64q.l | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 80c14a3cd221..963f9967638f 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -384,7 +384,7 @@ riscv_set_abi_by_arch (void) as_bad ("%d-bit ABI not yet supported on %d-bit ISA", abi_xlen, xlen); if (riscv_subset_supports (&riscv_rps_as, "e") && !rve_abi) - as_bad ("only the ilp32e ABI is supported for e extension"); + as_bad ("only ilp32e/lp64e ABI are supported for e extension"); if (float_abi == FLOAT_ABI_SINGLE && !riscv_subset_supports (&riscv_rps_as, "f")) @@ -3897,6 +3897,8 @@ md_parse_option (int c, const char *arg) riscv_set_abi (32, FLOAT_ABI_QUAD, false); else if (strcmp (arg, "lp64") == 0) riscv_set_abi (64, FLOAT_ABI_SOFT, false); + else if (strcmp (arg, "lp64e") == 0) + riscv_set_abi (64, FLOAT_ABI_SOFT, true); else if (strcmp (arg, "lp64f") == 0) riscv_set_abi (64, FLOAT_ABI_SINGLE, false); else if (strcmp (arg, "lp64d") == 0) diff --git a/gas/doc/c-riscv.texi b/gas/doc/c-riscv.texi index b175ba0a7293..e7fdbfa22afb 100644 --- a/gas/doc/c-riscv.texi +++ b/gas/doc/c-riscv.texi @@ -65,9 +65,8 @@ aren't set, then assembler will check the default configure setting @item -mabi=ABI Selects the ABI, which is either "ilp32" or "lp64", optionally followed by "f", "d", or "q" to indicate single-precision, double-precision, or -quad-precision floating-point calling convention, or none to indicate -the soft-float calling convention. Also, "ilp32" can optionally be followed -by "e" to indicate the RVE ABI, which is always soft-float. +quad-precision floating-point calling convention, or none or "e" to indicate +the soft-float calling convention ("e" indicates a soft-float RVE ABI). @cindex @samp{-mrelax} option, RISC-V @item -mrelax diff --git a/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64d.l b/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64d.l index f7306cb24d20..419a01d5d53a 100644 --- a/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64d.l +++ b/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64d.l @@ -1,4 +1,4 @@ .*Assembler messages: .*Error: can't have 64-bit ABI on 32-bit ISA -.*Error: only the ilp32e ABI is supported for e extension +.*Error: only ilp32e/lp64e ABI are supported for e extension .*Error: ilp32d/lp64d ABI can't be used when d extension isn't supported diff --git a/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64f.l b/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64f.l index 706690ac9c64..7b2fcda8d685 100644 --- a/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64f.l +++ b/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64f.l @@ -1,4 +1,4 @@ .*Assembler messages: .*Error: can't have 64-bit ABI on 32-bit ISA -.*Error: only the ilp32e ABI is supported for e extension +.*Error: only ilp32e/lp64e ABI are supported for e extension .*Error: ilp32f/lp64f ABI can't be used when f extension isn't supported diff --git a/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64q.l b/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64q.l index ab64b1546f63..a06e9ea1aa93 100644 --- a/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64q.l +++ b/gas/testsuite/gas/riscv/mabi-fail-rv32e-lp64q.l @@ -1,4 +1,4 @@ .*Assembler messages: .*Error: can't have 64-bit ABI on 32-bit ISA -.*Error: only the ilp32e ABI is supported for e extension +.*Error: only ilp32e/lp64e ABI are supported for e extension .*Error: ilp32q/lp64q ABI can't be used when q extension isn't supported