diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2024-10-17 19:35:21 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2024-12-13 14:23:31 +0000 |
commit | 20e31a082cb3843f2362111ec80f40c51ca4cb41 (patch) | |
tree | a6b7ec7e826c3e79cd8971b20e5d509118b8b249 /gcc/config | |
parent | b0512ae20b670270629c6c6d497f2509a92cc41c (diff) | |
download | gcc-20e31a082cb3843f2362111ec80f40c51ca4cb41.zip gcc-20e31a082cb3843f2362111ec80f40c51ca4cb41.tar.gz gcc-20e31a082cb3843f2362111ec80f40c51ca4cb41.tar.bz2 |
arm: [MVE intrinsics] add load_ext_gather_offset shape
This patch adds the load_ext_gather_offset shape description.
gcc/ChangeLog:
* config/arm/arm-mve-builtins-shapes.cc (struct load_ext_gather):
New.
(struct load_ext_gather_offset_def): New.
* config/arm/arm-mve-builtins-shapes.h (load_ext_gather_offset):
New.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arm/arm-mve-builtins-shapes.cc | 58 | ||||
-rw-r--r-- | gcc/config/arm/arm-mve-builtins-shapes.h | 1 |
2 files changed, 59 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 03714ff..28b9045 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1535,6 +1535,64 @@ struct load_ext_def : public nonoverloaded_base }; SHAPE (load_ext) +/* Base class for load_ext_gather_offset and load_ext_gather_shifted_offset, + which differ only in the units of the displacement. */ +struct load_ext_gather : public overloaded_base<0> +{ + bool + explicit_mode_suffix_p (enum predication_index, enum mode_suffix_index) const override + { + return true; + } + + bool + mode_after_pred () const override + { + return false; + } +}; + +/* <T0>_t vfoo[_t0](<X>_t const *, <Y>_t) + + where <X> might be tied to <t0> (for non-extending loads) or might + depend on the function base name (for extending loads), + <Y> has the same width as <T0> but is of unsigned type. + + Example: vldrhq_gather_offset + int16x8_t [__arm_]vldrhq_gather_offset[_s16](int16_t const *base, uint16x8_t offset) + int32x4_t [__arm_]vldrhq_gather_offset_z[_s32](int16_t const *base, uint32x4_t offset, mve_pred16_t p) */ +struct load_ext_gather_offset_def : public load_ext_gather +{ + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + b.add_overloaded_functions (group, MODE_offset, preserve_user_namespace); + build_all (b, "v0,al,vu0", group, MODE_offset, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + mode_suffix_index mode = MODE_offset; + type_suffix_index ptr_type; + type_suffix_index offset_type; + if (!r.check_gp_argument (2, i, nargs) + || (ptr_type = r.infer_pointer_type (0)) == NUM_TYPE_SUFFIXES + || (offset_type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + /* tclass comes from base argument, element bits come from the offset + argument. */ + type_suffix_index type = find_type_suffix (type_suffixes[ptr_type].tclass, + type_suffixes[offset_type].element_bits); + + return r.resolve_to (mode, type); + } +}; +SHAPE (load_ext_gather_offset) + /* <T0>_t vfoo[_t0](<T0>_t) <T0>_t vfoo_n_t0(<sT0>_t) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 1d361ad..9113d55 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -63,6 +63,7 @@ namespace arm_mve extern const function_shape *const inherent; extern const function_shape *const load; extern const function_shape *const load_ext; + extern const function_shape *const load_ext_gather_offset; extern const function_shape *const mvn; extern const function_shape *const store; extern const function_shape *const store_scatter_base; |