From patchwork Mon Oct 10 01:26:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liuhongt X-Patchwork-Id: 1846 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1360102wrs; Sun, 9 Oct 2022 18:26:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM44DzEEsF8/5t+ol22APFQ9R1d/A8fgk3lJkwI+1a+zGcVhoj97TiiqkcHpLVnm/w4I7MnY X-Received: by 2002:a05:6402:35cf:b0:45b:a8af:1494 with SMTP id z15-20020a05640235cf00b0045ba8af1494mr9239360edc.415.1665365210094; Sun, 09 Oct 2022 18:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665365210; cv=none; d=google.com; s=arc-20160816; b=FQucarBrZIkcFVWO6ZIqS0mGTQ47WEvrWflyYO4N6FN6MdHT5m19aMC3Sp436XU27e uYfqxXVhsv6khgynNciFk75QuoBSqvkuWmodZXiY4y3h3p2amMKvuMbt6v3aZ0ptxoZo o6cYVGm403Cgr3EHjgyifi/fOF7/Sxhnwgxe6TZWNvtX7e9f8L0EPir6lCbc4A/V56+L fXLrvrsotI8R2mJeNsTksHsTg03/9zLanpEpRJEW8wJTouFBHf/SQf4NXu3ec6OT5OVd F/xsbhk5qkMoLSEggMbbZxX3ah5DuJDY4DXKqvh8PHpgkDf3xbZh3xPMeuC36TEMB8ab v5BA== 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:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=qBZUoWf+tbtBWx233RqI7nD63hD/8R+8gY6fK6Bx/U0=; b=mE3HhZAzED5S6yEqgn0M9FwMfdW7+J7hJq4ebYlFrCb1wgk2q5mXyyprrc9NeUn0j0 71SeOa5sADkrHUYHtZY17ym/LOtNhQ6nl5zeixPEKTdNbkWtTF/9lg39uT/IhNv7QSAV DWidkxumgiahSuimkvOc39qKIv+DLQS5C14D/LkBYUEM5Xun/5bBKTVkPF/NRL4INT79 kgeA6kPejjRiRMUaDHRIBm1IDvmSwyFvbSUVnFt2ba0PXIDY+WxKtH31Sc4LP9TD2glQ l7QzPMbBRMw/2kaKEtYawXSkqjOwC5/YAV8UKDkobjaNdnFEbxCxjQKAW14N4sVsYqJR pAYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bbhCtUeQ; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b21-20020a170906195500b00783af0d1ed8si8330059eje.243.2022.10.09.18.26.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Oct 2022 18:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bbhCtUeQ; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 10B6F3858415 for ; Mon, 10 Oct 2022 01:26:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10B6F3858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665365209; bh=qBZUoWf+tbtBWx233RqI7nD63hD/8R+8gY6fK6Bx/U0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bbhCtUeQxplEf+yhF+daRE38vPr7ESGQV8RVi04i+d+QlxoUAFDeOnS6oDheQlwaO WqTaaQ7EXInVFXvQT0yFMoSM3Mbg61g9VN+DpqzMs0TdmdmJboT20VuDOJglaXbcc2 uzly1dBOGVos3eu+jQ7fgB60BhpAIuI8YLfe9sgY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by sourceware.org (Postfix) with ESMTPS id 419E83858D1E for ; Mon, 10 Oct 2022 01:26:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 419E83858D1E X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="390422720" X-IronPort-AV: E=Sophos;i="5.95,172,1661842800"; d="scan'208";a="390422720" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2022 18:26:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="800921090" X-IronPort-AV: E=Sophos;i="5.95,172,1661842800"; d="scan'208";a="800921090" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga005.jf.intel.com with ESMTP; 09 Oct 2022 18:26:02 -0700 Received: from shliclel4051.sh.intel.com (shliclel4051.sh.intel.com [10.239.240.51]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 82D8F100B7DF; Mon, 10 Oct 2022 09:26:01 +0800 (CST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] [x86] Fix unrecognizable insn of cvtss2si. Date: Mon, 10 Oct 2022 09:26:01 +0800 Message-Id: <20221010012601.2741373-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, 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: liuhongt via Gcc-patches From: liuhongt Reply-To: liuhongt 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?1746261990280391925?= X-GMAIL-MSGID: =?utf-8?q?1746261990280391925?= Adjust lrintmn2 operand preidcates according to real instructions. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok as an obvious fix? gcc/ChangeLog: PR target/107185 * config/i386/i386.md (lrint2): Swap predicate of operands[0] and operands[1]. gcc/testsuite/ChangeLog: * gcc.target/i386/pr107185.c: New test. --- gcc/config/i386/i386.md | 4 ++-- gcc/testsuite/gcc.target/i386/pr107185.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr107185.c diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 1be9b669909..947513701b9 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -20145,8 +20145,8 @@ (define_insn "lrintxf2" (set_attr "mode" "")]) (define_expand "lrint2" - [(set (match_operand:SWI48 0 "nonimmediate_operand") - (unspec:SWI48 [(match_operand:MODEF 1 "register_operand")] + [(set (match_operand:SWI48 0 "register_operand") + (unspec:SWI48 [(match_operand:MODEF 1 "nonimmediate_operand")] UNSPEC_FIX_NOTRUNC))] "SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH") diff --git a/gcc/testsuite/gcc.target/i386/pr107185.c b/gcc/testsuite/gcc.target/i386/pr107185.c new file mode 100644 index 00000000000..333191a9a89 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr107185.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-ffast-math" } */ + +void +foo (float f) +{ + long p = __builtin_lrintf (f); +}