From patchwork Fri Jan 13 12:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianmiao Qu X-Patchwork-Id: 1725921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Ji6SLwmH; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NtgvK39lmz23gQ for ; Fri, 13 Jan 2023 23:38:36 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B10CB38543B2 for ; Fri, 13 Jan 2023 12:38:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B10CB38543B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673613513; bh=mqs/uZ5JJv0lOk224L33gm6ogziJrKIdEt6ss92LJoY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Ji6SLwmHHXNaY4MuuqRh+1wTAXl/AE0bJtkz6aBFiprPeiv0WQvH8U7Q0BIeDsuBt HFNcaTNbfTL3WZ26xHWHxLs6EIbnINN9E91227kJquO2UyUy2ZmwwWhKJq0QJxFYsI +UMUDNY2/Mpqa4wATbGcIihL7iJZVvr3XfPi5Ss4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by sourceware.org (Postfix) with ESMTPS id D30283858D32 for ; Fri, 13 Jan 2023 12:38:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D30283858D32 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R171e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045176; MF=cooper.qu@linux.alibaba.com; NM=1; PH=DS; RN=1; SR=0; TI=SMTPD_---0VZUonxm_1673613486; Received: from localhost(mailfrom:cooper.qu@linux.alibaba.com fp:SMTPD_---0VZUonxm_1673613486) by smtp.aliyun-inc.com; Fri, 13 Jan 2023 20:38:06 +0800 To: gcc-patches@gcc.gnu.org Subject: [committed] C-SKY: Add conditions for ceil etc patterns. Date: Fri, 13 Jan 2023 20:38:05 +0800 Message-Id: <20230113123805.75201-1-cooper.qu@linux.alibaba.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 X-Spam-Status: No, score=-20.5 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Xianmiao Qu via Gcc-patches From: Xianmiao Qu Reply-To: Xianmiao Qu Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The ceil etc functions can be only inlined as instruction when they can raise the "inexact" exception. Without the adding conditions, it will cause the "gcc.dg/torture/builtin-fp-int-inexact-c2x.c" etc cases fails. gcc/ * config/csky/csky_insn_fpuv3.md (lsi2): Test flag_fp_int_builtin_inexact || !flag_trapping_math. (2): Likewise. --- gcc/config/csky/csky_insn_fpuv3.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/csky/csky_insn_fpuv3.md b/gcc/config/csky/csky_insn_fpuv3.md index 628bae597ba..7f8f459621e 100644 --- a/gcc/config/csky/csky_insn_fpuv3.md +++ b/gcc/config/csky/csky_insn_fpuv3.md @@ -476,14 +476,16 @@ [(set (match_operand:SI 0 "register_operand" "=v") (FIX_SU:SI (unspec:F3ANY [(match_operand:F3ANY 1 "register_operand" "0")] FRM)))] - "CSKY_ISA_FEATURE(fpv3_)" + "CSKY_ISA_FEATURE(fpv3_) + && (flag_fp_int_builtin_inexact || !flag_trapping_math)" "fftoi.f.32\t%0, %1" ) (define_insn "2" [(set (match_operand:F3ANY 0 "register_operand" "=v") (unspec:F3ANY [(match_operand:F3ANY 1 "register_operand" "0")] FRMF))] - "CSKY_ISA_FEATURE(fpv3_)" + "CSKY_ISA_FEATURE(fpv3_) + && (flag_fp_int_builtin_inexact || !flag_trapping_math)" "fftofi.f\t%0, %1" )