Thanks for the update. I agree with the summary of the IRC discussion except for…
"Kewen.Lin" <li...@linux.ibm.com> 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. …this 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,store}_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 <li...@gcc.gnu.org> > > * 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.