From patchwork Tue Feb 28 05:00:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Sinan X-Patchwork-Id: 65722 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 954453858434 for ; Tue, 28 Feb 2023 05:01:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 954453858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677560474; bh=I8ZyVVtmi76lWT32gi8HpQy5eG1Jerem/qm7cQucuvo=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=dQQPsuA3BpSrQEPYDzqGFLx7xsg5gN7oHayJD8IMg4rtPqQPz+8hbnXsbFUHvnU5G TQa+oG3SoL6sObbsDTyc8bhyESC3E0kebjx3zMpBS6LFWsYW0RTzwiFvinWwXYW6t/ /Jr+Lr8Sxb+g08OGPbs2VQ45/fhGdTiQtMiOAMVU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 8D58C3858D39 for ; Tue, 28 Feb 2023 05:00:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D58C3858D39 Received: by mail-pj1-x1029.google.com with SMTP id u3-20020a17090a450300b00239db6d7d47so1315694pjg.4 for ; Mon, 27 Feb 2023 21:00:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=I8ZyVVtmi76lWT32gi8HpQy5eG1Jerem/qm7cQucuvo=; b=AeRTJ85txGS1zkojSGjuXWnYE/u+aH3twD1a3QYzWMNns/HlrTlQqLRqyR9jIKSV+1 ToHVepW/d8Mz8mKsj+eEiaGpxWzy9xi7k663vwd8jFdB+KbOmLoIOKKlJSAMaWiQ6mZb 840U2VZgLyM4PDewiK+MSGaIf86S8euoZJ7drZWnQLo8FQrb5FsdYt2MSjNdle4gfy6a wBrLNw/dk2NKBHjuu3D7BnW9SRKLsyMoTFU5Hb4B/I0jZpVQlJClfngzUNPCJJEjwpdA nIma+xQq08llTYcECGY9RjzidQq7u7/TksLTb2OlYaCFLjUrt93WkSxHCbZ8hqe4g5R3 vzEw== X-Gm-Message-State: AO0yUKVdjxtm1vy1I7jJOMSQ68qJVJz4k36TzKj2N/opebXt7onWwY6Z vxBy8HXkLcUEOE+ZxYM4PGe6GXUh0T5ueJOjyhj5mA== X-Google-Smtp-Source: AK7set/0D6WxBI0HbVACE6JPvRmiZ7nzZnvv26dDOn6OmIqvm82BLlL4Fc64bYJiK76zVTUWiPR26g== X-Received: by 2002:a17:90a:7b8b:b0:234:289d:5e69 with SMTP id z11-20020a17090a7b8b00b00234289d5e69mr1352817pjc.2.1677560444263; Mon, 27 Feb 2023 21:00:44 -0800 (PST) Received: from localhost.localdomain ([47.246.101.59]) by smtp.gmail.com with ESMTPSA id g2-20020a170902868200b0019a5aa7eab0sm5418821plo.54.2023.02.27.21.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 21:00:43 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: philipp.tomsich@vrull.eu, kito.cheng@gmail.com, palmer@dabbelt.com, andrew@sifive.com, Lin Sinan Subject: [PATCH] RISC-V: Fix wrong partial subreg check for bsetidisi Date: Tue, 28 Feb 2023 13:00:36 +0800 Message-Id: <20230228050036.30601-1-mynameisxiaou@gmail.com> X-Mailer: git-send-email 2.36.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, FREEMAIL_FROM, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lin Sinan via Gcc-patches From: Lin Sinan Reply-To: Lin Sinan Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Lin Sinan The partial subreg check should be for subreg operand(operand 1) instead of the immediate operand(operand 2). This change also fix pr68648.c in zbs. gcc/ChangeLog: * config/riscv/bitmanip.md: Fix wrong index in the check. Reviewed-by: --- gcc/config/riscv/bitmanip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index 14d18edbe62..58a86bd929f 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -442,7 +442,7 @@ (ior:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r")) (match_operand 2 "single_bit_mask_operand" "i")))] "TARGET_ZBS && TARGET_64BIT - && !partial_subreg_p (operands[2])" + && !partial_subreg_p (operands[1])" "bseti\t%0,%1,%S2" [(set_attr "type" "bitmanip")])