From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 14C8B387085C for ; Mon, 29 Jun 2020 10:07:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 14C8B387085C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=richard.sandiford@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0C6D1042; Mon, 29 Jun 2020 03:07:46 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6EF993F71E; Mon, 29 Jun 2020 03:07:45 -0700 (PDT) From: Richard Sandiford To: "Kewen.Lin" Mail-Followup-To: "Kewen.Lin" , GCC Patches , Jim Wilson , Richard Biener , Bill Schmidt , David Edelsohn , Segher Boessenkool , Jim Wilson , richard.sandiford@arm.com Cc: GCC Patches , Jim Wilson , Richard Biener , Bill Schmidt , David Edelsohn , Segher Boessenkool , Jim Wilson Subject: Re: [PATCH 1/7 v6] ifn/optabs: Support vector load/store with length References: <30906c0d-3b9f-e1e6-156f-c01fcf229cb9@linux.ibm.com> <93f9e4cf-351d-5f89-65b5-7dbc97ce13b9@linux.ibm.com> <8f64b58b-050c-2e1c-36c6-049a07eceee7@linux.ibm.com> <99427c42-113d-7fbc-5617-f64c2317250d@linux.ibm.com> <0fccef6b-2885-d91d-ff05-b23c2315fc7d@linux.ibm.com> <380e1418-f262-7a09-e24a-2eb14817662f@linux.ibm.com> Date: Mon, 29 Jun 2020 11:07:43 +0100 In-Reply-To: (Kewen Lin's message of "Mon, 29 Jun 2020 14:32:37 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Mon, 29 Jun 2020 10:07:48 -0000 Thanks for the update. I agree with the summary of the IRC discussion except for=E2=80=A6 "Kewen.Lin" writes: > Hi Richard S./Richi/Jim/Segher, > > Thanks a lot for your comments to make this patch more solid. > > Based on our discussion, for the vector load/store with length > optab, the length unit would be measured in lanes by default. > For the targets which support length measured in bytes like Power, > they should only define VnQI modes to wrap the other same size > vector modes. If the length is larger than total lane/byte count > of the given mode, it's taken to load all lanes/bytes implicitly. =E2=80=A6this last bit. IMO the behaviour of the optab should be undefined when the supplied length is greater than the number of lanes. I think that also makes things better for the lxvl implementation, which ignores the upper 56 bits of the length. It sounds like the above semantics would instead require Power to saturate the value at 255 before shifting it. Richard > For the remaining lanes/bytes which isn't specified by length, > they would be taken as undefined value. For length in bytes, > it's required that the byte count should be a multiple of the > element size (wrapped vector), otherwise it's undefined. > > This patch has been updated as attached. > > 2/7 for rs6000 optab defintion has been updated to use V16QI. > 5/7 for vectorizer change has been updated accordingly. > > ----- > > v6: Updated optab descriptions. > > v5: > - Updated lenload/lenstore optab to len_load/len_store and the docs. > - Rename expand_mask_{load,store}_optab_fn to expand_partial_{load,stor= e}_optab_fn > - Added/updated macros for expand_mask_{load,store}_optab_fn > and expand_len_{load,store}_optab_fn > > v4: Update len_load_direct/len_store_direct to align with direct optab. > > v3: Get rid of length mode hook. > > BR, > Kewen > ----- > gcc/ChangeLog: > > 2020-MM-DD Kewen Lin > > * doc/md.texi (len_load_@var{m}): Document. > (len_store_@var{m}): Likewise. > * internal-fn.c (len_load_direct): New macro. > (len_store_direct): Likewise. > (expand_len_load_optab_fn): Likewise. > (expand_len_store_optab_fn): Likewise. > (direct_len_load_optab_supported_p): Likewise. > (direct_len_store_optab_supported_p): Likewise. > (expand_mask_load_optab_fn): New macro. Original renamed to ... > (expand_partial_load_optab_fn): ... here. Add handlings for > len_load_optab. > (expand_mask_store_optab_fn): New macro. Original renamed to ... > (expand_partial_store_optab_fn): ... here. Add handlings for > len_store_optab. > (internal_load_fn_p): Handle IFN_LEN_LOAD. > (internal_store_fn_p): Handle IFN_LEN_STORE. > (internal_fn_stored_value_index): Handle IFN_LEN_STORE. > * internal-fn.def (LEN_LOAD): New internal function. > (LEN_STORE): Likewise. > * optabs.def (len_load_optab, len_store_optab): New optab.