From patchwork Thu Dec 1 06:11:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liuhongt X-Patchwork-Id: 28209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp99723wrr; Wed, 30 Nov 2022 22:14:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf6eFPzCDXjMXNerWbabEo2IAvMbQMUUO9ijKGx04eE1+4oSJRLpYfDAutgXEVd3v3OOt+dT X-Received: by 2002:a17:907:c70c:b0:7c0:7c22:566b with SMTP id ty12-20020a170907c70c00b007c07c22566bmr13521684ejc.601.1669875263335; Wed, 30 Nov 2022 22:14:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669875263; cv=none; d=google.com; s=arc-20160816; b=INV3DBPw/BEU9ypqtqVE3mjMSmJfUHsz7pZr8xEKWg3ooGO6d+FmeQewWVg3TLqbkx 3Mu8D/4VJm1qc3GWioHQe95pPhvPxmHqAF3xNN7Qv2E3tkgH1IlZ7yaAfJPxt7gWCzea YUHLzFr9SXDagzA/vNQ36mqtO1Ppgr2EDQjgfaOWuOPNsgiMDSGxbAy+vYKoGhkwlVLb 6zzQ3x4dRkUg7B2oShaReajmALlxO/nQHRlKjEobk9mdt8Zpih4DvmXGtNiOKxmDQteU zpyKl0SBU6JGrFKLmCRs8zSRTmVAsanI5kh3szyj+S4A1iOl89nPWBCQ17ZTTJ4Hk4fV LCqQ== 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=nc16tV7lATc4AwHe9kPmCKQNQvWtmxQnBZnN1Hry/Ik=; b=aARd00DAS/z3uuHJyviBpkB48PkXgqrRRNmoYv7HprRPG2w9KLhLPaW11ysWv3J26Z gFc+crpF3YJ2770yRVS54HGilNlnphebGLCFRAIusDaVyFyn1NB+uLA2F7zUjkG7HTzE CCd040VCdtNyWI04wdm4VVdQn1iRqBJDpxFk0ekI4Df0IujcxA3Q01P6Zw4Yu4upTfMt CpfM6Qh43aieKEdQaoWK9aHT2okhHBSQZ6XTsR3YAr1ol+X1VK5PRdf4zl3QdKgUP79k hDwwQF1hzOBPagxqPbGTwU5QHxY87B0C+ON0Nsp0/njCqX34jS00++37ZhO9yyzPW8if vteA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xsllC2a0; 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 q11-20020a056402518b00b004615855c483si3204867edd.98.2022.11.30.22.14.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 22:14:23 -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=xsllC2a0; 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 28E86385B193 for ; Thu, 1 Dec 2022 06:14:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28E86385B193 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669875262; bh=nc16tV7lATc4AwHe9kPmCKQNQvWtmxQnBZnN1Hry/Ik=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=xsllC2a0uXn319nQ8uhCWss1G+A4Po2x9Tv06ZoPWma7PZIZqfXOB9EpMR3rg7P3h Cbyts9yi9T+q/YL+3zd7T8T4CIXd2Aj1wIkkt4GEYIM9SxsaJsbw138RPndL3skt+c 3V1NXLFYl/m2WMp+EwhcMcOx1MbCJkRFOKb0C2XA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by sourceware.org (Postfix) with ESMTPS id 707053858C54 for ; Thu, 1 Dec 2022 06:13:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 707053858C54 X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="313227680" X-IronPort-AV: E=Sophos;i="5.96,207,1665471600"; d="scan'208";a="313227680" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 22:13:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="675308726" X-IronPort-AV: E=Sophos;i="5.96,207,1665471600"; d="scan'208";a="675308726" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga008.jf.intel.com with ESMTP; 30 Nov 2022 22:13:31 -0800 Received: from shliclel4051.sh.intel.com (shliclel4051.sh.intel.com [10.239.240.51]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 5F28110056FA; Thu, 1 Dec 2022 14:13:30 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com, ubizjak@gmail.com Subject: [PATCH] [x86] Fix ICE due to incorrect insn type. Date: Thu, 1 Dec 2022 14:11:30 +0800 Message-Id: <20221201061130.2696537-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 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?1750991123750720367?= X-GMAIL-MSGID: =?utf-8?q?1750991123750720367?= ;; if reg/mem op (define_insn_reservation "slm_sseishft_3" 2 (and (eq_attr "cpu" "slm") (and (eq_attr "type" "sseishft") (not (match_operand 2 "immediate_operand")))) "slm-complex, slm-all-eu") in slm.md it will check operands[2] for type sseishft, but for extendbfsf2_1 there's no second operand which caused ICE. The patch set type from sseishft to sseishft1 to fix the issue. Bootstrapped and regtested on x86_64-pc-linu-gnu{-m32,}. Ready to push as an obvious patch. gcc/ChangeLog: PR target/107934 * config/i386/i386.md (extendbfsf2_1): Change type from sseishft to sseishft1. gcc/testsuite/ChangeLog: * gcc.target/i386/pr107934.c: New test. --- gcc/config/i386/i386.md | 2 +- gcc/testsuite/gcc.target/i386/pr107934.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr107934.c diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 9451883396c..9e1d9eec862 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4981,7 +4981,7 @@ (define_insn "extendbfsf2_1" pslld\t{$16, %0|%0, 16} vpslld\t{$16, %1, %0|%0, %1, 16}" [(set_attr "isa" "noavx,avx") - (set_attr "type" "sseishft") + (set_attr "type" "sseishft1") (set_attr "length_immediate" "1") (set_attr "prefix_data16" "1,*") (set_attr "prefix" "orig,vex") diff --git a/gcc/testsuite/gcc.target/i386/pr107934.c b/gcc/testsuite/gcc.target/i386/pr107934.c new file mode 100644 index 00000000000..59106b29159 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr107934.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mtune=knl -ffinite-math-only -msse2" } */ + +int +foo (__bf16 bf) +{ + return bf; +}