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: =?utf-8?b?556/5LuZ5re8?= X-Patchwork-Id: 63153 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 7799438543B2 for ; Fri, 13 Jan 2023 12:38:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7799438543B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673613522; bh=mqs/uZ5JJv0lOk224L33gm6ogziJrKIdEt6ss92LJoY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=l/njZ2P8lOOhLEUYDfKh4I7LCyR6ixtxKh5qWChABfk3d+7JI4tihMkTeeKThnQlE gCryxDcRUt/sO3G25u0xjUGkcQb6CiN7GZjvf/2MvQXFbxNK6eQUrKLEV3yZPFanS9 mOXKETDKT6BbQAQgfnvEepHoD9haNAYMLghhCJOo= 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: =?utf-8?b?556/5LuZ5re8?= Reply-To: Xianmiao Qu Errors-To: gcc-patches-bounces+patchwork=sourceware.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" )