> - if (overloaded_p && instance.pred == PRED_TYPE_m) > + if (overloaded_p) Thanks for pointing this out, my misunderstanding for policy function result in this change as mistake, will send V2 for this. > Plz change it into : Actually, it is not easy to convert to this approach as aarch64 has different implementation of types information. Like type_suffix_info (aarch64 loop type suffix to get the arglist type in infer_vector_or_tuple_type) etc. Thus, it is not easy to construct rvv_type_info, predication_type_index and rvv_op_info from arglist, these are required by function_instance when constructing. Pan From: juzhe.zhong@rivai.ai Sent: Monday, September 11, 2023 5:13 PM To: kito.cheng Cc: Li, Pan2 ; gcc-patches ; Wang, Yanzhang Subject: Re: Re: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic >> Just make sure it's the right change? It seem incorrect to me. More comments (I just reviewed again): +tree +function_resolver::lookup () +{ + unsigned int code_limit = vec_safe_length (registered_functions); + + for (unsigned code = get_sub_code () + 1; code < code_limit; code++) + { + registered_function *rfun = (*registered_functions)[code]; + function_instance instance = rfun->instance; + + if (strcmp (base_name, instance.base_name) != 0) + break; + + if (rfun->overloaded_p) + continue; + + unsigned k; + const rvv_arg_type_info *args = instance.op_info->args; + + for (k = 0; args[k].base_type != NUM_BASE_TYPES; k++) + { + if (k >= m_arglist.length ()) + break; + + if (TYPE_MODE (instance.get_arg_type (k)) + != TYPE_MODE (TREE_TYPE (m_arglist[k]))) + break; + } + + if (args[k].base_type == NUM_BASE_TYPES) + return rfun->decl; + } + + return NULL_TREE; +} Plz change it into : /* Silently check whether there is an instance of the function with the mode suffix given by MODE and the type suffixes given by TYPE0 and TYPE1. Return its function decl if so, otherwise return null. */ tree function_resolver::lookup_form (mode_suffix_index mode, type_suffix_index type0, type_suffix_index type1) { type_suffix_pair types = { type0, type1 }; function_instance instance (base_name, base, shape, mode, types, pred); registered_function *rfn = function_table->find_with_hash (instance, instance.hash ()); return rfn ? rfn->decl : NULL_TREE; } ________________________________ juzhe.zhong@rivai.ai From: Kito Cheng Date: 2023-09-11 17:04 To: juzhe.zhong@rivai.ai CC: pan2.li; gcc-patches; yanzhang.wang Subject: Re: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic > @@ -545,7 +563,7 @@ struct move_def : public build_base > /* According to rvv-intrinsic-doc, it does not add "_m" suffix > for vop_m C++ overloaded API. */ > - if (overloaded_p && instance.pred == PRED_TYPE_m) > + if (overloaded_p) Just make sure it's the right change? > return b.finish_name (); > b.append_name (predication_suffixes[instance.pred]); > return b.finish_name ();