From c31cdc3d85e365ce0d233fe40bee40a8bd672b11 Mon Sep 17 00:00:00 2001 From: Alfie Richards Date: Wed, 11 Sep 2024 12:32:06 +0200 Subject: [PATCH] arm: [MVE intrinsics] Add load_ext intrinsic shape This patch adds the extending load shape. It also adds/fixes comments for the load and store shapes. 2024-09-11 Alfie Richards Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc: (load_ext): New. * config/arm/arm-mve-builtins-shapes.h: (load_ext): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 30 ++++++++++++++++++++--- gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 0a108cf0127e..12e62122ae4e 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1461,7 +1461,9 @@ struct inherent_def : public nonoverloaded_base }; SHAPE (inherent) -/* sv_t svfoo[_t0](const _t *) +/* _t vfoo[_t0](const _t *) + + where is the scalar name of . Example: vld1q. int8x16_t [__arm_]vld1q[_s8](int8_t const *base) @@ -1493,6 +1495,24 @@ struct load_def : public overloaded_base<0> }; SHAPE (load) +/* _t foo_t0 (const _t *) + + where is determined by the function base name. + + Example: vldrq. + int32x4_t [__arm_]vldrwq_s32 (int32_t const *base) + uint32x4_t [__arm_]vldrhq_z_u32 (uint16_t const *base, mve_pred16_t p) */ +struct load_ext_def : public nonoverloaded_base +{ + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + build_all (b, "t0,al", group, MODE_none, preserve_user_namespace); + } +}; +SHAPE (load_ext) + /* _t vfoo[_t0](_t) _t vfoo_n_t0(_t) @@ -1542,14 +1562,18 @@ struct mvn_def : public overloaded_base<0> }; SHAPE (mvn) -/* void vfoo[_t0](_t *, v[xN]_t) +/* void vfoo[_t0](_t *, [xN]_t) where might be tied to (for non-truncating stores) or might depend on the function base name (for truncating stores). Example: vst1q. void [__arm_]vst1q[_s8](int8_t *base, int8x16_t value) - void [__arm_]vst1q_p[_s8](int8_t *base, int8x16_t value, mve_pred16_t p) */ + void [__arm_]vst1q_p[_s8](int8_t *base, int8x16_t value, mve_pred16_t p) + + Example: vstrb. + void [__arm_]vstrbq[_s16](int8_t *base, int16x8_t value) + void [__arm_]vstrbq_p[_s16](int8_t *base, int16x8_t value, mve_pred16_t p) */ struct store_def : public overloaded_base<0> { void diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index e53381d8f36c..db7c63117289 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -62,6 +62,7 @@ namespace arm_mve extern const function_shape *const create; extern const function_shape *const inherent; extern const function_shape *const load; + extern const function_shape *const load_ext; extern const function_shape *const mvn; extern const function_shape *const store; extern const function_shape *const ternary; -- 2.47.2