From patchwork Fri Sep 6 10:02:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ma X-Patchwork-Id: 1981741 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=EnCjoNgF; 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 4X0WyQ6DKlz1yh1 for ; Fri, 6 Sep 2024 20:03:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A11CB384A49D for ; Fri, 6 Sep 2024 10:03:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by sourceware.org (Postfix) with ESMTPS id A79F33858CDA for ; Fri, 6 Sep 2024 10:03:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A79F33858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.alibaba.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A79F33858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=115.124.30.119 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725616987; cv=none; b=NVa7PcauBGPAhN/U8RvXYZBPMt2A1yECT6CACa0UDEKN7gkHINvvMxvX8WS9qya3oCV58mN76b3n88T9SlkxFdDqIw4zSkwKcU2b0zwX8rIcnww9coEtH/GJZDJy3xXIdAR4mfMzxaBk77Y4vF2gO11+VC3yz3avA/OpffnZPEc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725616987; c=relaxed/simple; bh=UbyohtYuMTCYqAsgOLNr4gLE/ZCM9QktjK7eOTD3oZ4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=tgkFz4h6Nd+tO/k+lixebo/qJOLnsAAdKuPbqbuKJBIiiE3egKz/jRDrjQNbF9FkKniAlZ77+ccH3uNDN8vXEYJpmUmp46CfrOlguQaxn4eUo5SQzdiWrtonL/FTU28jsTHm5YWb9skCpnQjzJgheprrZi1Bd5GNAguhgl6DN/w= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1725616979; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=I3oexJ5KXSeEMIvrIQHtUZIdWq9IdfaMdcvvxBLiZUE=; b=EnCjoNgFR/g8B3DD8KKbduAlJG4Z0vNh59RoYWOiwgmX0R03C+JLCkue85dnk80QTlrn6faJ4CHlMlijdThQEOi7j8PpKo/fN3K9GgVsxQOhZI8hbPPYLggKEE/9a5vc5K2O8/bGf9WB9xRRi3GHjY4JPHyMa3nGw3IZ5jllKpU= Received: from localhost.localdomain(mailfrom:jinma@linux.alibaba.com fp:SMTPD_---0WEPAbVm_1725616974) by smtp.aliyun-inc.com; Fri, 06 Sep 2024 18:02:56 +0800 From: Jin Ma To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, juzhe.zhong@rivai.ai, pan2.li@intel.com, kito.cheng@gmail.com, jinma.contrib@gmail.com, Jin Ma Subject: [PATCH] RISC-V: Fixed incorrect semantic description in DF to DI pattern in the Zfa extension on rv32. Date: Fri, 6 Sep 2024 18:02:39 +0800 Message-Id: <20240906100239.1041-1-jinma@linux.alibaba.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Spam-Status: No, score=-27.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 In the process of DF to SI, we generally use "unsigned_fix" rather than "truncate" for conversion. Although this has no effect in general, unexpected ICE often occurs when precise semantic analysis is required, such as analysis in function "simplify_const_unary_operation" in simplify-rtx.cc. gcc/ChangeLog: * config/riscv/riscv.md: Change "truncate" to "unsigned_fix" for the Zfa extension on rv32. --- gcc/config/riscv/riscv.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 9f94b5aa0232..36d7b333c456 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -2627,7 +2627,7 @@ (define_insn "*movdf_softfloat" (define_insn "movsidf2_low_rv32" [(set (match_operand:SI 0 "register_operand" "= r") - (truncate:SI + (unsigned_fix:SI (match_operand:DF 1 "register_operand" "zmvf")))] "TARGET_HARD_FLOAT && !TARGET_64BIT && TARGET_ZFA" "fmv.x.w\t%0,%1" @@ -2638,7 +2638,7 @@ (define_insn "movsidf2_low_rv32" (define_insn "movsidf2_high_rv32" [(set (match_operand:SI 0 "register_operand" "= r") - (truncate:SI + (unsigned_fix:SI (lshiftrt:DF (match_operand:DF 1 "register_operand" "zmvf") (const_int 32))))]