IFN/optabs: Support vector load/store with length
authorKewen Lin <linkw@linux.ibm.com>
Wed, 8 Jul 2020 07:33:03 +0000 (02:33 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Wed, 8 Jul 2020 07:33:03 +0000 (02:33 -0500)
commitd496134a6b1ef1314c18bd316d8c1900158beae9
treebfad76449eb2f1afa06e3972465080f82030f2e7
parentc832cf1c1d114aed70c2f84566cf4d63de0a56d0
IFN/optabs: Support vector load/store with length

This patch is to add the internal function and optabs support for
vector load/store with length.

For the vector load/store with length optab, the length item 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, the behavior
is undefined.  For the remaining lanes/bytes which isn't specified
by length, they would be taken as undefined value.

gcc/ChangeLog:

* 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.
gcc/doc/md.texi
gcc/internal-fn.c
gcc/internal-fn.def
gcc/optabs.def