On 11/14/25 10:28 AM, Robin Dapp wrote:
This patch changes the gather/scatter mode iterators from a ratio
scheme to a more direct one where the index mode size is
1/2, 1/4, 1/8, 2, 4, 8 times the data mode size.  It also adds VLS modes
to the iterators and removes the now unnecessary
gather_scatter_valid_offset_p.

gcc/ChangeLog:

        * config/riscv/autovec.md 
(mask_len_gather_load<RATIO64:mode><RATIO64I:mode>): Change from this...
        (mask_len_gather_load<mode><vindex>): ...to this.
        (mask_len_gather_load<RATIO32:mode><RATIO32I:mode>): Ditto.
        (mask_len_gather_load<mode><vindex_double_trunc>): Ditto.
        (mask_len_gather_load<RATIO16:mode><RATIO16I:mode>): Ditto.
        (mask_len_gather_load<mode><vindex_quad_trunc>): Ditto.
        (mask_len_gather_load<RATIO8:mode><RATIO8I:mode>): Ditto.
        (mask_len_gather_load<mode><vindex_oct_trunc>): Ditto.
        (mask_len_gather_load<RATIO4:mode><RATIO4I:mode>): Ditto.
        (mask_len_gather_load<mode><vindex_double_ext>): Ditto.
        (mask_len_gather_load<RATIO2:mode><RATIO2I:mode>): Ditto.
        (mask_len_gather_load<mode><vindex_quad_ext>): Ditto.
        (mask_len_gather_load<mode><mode>): Ditto.
        (mask_len_gather_load<mode><vindex_oct_ext>): Ditto.
        (mask_len_scatter_store<RATIO64:mode><RATIO64I:mode>): Ditto.
        (mask_len_scatter_store<mode><vindex>): Ditto.
        (mask_len_scatter_store<RATIO32:mode><RATIO32I:mode>): Ditto.
        (mask_len_scatter_store<mode><vindex_double_trunc>): Ditto.
        (mask_len_scatter_store<RATIO16:mode><RATIO16I:mode>): Ditto.
        (mask_len_scatter_store<mode><vindex_quad_trunc>): Ditto.
        (mask_len_scatter_store<RATIO8:mode><RATIO8I:mode>): Ditto.
        (mask_len_scatter_store<mode><vindex_oct_trunc>): Ditto.
        (mask_len_scatter_store<RATIO4:mode><RATIO4I:mode>): Ditto.
        (mask_len_scatter_store<mode><vindex_double_ext>): Ditto.
        (mask_len_scatter_store<RATIO2:mode><RATIO2I:mode>): Ditto.
        (mask_len_scatter_store<mode><vindex_quad_ext>): Ditto.
        (mask_len_scatter_store<mode><mode>): Ditto.
        (mask_len_scatter_store<mode><vindex_oct_ext>): Ditto.
        * config/riscv/riscv-v.cc (prepare_gather_scatter): Use new
        scheme
        (get_gather_scatter_code): Ditto.
        (expand_gather_scatter): Ditto.
        * config/riscv/riscv-vector-builtins-bases.cc: Ditto.
        * config/riscv/vector-iterators.md: Ditto.
        * config/riscv/vector.md 
(@pred_indexed_<order>store<RATIO64:mode><RATIO64I:mode>): Go from this...
        (@pred_indexed_<order>store<mode>_same_eew): ...to this.
        (@pred_indexed_<order>store<RATIO32:mode><RATIO32I:mode>):
        Ditto.
        (@pred_indexed_<order>store<mode>_x2_greater_eew): Ditto.
        (@pred_indexed_<order>store<RATIO16:mode><RATIO16I:mode>):
        Ditto.
        (@pred_indexed_<order>store<mode>_x4_greater_eew): Ditto.
        (@pred_indexed_<order>store<RATIO8:mode><RATIO8I:mode>): Ditto.
        (@pred_indexed_<order>store<mode>_x8_greater_eew): Ditto.
        (@pred_indexed_<order>store<RATIO4:mode><RATIO4I:mode>): Ditto.
        (@pred_indexed_<order>store<mode>_x2_smaller_eew): Ditto.
        (@pred_indexed_<order>store<RATIO2:mode><RATIO2I:mode>): Ditto.
        (@pred_indexed_<order>store<mode>_x4_smaller_eew): Ditto.
        (@pred_indexed_<order>store<RATIO1:mode><RATIO1:mode>): Ditto.
        (@pred_indexed_<order>store<mode>_x8_smaller_eew): Ditto.
---

Just spot checked the pattern changes for sanity. The iterator changes are mind-bending. CI is complaining:

../../../gcc/gcc/config/riscv/vector-iterators.md:375:80: error: unknown mode 
`V1BF'

So presumably something still to iterate on there. So OK once the CI issues as resolved.

jeff

Reply via email to