From patchwork Mon Jul 8 17:20:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edwin Lu X-Patchwork-Id: 1958077 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=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=eK0O4tfo; 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 4WHrWB2nCRz1xpd for ; Tue, 9 Jul 2024 03:21:10 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A070384AB4C for ; Mon, 8 Jul 2024 17:21:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 42F043858427 for ; Mon, 8 Jul 2024 17:20:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 42F043858427 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 42F043858427 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720459246; cv=none; b=HrfJfMHBIgxLtQVpYMCuzrL/nbvnKGBWH3u6rl14G2sgatxceTOC/MIqevYxQEJQ4kN7aFnqydvoM9CBvBuNje7Lf6vvJgdmCpdDETedpqE43VnOQeCCWJWC6qY8Hp/QMeQkecNhMYoJdqA/S8uBzJk5NwhezQTmRZx4l71o7Ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720459246; c=relaxed/simple; bh=STWirEIaBbo3Gp0Kl0Gw9/exQDDn6d/J9074T4Fy7UA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=rGlB8x2atOPUq0kHKtl1QYDObMBpKbNqZkG1iko6ROynU7X7uthm96Ly+dWzte+AxhMIEBVwUq5pxLsIbzgRaNixw/0JGxx92u4Vz6LhBPjxCIolbyck8XOpjXQNqne33PJsyWkAwqItHaWuDC9oC4cHBVbgku5p/vrejskh8qg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3d92645883cso1491179b6e.2 for ; Mon, 08 Jul 2024 10:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1720459243; x=1721064043; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0pjdPtlrkaGILHsHBT9Q+GatPO6+ce6SLqzZtEe5upg=; b=eK0O4tfoTI6+YxXIG6gKmevy1c0FVYAXgJcsJYuKov8n9sVbx0OEFVHe7VzY5FvXxv Oe4A4lQtFBMpLQaSJ6fZtfsPhEl5W5dEDJglIQ2zeL6Y8wyj2y59zHoxBWrk6CcIzJ7e XdyUeDJ/c7jcA8TzyHobXvqpCW81EhnERbjyt+cNYATyTE9QASu2/Ihk67R+SM/msCaA fMB/6zfA9SmYNkCsbt5cGiRLq3KMs/gT1ZIHiyG36+VIJzxMNDpSHypZaExesCS77lTY SObtvTa4QintJ+ngmfLQw68jFyeaQAqWjr6x16gI6eKAGx7D9DgYQ83QtfYX+0rQZ+ao 9Mig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720459243; x=1721064043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0pjdPtlrkaGILHsHBT9Q+GatPO6+ce6SLqzZtEe5upg=; b=jf+RoHX59148Ub15ItAGgvlHYsrFzfPZ60XNYGGCjdiZ2ef+6/vNz3q98GUTdz936Z XMWcR27Vxj0uAYXPi9rxljQAqEEvmwg2O7tad6a7i1L2qblunfbwB3GoD55LB0nkfydV 3scd8nlt905cOxQtK6yuP0khnSzkTSEV9rTvFTVFp2BNEB5tUyPJVt1O/xQEemPR2zJr Vw8xHRXQauO8ZHsZy3qVgBzE8ZIQr6Ay3m+I0OgWj2uVW/VEOt7G3qqEJCSRoTRctTcS eROqcTU185CSKSzGeoxEFofaeB0C5kLzVr0lfwrdaQflpxuhSP1jwAY2072ySbd4yQbV 7y2Q== X-Gm-Message-State: AOJu0Yy8XrpH344fvBaydNX3nrQwzLMgZsISLIHJQoi3dHcFf1Edcyzr 8moAfXPFmJCCRx/cgKi+HxSD0pyF00+E78+9pZDJb8zl7VGFpCLEpWMYNem+yzDbaL7LbHm/Q22 s X-Google-Smtp-Source: AGHT+IFSV4vyta7qgmWcJVhd9atK/yEoUO0BXYhS4MqYRqfN+dyxnqykqbbgjvC1H6kxjZMWyTNoQw== X-Received: by 2002:a05:6870:c112:b0:259:8b2f:8d76 with SMTP id 586e51a60fabf-25eae7efc0amr30336fac.20.1720459243185; Mon, 08 Jul 2024 10:20:43 -0700 (PDT) Received: from ewlu.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b4389a37fsm125056b3a.19.2024.07.08.10.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jul 2024 10:20:42 -0700 (PDT) From: Edwin Lu To: gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com, Edwin Lu Subject: [PATCH 1/2] RISC-V: Add support for B standard extension Date: Mon, 8 Jul 2024 10:20:07 -0700 Message-Id: <20240708172007.3695827-2-ewlu@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240708172007.3695827-1-ewlu@rivosinc.com> References: <20240708172007.3695827-1-ewlu@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 This patch adds support for recognizing the B standard extension to be the collection of Zba, Zbb, Zbs extensions for consistency and conciseness across toolchains * https://github.com/riscv/riscv-b/tags gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add imply rules for B extension * config/riscv/arch-canonicalize: Ditto Signed-off-by: Edwin Lu --- gcc/common/config/riscv/riscv-common.cc | 6 ++++++ gcc/config/riscv/arch-canonicalize | 1 + 2 files changed, 7 insertions(+) diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index b9bda3e110a..df7f33b7486 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -84,6 +84,10 @@ static const riscv_implied_info_t riscv_implied_info[] = {"zabha", "zaamo"}, + {"b", "zba"}, + {"b", "zbb"}, + {"b", "zbs"}, + {"zdinx", "zfinx"}, {"zfinx", "zicsr"}, {"zdinx", "zicsr"}, @@ -245,6 +249,8 @@ static const struct riscv_ext_version riscv_ext_version_table[] = {"c", ISA_SPEC_CLASS_20190608, 2, 0}, {"c", ISA_SPEC_CLASS_2P2, 2, 0}, + {"b", ISA_SPEC_CLASS_NONE, 1, 0}, + {"h", ISA_SPEC_CLASS_NONE, 1, 0}, {"v", ISA_SPEC_CLASS_NONE, 1, 0}, diff --git a/gcc/config/riscv/arch-canonicalize b/gcc/config/riscv/arch-canonicalize index 35a7fe4455a..2ea514dd986 100755 --- a/gcc/config/riscv/arch-canonicalize +++ b/gcc/config/riscv/arch-canonicalize @@ -45,6 +45,7 @@ IMPLIED_EXT = { "zabha" : ["zaamo"], "f" : ["zicsr"], + "b" : ["zba", "zbb", "zbs"], "zdinx" : ["zfinx", "zicsr"], "zfinx" : ["zicsr"], "zhinx" : ["zhinxmin", "zfinx", "zicsr"],