From patchwork Sun Apr 28 23:04:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 1928739 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=vrull.eu header.i=@vrull.eu header.a=rsa-sha256 header.s=google header.b=cmTp3FZr; 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 4VSMW315zSz1ymX for ; Mon, 29 Apr 2024 09:05:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B5703858C60 for ; Sun, 28 Apr 2024 23:05:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id CC4CD3858D35 for ; Sun, 28 Apr 2024 23:04:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC4CD3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CC4CD3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::233 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714345497; cv=none; b=BezxtKwwCeRbzdC+aC60d37upd1M1iPSWz5035Be5xDo32LLLldkDb1e3tf7PXA0vV3L/IA8Qd47Cv1YbM0kmEU2FGUoWpdXFaC0GYlueukdKHZsbscYHOIiVS+mSEp4qJXAkrpj846hqhTCl0HNOZDQZOR80J+VcT2rYlVvQL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714345497; c=relaxed/simple; bh=S32Jo8mUEBmjalwRb+AX+T+Oh2CI1ObiTAzQgSF6NBI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uxY76XUxef/b3Ykgh5starrJ5po91Cg6p1H8lgwlhGL39G5MBHkSKOPhUPet5xzWJezTMpboeARA8leZZN3SMtDA2uu2Icj3rcETjO4oLDVsSCrn/pcFLtOhu7tEj2m9nHnvGvjamQ6dXY0j4GZohDqfYTbHIkYoBdFoYqAiDQI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2db101c11beso43758211fa.0 for ; Sun, 28 Apr 2024 16:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1714345491; x=1714950291; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zWt1MajeWKqciFZoSl/b+zrB36KWuUhOai1PwR8QhAo=; b=cmTp3FZrWZG5omYWLNg6JEd9DVST4Qr0LYN46Rfq3ENWSrChf76Qbp2IDwKtPIYAvK LCo4GDu3GIPZ9KevCAMKYgVQhtMbYbcDf1h3eU7xZB1wpzC7OYSnwhDxPhJKv3HQt916 GSZz0sD+WgsP3OQGWOZEfKYbxRIPWe4r0NPv6a0D4R8ujmrzRRs+xSqjrk8M+DGKSUtk lpcpta1Ji+B2moWChWEfIOUMjQY9zrVZBXG2Ewj88dv3Latkt47/BNMmWRSUbQ/zuosS eK/wd1p5gMquPWZBRYrvKuER+c+jxyWgDbRUXuBdsaJmhOfVY7hD/GQUF+cqTQsn1iTM G7iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714345491; x=1714950291; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zWt1MajeWKqciFZoSl/b+zrB36KWuUhOai1PwR8QhAo=; b=XzzYa8b5b0J4REZV5u7GTZ8sLvN8B90bZ+PHZgt7Pqh1QtwtXI6Jn5a+Y87f58Ss1G AfHNZbh0qOX4/TMa1CoLxZW7bmS0wnf/cUzcZdN/pJ8DzkpdZKpXfa67++It4y/Zv0iD 8GBp6ipvAwXV2Ree2y0iokqZL6uuEeYIZ8wJb5L+5cfKMtBvyHMQ9ex86NZ/i5pOrRwv KhgWkhA7wNgH9tUNx9R/pJweEnk6juLirNwzwltDXlXy9bxaAP4HeG9I43LiZ072VQS0 XqMd5qVSHhmmjqW02pPJcRJgCiPC2TMyyW9AwKNp1CiooYqNJB8NLrCyM99WbJ7M9Pj3 7tIQ== X-Gm-Message-State: AOJu0YwNMTwpRwCLRZq0fntBPJP6uQoDSwLzZHb4uHBNg6ebgfzTOFvE Kqd7aT91KhOUlHgY75k6LM1SvOWHJffhGPG3rtq2HxlEKVAso15YqZwynqCzfYo7gNcnt/toGks HsUg= X-Google-Smtp-Source: AGHT+IH2wrkx9GqZKdqPnnPXhv9U9b/Xy/C5CWjUlRfNSD2k4cAzZBPGhLeUEhuThVi8DKziiOuL1g== X-Received: by 2002:a2e:b0c3:0:b0:2e0:12f1:f827 with SMTP id g3-20020a2eb0c3000000b002e012f1f827mr1734400ljl.43.1714345491427; Sun, 28 Apr 2024 16:04:51 -0700 (PDT) Received: from antares.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id ds2-20020a0564021cc200b0057059d26756sm12420941edb.76.2024.04.28.16.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 16:04:47 -0700 (PDT) From: =?utf-8?q?Christoph_M=C3=BCllner?= To: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Jeff Law , Monk Chiang Cc: =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [PATCH] RISC-V: Fix parsing of Zic* extensions Date: Mon, 29 Apr 2024 01:04:45 +0200 Message-ID: <20240428230445.855337-1-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, 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 The extension parsing table entries for a range of Zic* extensions does not match the mask definition in riscv.opt. This results in broken TARGET_ZIC* macros, because the values of riscv_zi_subext and riscv_zicmo_subext are set wrong. This patch fixes this by moving Zic64b into riscv_zicmo_subext and all other affected Zic* extensions to riscv_zi_subext. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Move ziccamoa, ziccif, zicclsm, and ziccrse into riscv_zi_subext. * config/riscv/riscv.opt: Define MASK_ZIC64B for riscv_ziccmo_subext. Signed-off-by: Christoph Müllner --- gcc/common/config/riscv/riscv-common.cc | 8 ++++---- gcc/config/riscv/riscv.opt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 43b7549e3ec..8cc0e727737 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -1638,15 +1638,15 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] = {"zihintntl", &gcc_options::x_riscv_zi_subext, MASK_ZIHINTNTL}, {"zihintpause", &gcc_options::x_riscv_zi_subext, MASK_ZIHINTPAUSE}, + {"ziccamoa", &gcc_options::x_riscv_zi_subext, MASK_ZICCAMOA}, + {"ziccif", &gcc_options::x_riscv_zi_subext, MASK_ZICCIF}, + {"zicclsm", &gcc_options::x_riscv_zi_subext, MASK_ZICCLSM}, + {"ziccrse", &gcc_options::x_riscv_zi_subext, MASK_ZICCRSE}, {"zicboz", &gcc_options::x_riscv_zicmo_subext, MASK_ZICBOZ}, {"zicbom", &gcc_options::x_riscv_zicmo_subext, MASK_ZICBOM}, {"zicbop", &gcc_options::x_riscv_zicmo_subext, MASK_ZICBOP}, {"zic64b", &gcc_options::x_riscv_zicmo_subext, MASK_ZIC64B}, - {"ziccamoa", &gcc_options::x_riscv_zicmo_subext, MASK_ZICCAMOA}, - {"ziccif", &gcc_options::x_riscv_zicmo_subext, MASK_ZICCIF}, - {"zicclsm", &gcc_options::x_riscv_zicmo_subext, MASK_ZICCLSM}, - {"ziccrse", &gcc_options::x_riscv_zicmo_subext, MASK_ZICCRSE}, {"zve32x", &gcc_options::x_target_flags, MASK_VECTOR}, {"zve32f", &gcc_options::x_target_flags, MASK_VECTOR}, diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt index b14888e9816..ee824756381 100644 --- a/gcc/config/riscv/riscv.opt +++ b/gcc/config/riscv/riscv.opt @@ -237,8 +237,6 @@ Mask(ZIHINTPAUSE) Var(riscv_zi_subext) Mask(ZICOND) Var(riscv_zi_subext) -Mask(ZIC64B) Var(riscv_zi_subext) - Mask(ZICCAMOA) Var(riscv_zi_subext) Mask(ZICCIF) Var(riscv_zi_subext) @@ -390,6 +388,8 @@ Mask(ZICBOM) Var(riscv_zicmo_subext) Mask(ZICBOP) Var(riscv_zicmo_subext) +Mask(ZIC64B) Var(riscv_zicmo_subext) + TargetVariable int riscv_zf_subext