@@ -257,6 +257,15 @@ emit_xcompare (MonoCompile *cfg, MonoClass *klass, MonoTypeEnum etype, MonoInst
257257return ins ;
258258}
259259
260+ static gboolean
261+ is_intrinsics_vector_type (MonoType * vector_type )
262+ {
263+ if (vector_type -> type != MONO_TYPE_GENERICINST )return FALSE;
264+ MonoClass * klass = mono_class_from_mono_type_internal (vector_type );
265+ const char * name = m_class_get_name (klass );
266+ return !strcmp (name ,"Vector64`1" )|| !strcmp (name ,"Vector128`1" )|| !strcmp (name ,"Vector256`1" );
267+ }
268+
260269static MonoType *
261270get_vector_t_elem_type (MonoType * vector_type )
262271{
@@ -487,6 +496,28 @@ static guint16 sri_vector_methods [] = {
487496SN_CreateScalarUnsafe ,
488497};
489498
499+ static gboolean
500+ is_elementwise_create_overload (MonoMethodSignature * fsig ,MonoType * ret_type )
501+ {
502+ uint16_t param_count = fsig -> param_count ;
503+ if (param_count < 1 )return FALSE;
504+ MonoType * type = fsig -> params [0 ];
505+ gboolean is_vector_primitive = MONO_TYPE_IS_PRIMITIVE (type )&& (type -> type >=MONO_TYPE_I1 && type -> type <=MONO_TYPE_R8 );
506+ if (!is_vector_primitive )return FALSE;
507+ if (!mono_metadata_type_equal (ret_type ,type ))return FALSE;
508+ for (uint16_t i = 1 ;i < param_count ;++ i )
509+ if (!mono_metadata_type_equal (type ,fsig -> params [i ]))return FALSE;
510+ return TRUE;
511+ }
512+
513+ static gboolean
514+ is_create_from_half_vectors_overload (MonoMethodSignature * fsig )
515+ {
516+ if (fsig -> param_count != 2 )return FALSE;
517+ if (!is_intrinsics_vector_type (fsig -> params [0 ]))return FALSE;
518+ return mono_metadata_type_equal (fsig -> params [0 ],fsig -> params [1 ]);
519+ }
520+
490521static MonoInst *
491522emit_sri_vector (MonoCompile * cfg ,MonoMethod * cmethod ,MonoMethodSignature * fsig ,MonoInst * * args )
492523{
@@ -519,8 +550,11 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
519550MonoType * etype = get_vector_t_elem_type (fsig -> ret );
520551if (fsig -> param_count == 1 && mono_metadata_type_equal (fsig -> params [0 ],etype ))
521552return emit_simd_ins (cfg ,klass ,type_to_expand_op (etype ),args [0 ]-> dreg ,-1 );
522- else
553+ else if (is_create_from_half_vectors_overload (fsig ))
554+ return emit_simd_ins (cfg ,klass ,OP_XCONCAT ,args [0 ]-> dreg ,args [1 ]-> dreg );
555+ else if (is_elementwise_create_overload (fsig ,etype ))
523556return emit_vector_create_elementwise (cfg ,fsig ,fsig -> ret ,etype ,args );
557+ break ;
524558}
525559case SN_CreateScalarUnsafe :
526560return emit_simd_ins_for_sig (cfg ,klass ,OP_CREATE_SCALAR_UNSAFE ,-1 ,arg0_type ,fsig ,args );