Hi Claudio, > -----Original Message----- > From: Claudio Bantaloukas <[email protected]> > Sent: 16 November 2025 14:39 > To: Tamar Christina <[email protected]>; Kyrylo Tkachov > <[email protected]>; Richard Earnshaw <[email protected]> > Subject: Fwd: [PATCH v1] aarch64: Add the ability to have three types in an > sve/sme intrinsic name > > Apologies but hit send before CCing maintainers. > https://inbox.sourceware.org/gcc-patches/20251116140229.176720-1- > [email protected]/T/#u > > -------- Forwarded Message -------- > Subject: [PATCH v1] aarch64: Add the ability to have three types in an > sve/sme intrinsic name > Date: Sun, 16 Nov 2025 14:02:27 +0000 > From: Claudio Bantaloukas <[email protected]> > To: [email protected] > CC: Claudio Bantaloukas <[email protected]> > > > The majority of sve/sme intrinsics have names which are defined by one type > (like svuint8_t svextq[_u8]) or two types (like svsub_za32[_f32]_vg1x2). > Some intrinsics now have three types (like svtmopa_lane_za32[_s8_u8]). > This change extends the number of type_suffix_indexes from two to three > to cover this case. > > gcc/ > * config/aarch64/aarch64-sve-builtins-base.cc: (svmul_impl::fold): > Replace use of type_suffix_pair with type_suffix_triple. > * config/aarch64/aarch64-sve-builtins-shapes.cc: > (parse_element_type): > Handle third type suffix. > (parse_type): Handle c2 in function signature. Add the u signature > with > the ability to pass a tuple with twice as many vectors as the base type. > Calculate number of vectors against the type with the maximum > number of > bits rather than "the other one". > (load_contiguous_base::resolve): Add argument to resolve_to call. > (compare_scalar_def::resolve): Likewise. > (ternary_mfloat8_def::resolve): Likewise. > (ternary_mfloat8_lane_def::resolve): Likewise. > (ternary_mfloat8_opt_n_def::resolve): Likewise. > * config/aarch64/aarch64-sve-builtins.cc: (TYPES_all_pred, > TYPES_all_count, TYPES_all_pred_count, TYPES_all_float, > TYPES_all_signed, TYPES_all_float_and_signed, TYPES_all_unsigned, > TYPES_all_integer, TYPES_all_arith, TYPES_all_data, TYPES_b, TYPES_c, > TYPES_b_unsigned, TYPES_b_integer, TYPES_b_data, > TYPES_bh_integer, > TYPES_bs_unsigned, TYPES_bhs_signed, TYPES_bhs_unsigned, > TYPES_bhs_integer, TYPES_bh_data, TYPES_bhs_data, > TYPES_bhs_widen, > TYPES_h_bfloat, TYPES_h_float, TYPES_h_integer, TYPES_h_data, > TYPES_hs_signed, TYPES_hs_integer, TYPES_hs_float, TYPES_hs_data, > TYPES_hd_unsigned, TYPES_hsd_signed, TYPES_hsd_integer, > TYPES_hsd_data, > TYPES_h_float_mf8, TYPES_s_float, TYPES_s_float_mf8, > TYPES_s_float_hsd_integer, TYPES_s_float_sd_integer, > TYPES_s_signed, > TYPES_s_unsigned, TYPES_s_integer, TYPES_s_data, TYPES_sd_signed, > TYPES_sd_unsigned, TYPES_sd_integer, TYPES_sd_data, > TYPES_all_float_and_sd_integer, TYPES_d_float, TYPES_d_unsigned, > TYPES_d_integer, TYPES_d_data, TYPES_cvt, TYPES_cvt_bfloat, > TYPES_cvt_h_s_float, TYPES_cvt_f32_f16, TYPES_cvt_long, > TYPES_cvt_narrow_s, TYPES_cvt_narrow, TYPES_cvt_s_s, > TYPES_cvt_mf8, > TYPES_cvtn_mf8, TYPES_cvtnx_mf8, TYPES_inc_dec_n, > TYPES_qcvt_x2, > TYPES_qcvt_x4, TYPES_qrshr_x2,TYPES_qrshru_x2, TYPES_qrshr_x4, > TYPES_qrshru_x4, TYPES_reinterpret, > TYPES_reinterpret_b,TYPES_while, > TYPES_while_x, TYPES_while_x_c, TYPES_s_narrow_fsu,TYPES_all_za, > TYPES_d_za, TYPES_za_bhsd_data,TYPES_za_all_data, > TYPES_za_h_mf8, > TYPES_za_hs_mf8, TYPES_za_h_bfloat, TYPES_za_h_float, > TYPES_za_s_b_signed, TYPES_za_s_b_unsigned, > TYPES_za_s_b_integer, > TYPES_za_s_h_integer,TYPES_za_s_h_data, TYPES_za_s_unsigned, > TYPES_za_s_integer, TYPES_za_s_mf8, TYPES_za_s_float, > TYPES_za_s_data, > TYPES_za_d_h_integer, TYPES_za_d_float, TYPES_za_d_integer, > TYPES_mop_base, TYPES_mop_base_signed, > TYPES_mop_base_unsigned, > TYPES_mop_i16i64, TYPES_mop_i16i64_signed, > TYPES_mop_i16i64_unsigned, > ΤYPES_za): Extend defines to three arguments. > (DEF_VECTOR_TYPE, DEF_DOUBLE_TYPE): Likewise. > (DEF_TRIPLE_TYPE): Add new define. > (DEF_SVE_TYPES_ARRAY): Redefine all types_ arrays into arrays of > type_suffix_triple. > (types_none): Likewise. > (function_instance::hash): Add third type to hash calculation. > (function_builder::get_name): Add third type to function name. > (function_builder::add_overloaded_functions): Handle third type. > (function_resolver::lookup_form): Likewise. > (function_resolver::resolve_to): Likewise. > (function_resolver::resolve_unary): Likewise. > * config/aarch64/aarch64-sve-builtins.h: (type_suffix_triple): replace > type_suffix_pair. > (function_group_info::types): Likewise. > (function_instance::ctor): Likewise. > (function_instance::type_suffix_ids): Likewise. > (function_resolver::lookup_form): Add third type argument. > (function_resolver::resolve_to): Likewise. > (function_instance::operator==): Add third type to equality > calculation.
Patch is OK. Sorry for the delay. Thanks, Tamar > --- > .../aarch64/aarch64-sve-builtins-base.cc | 8 +- > .../aarch64/aarch64-sve-builtins-shapes.cc | 41 ++- > gcc/config/aarch64/aarch64-sve-builtins.cc | 327 +++++++++--------- > gcc/config/aarch64/aarch64-sve-builtins.h | 19 +- > 4 files changed, 215 insertions(+), 180 deletions(-)
