From patchwork Tue Jul 25 01:56:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 125259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2172921vqg; Mon, 24 Jul 2023 18:57:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlENMFXgqTl7DCRtKZBwa84+MSGNP80IiSOT789dQbyGH8LL572AckUhguUjdLCUJx5yIYfN X-Received: by 2002:a17:907:7791:b0:992:ef60:aae0 with SMTP id ky17-20020a170907779100b00992ef60aae0mr12390044ejc.54.1690250231869; Mon, 24 Jul 2023 18:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690250231; cv=none; d=google.com; s=arc-20160816; b=i5lyelCAOZTGZenJRCw8I6fnrudQHUvTiopJGnh2gsHeH2jR0bfmgcdEcRbhvrGW+Z 6CTwcRM2wGSRN/HTDAe242QeXlWGxtv2vLH4+LRJtUQFjDdO0VIPHN0Q37bAtm2qAwjF t3Y1B0UaGqwufIB62voLNixgTwgYHf6kUEOyMV9khovOwWfKPSq+cnCG8hnMxnj9JNs4 b0w2MUn7evdPqSOIOBwP/7H9RvAv8bCXKfYLGrdl+zbaIzweR8WhMeEAenVJUrAQpyIr A9rPrSEKXuLsIns4uwTD8ssjADR0vAdVY6xpGF/iMV+Jyua3NQZThuVPV2Gz++V8WxiE /kCQ== 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=Nk9fMdiqX/SaIIH4sjVSL+A6gwjvHymW1pbfb7puXBc=; fh=53cJj9TBSYR/wgWr2Q2wXVHUGiHHr7QV00QtBv5db8E=; b=epf7pEqdhEYJJMS6wHZdJtG2SgqmNzcdo8hr6UnI18p1DP94oyk/a3pkf5xHQqouxp KPQZw8tRvFmsXNWEu3D9jXDKSsPHFB/H0EHq1NU9P9vx9Jve1FAy0Iq1T//yC0ib12db Mn09J0jCv/4GD9JPKdPb3zhc8MA8WPf+FNox+lsAXf6PEBzQCN5KeTNW8G+w909D+JmS xuaessaDsRssJ5hbmG8qTlz1POmD8kLZYSdGRuONZeiCG4L4nbbvc2BPY38ptZvKqDUl UQr93h9u3wXd/nehZk1YzjVF4D0EgQolCjo+QxjTWke8qdla27p/mZZCyB7K8LHYAP2O unOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=fnzjZKfF; 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 ss20-20020a170907039400b00992d262ff61si7160400ejb.989.2023.07.24.18.57.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 18:57:11 -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=fnzjZKfF; 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 A44E93857835 for ; Tue, 25 Jul 2023 01:57:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A44E93857835 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690250227; bh=Nk9fMdiqX/SaIIH4sjVSL+A6gwjvHymW1pbfb7puXBc=; 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=fnzjZKfFx6t9SR73H860rZDWombBDaiSN76o8OLfHQBWp7yTwEzD7DO7OP4+fiOJr fvt2S+T/QYLwHfbH53hX2pt4YhR+cU1UsgDm4WzmPMVMfi3RQfJraORAxkPTW7lqeF 0TXsukh7flj4b/cAZ2TUBQ8cIdidFO0mf7HbXPxA= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 96E8C3858020 for ; Tue, 25 Jul 2023 01:56:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96E8C3858020 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 9B84E300089; Tue, 25 Jul 2023 01:56:57 +0000 (UTC) To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org Subject: [PATCH 1/1] RISC-V: Enable RVC on ".option arch, +zca" etc. Date: Tue, 25 Jul 2023 01:56:28 +0000 Message-ID: <695776dc2f43c56dd2ae2f7036fb7cf74e19b46b.1690250175.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: 1772355827376191374 X-GMAIL-MSGID: 1772355827376191374 From: Tsukasa OI Since the 'Zca' extension is the new base of the compressed instructions, this commit enables RVC *also* when the 'Zca' extension is enabled via ".option arch" directive. gas/ChangeLog: * config/tc-riscv.c (s_riscv_option): Enable RVC also when the 'Zca' extension is enabled after an ".option arch" directive. --- gas/config/tc-riscv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 80c14a3cd221..aaf8b9be64fd 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -4376,7 +4376,8 @@ s_riscv_option (int x ATTRIBUTE_UNUSED) riscv_reset_subsets_list_arch_str (); riscv_set_rvc (false); - if (riscv_subset_supports (&riscv_rps_as, "c")) + if (riscv_subset_supports (&riscv_rps_as, "c") + || riscv_subset_supports (&riscv_rps_as, "zca")) riscv_set_rvc (true); if (riscv_subset_supports (&riscv_rps_as, "ztso"))