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: 62266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2816388wrd; Mon, 27 Feb 2023 21:01:31 -0800 (PST) X-Google-Smtp-Source: AK7set+nPLtEOafUodr5fyIsTwEWzt3d4EDSzlOM9X9zYj9efM4oQ6ESTE1wtKQQMjqylv5DqTFy X-Received: by 2002:a17:906:9b89:b0:88e:e498:109b with SMTP id dd9-20020a1709069b8900b0088ee498109bmr1435192ejc.5.1677560491033; Mon, 27 Feb 2023 21:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677560491; cv=none; d=google.com; s=arc-20160816; b=omElKt4mvv7Z6F8LGQ+FbLW+7lSaHuZsnmtSv5akV5gQs4FK4gYiDtA+VOODIv07TS QLuLwUK3etN54YAUNZr4sFSJ0Lhj4inRBcAp1lFGphqe3XLlmdI2y2X+Xr9f3rF0RXWB aCw9smOlCjU7ngxnTpIRDLlGQBHbEPmsVi1nEMFtnUVMVt1q0wMDWPFR7uY22LdWM5ym p8NkvFrG9g0NOxORRrUgK3q8+5LPLqitNduVk1H9jBtm+RyfwCASCN304hX/oddXVZ2D S8ArhFCNqzBVs6Z7NYsotclwsTuZGv7B74bLxedXZAGPnjWWiJLCxI20OI5eKhGH8HHc hSXQ== 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:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=I8ZyVVtmi76lWT32gi8HpQy5eG1Jerem/qm7cQucuvo=; b=jpdYNHzYrOA0zsT3ZqA9GhGLtS8Xd6zhDZDwgERvvStpCocYV5rJ4ZLPNTe2JZccQv dYA9leu4CqdLPuLvlwEofYkmiUs89SpWBXZ+quf+m3oVYXMDSkBYlfZkUK8d+K/0YGTP R8Bor+5mGlvFkwolyCcAVGxZeQMwSBJ22Y09V/fYX2NYUWBgYHgLBSiOE7BsSnGzknmb JRXAUCn08mPinjtAdfsljRbtI5UzPvUC5aagfsbQVI6mE9ko+RZttQY+9Xu+ElR3xEOf hpZlnlFI8V0v1sOy6UapnMdo6Pxs+aBsTAR3hcBQXmIMYzvixKQYzr09bFuIf5v7Id80 o0IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ct4f7cOe; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v25-20020a1709060b5900b008ec437119f4si304937ejg.332.2023.02.27.21.01.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 21:01:31 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ct4f7cOe; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C34163858407 for ; Tue, 28 Feb 2023 05:01:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C34163858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677560489; 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=ct4f7cOeYS1rTB2Wnm0zJTLrZ5cA9Q6NloVTnwPVtjEsh5wvzVYdiv7xF39kAbiGt U0SwDcXK4yquMfIWLam4n2DXWolMzxLV/x6a1f7BtsOb4yzH/m1Yrtfj9BQFcfbls+ KcNG/YfRlU8Y0i8vpVrEajJp9P4npmd/RCrr+1qk= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759049669515457898?= X-GMAIL-MSGID: =?utf-8?q?1759049669515457898?= 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")])