From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by sourceware.org (Postfix) with ESMTPS id BDF0D385C6E4 for ; Tue, 10 Oct 2023 07:01:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDF0D385C6E4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696921310; x=1728457310; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=3r222W+xvAus90YjND6+ep+uQGoHrPLja2A+HZbeDPQ=; b=KV7v8LQ5J0LWQrVkHljfrXqpWAtQBbTGRinHPLpS8IcgjP6IITTJjugf 4gOSNUVMBGWfP2UjgdI0QB8Sq19acfeWwAiUemCY+9oLAzGSBwK7CnUCH 3hHNG9awxz4o6sGSS+unxyUEFnKiFui8BZ4UBDFbf0Z7In+ObmOk0/p6v XEsToFjMCdzCsbgxmh4ySoHmZgTM2+U++VPcRKXpDDpx8+FQnrlbZS9g1 AgK7EbsruHqHliloR+oXstMQXZ9wSqxomMNUh0Rco5gBfIgqvWUrbKH22 QWdEu29mtX2DyK6KntXwdazFQBktRPqp1duahtB7hsrCpYqc56myUIcGD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="5883038" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="5883038" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 00:01:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="729977290" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="729977290" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga006.jf.intel.com with ESMTP; 10 Oct 2023 00:01:46 -0700 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id B36271005703; Tue, 10 Oct 2023 15:01:45 +0800 (CST) From: liuhongt To: gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com Subject: [PATCH] [x86] Refine predicate of operands[2] in divv4hf3 with register_operand. Date: Tue, 10 Oct 2023 14:59:45 +0800 Message-Id: <20231010065945.1234266-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 List-Id: In the expander, it will emit below insn. rtx tmp = gen_rtx_VEC_CONCAT (V4SFmode, operands[2], force_reg (V2SFmode, CONST1_RTX (V2SFmode))); but *vec_concat only allow register_operand. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog: PR target/111745 * config/i386/mmx.md (divv4hf3): Refine predicate of operands[2] with register_operand. gcc/testsuite/ChangeLog: * gcc.target/i386/pr111745.c: New test. --- gcc/config/i386/mmx.md | 2 +- gcc/testsuite/gcc.target/i386/pr111745.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr111745.c diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index c84a37a8444..4707cfae93f 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1950,7 +1950,7 @@ (define_expand "divv4hf3" [(set (match_operand:V4HF 0 "register_operand") (div:V4HF (match_operand:V4HF 1 "nonimmediate_operand") - (match_operand:V4HF 2 "nonimmediate_operand")))] + (match_operand:V4HF 2 "register_operand")))] "TARGET_AVX512FP16 && TARGET_AVX512VL && ix86_partial_vec_fp_math" { rtx op2 = gen_reg_rtx (V8HFmode); diff --git a/gcc/testsuite/gcc.target/i386/pr111745.c b/gcc/testsuite/gcc.target/i386/pr111745.c new file mode 100644 index 00000000000..e8989d96abf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr111745.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -mavx512vl -ffloat-store -O2" } */ + +char c; +_Float16 __attribute__((__vector_size__ (4 * sizeof (_Float16)))) f; +_Float16 __attribute__((__vector_size__ (2 * sizeof (_Float16)))) f1; + +void +foo (void) +{ + f /= c; +} + +void +foo1 (void) +{ + f1 /= c; +} -- 2.31.1