From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by sourceware.org (Postfix) with ESMTPS id 3F8843857C44 for ; Thu, 24 Aug 2023 08:00:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F8843857C44 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=1692864057; x=1724400057; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XFHDY6LwbCOsHKL6tsc71QpEqvErH8voTkfXTs/FrKQ=; b=nkZ70E1YYBeFJu2QffG6Y4W6MZlmiFDjIQavs4OIVZpdKMbxO2BQUbWF WwWM1QpaGbNVSXDEcIiGNun6LoYPENIoFGKYfqKjkWlwMUT7dOZXiCKbX hnGNW/oDDXYYikbhr1pZqUhTWcqXOVty6mYkRHvsTghRZLmydiE7DLXnt 7CbiXv9fy2pArujVC8X6/XbNPKGPVH6UlitGRL15M9xUfNrhEY3vPB+y/ XyXbOK8/C/gOyOpVUfJRYpJ/XqdXhvsNUDJ1ZZ7Hmz3vb9CLO5MIpggWr cDjreTG7c7PyHO8i1vnB6PwwuzGEc6Ft9fkpebFLk95LCUi021Xxe+UfY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10811"; a="354706525" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="354706525" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2023 01:00:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10811"; a="772023179" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="772023179" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga001.jf.intel.com with ESMTP; 24 Aug 2023 01:00:50 -0700 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 6FFE11007813; Thu, 24 Aug 2023 16:00:51 +0800 (CST) From: liuhongt To: gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com Subject: [PATCH] [x86] Refactor mode iterator V_128 and V_128H, V_256 and V_256H Date: Thu, 24 Aug 2023 15:58:51 +0800 Message-Id: <20230824075851.2484291-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.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: Merge V_128H and V_256H into V_128 and V_256, adjust related patterns. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog: * config/i386/sse.md (vec_set): Removed. (V_128H): Merge into .. (V_128): .. this. (V_256H): Merge into .. (V_256): .. this. (V_512): Add V32HF, V32BF. (*ssse3_palignr_perm): Adjust mode iterator from V_128H to V_128. (vcond): Removed (vcondu): Removed. (avx_vbroadcastf128_): Refator from V_256H to V_256. --- gcc/config/i386/sse.md | 65 +++++------------------------------------- 1 file changed, 7 insertions(+), 58 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index da85223a9b4..b9cf172306c 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -312,17 +312,10 @@ (define_mode_iterator V ;; All 128bit vector modes (define_mode_iterator V_128 - [V16QI V8HI V4SI V2DI V4SF (V2DF "TARGET_SSE2")]) - -(define_mode_iterator V_128H [V16QI V8HI V8HF V8BF V4SI V2DI V4SF (V2DF "TARGET_SSE2")]) ;; All 256bit vector modes (define_mode_iterator V_256 - [V32QI V16HI V8SI V4DI V8SF V4DF]) - -;; All 256bit vector modes including HF/BF vector modes -(define_mode_iterator V_256H [V32QI V16HI V8SI V4DI V8SF V4DF V16HF V16BF]) ;; All 128bit and 256bit vector modes @@ -331,7 +324,7 @@ (define_mode_iterator V_128_256 V16HF V8HF V8SF V4SF V4DF V2DF]) ;; All 512bit vector modes -(define_mode_iterator V_512 [V64QI V32HI V16SI V8DI V16SF V8DF]) +(define_mode_iterator V_512 [V64QI V32HI V16SI V8DI V16SF V8DF V32HF V32BF]) ;; All 256bit and 512bit vector modes (define_mode_iterator V_256_512 @@ -4652,21 +4645,6 @@ (define_expand "vcond" DONE; }) -(define_expand "vcond" - [(set (match_operand:VF_AVX512HFBFVL 0 "register_operand") - (if_then_else:VF_AVX512HFBFVL - (match_operator 3 "" - [(match_operand: 4 "vector_operand") - (match_operand: 5 "vector_operand")]) - (match_operand:VF_AVX512HFBFVL 1 "general_operand") - (match_operand:VF_AVX512HFBFVL 2 "general_operand")))] - "TARGET_AVX512FP16" -{ - bool ok = ix86_expand_int_vcond (operands); - gcc_assert (ok); - DONE; -}) - (define_expand "vcond" [(set (match_operand: 0 "register_operand") (if_then_else: @@ -11414,20 +11392,6 @@ (define_expand "vec_set" DONE; }) -(define_expand "vec_set" - [(match_operand:V8BFH_128 0 "register_operand") - (match_operand: 1 "register_operand") - (match_operand 2 "vec_setm_sse41_operand")] - "TARGET_SSE" -{ - if (CONST_INT_P (operands[2])) - ix86_expand_vector_set (false, operands[0], operands[1], - INTVAL (operands[2])); - else - ix86_expand_vector_set_var (operands[0], operands[1], operands[2]); - DONE; -}) - (define_expand "vec_set" [(match_operand:V_256_512 0 "register_operand") (match_operand: 1 "register_operand") @@ -11884,7 +11848,7 @@ (define_expand "avx512vl_vextractf128" (define_expand "avx_vextractf128" [(match_operand: 0 "nonimmediate_operand") - (match_operand:V_256H 1 "register_operand") + (match_operand:V_256 1 "register_operand") (match_operand:SI 2 "const_0_to_1_operand")] "TARGET_AVX" { @@ -17326,21 +17290,6 @@ (define_expand "vconduv2di" DONE; }) -(define_expand "vcondu" - [(set (match_operand:VF_AVX512FP16VL 0 "register_operand") - (if_then_else:VF_AVX512FP16VL - (match_operator 3 "" - [(match_operand: 4 "vector_operand") - (match_operand: 5 "vector_operand")]) - (match_operand:VF_AVX512FP16VL 1 "general_operand") - (match_operand:VF_AVX512FP16VL 2 "general_operand")))] - "TARGET_AVX512FP16" -{ - bool ok = ix86_expand_int_vcond (operands); - gcc_assert (ok); - DONE; -}) - (define_expand "vcondeqv2di" [(set (match_operand:VI8F_128 0 "register_operand") (if_then_else:VI8F_128 @@ -26879,8 +26828,8 @@ (define_split "operands[2] = gen_lowpart (mode, operands[0]);") (define_insn "avx_vbroadcastf128_" - [(set (match_operand:V_256H 0 "register_operand" "=x,x,x,v,v,v,v") - (vec_concat:V_256H + [(set (match_operand:V_256 0 "register_operand" "=x,x,x,v,v,v,v") + (vec_concat:V_256 (match_operand: 1 "nonimmediate_operand" "m,0,?x,m,0,m,0") (match_dup 1)))] "TARGET_AVX" @@ -27206,9 +27155,9 @@ (define_insn "*avx_vperm2f128_nozero" (set_attr "mode" "")]) (define_insn "*ssse3_palignr_perm" - [(set (match_operand:V_128H 0 "register_operand" "=x,Yw") - (vec_select:V_128H - (match_operand:V_128H 1 "register_operand" "0,Yw") + [(set (match_operand:V_128 0 "register_operand" "=x,Yw") + (vec_select:V_128 + (match_operand:V_128 1 "register_operand" "0,Yw") (match_parallel 2 "palignr_operand" [(match_operand 3 "const_int_operand")])))] "TARGET_SSSE3" -- 2.31.1