@@ -548,12 +548,11 @@ emit_xcompare_for_intrinsic (MonoCompile *cfg, MonoClass *klass, int intrinsic_i
548
548
}
549
549
550
550
static MonoInst *
551
- emit_xequal (MonoCompile * cfg , MonoClass * klass , MonoInst * arg1 , MonoInst * arg2 )
551
+ emit_xequal (MonoCompile * cfg , MonoClass * klass , MonoTypeEnum element_type , MonoInst * arg1 , MonoInst * arg2 )
552
552
{
553
553
#ifdef TARGET_ARM64
554
554
if (!COMPILE_LLVM (cfg )) {
555
- MonoTypeEnum elemt = get_underlying_type (m_class_get_this_arg (arg1 -> klass ));
556
- MonoInst * cmp = emit_xcompare (cfg , arg1 -> klass , elemt , arg1 , arg2 );
555
+ MonoInst * cmp = emit_xcompare (cfg , klass , element_type , arg1 , arg2 );
557
556
MonoInst * ret = emit_simd_ins (cfg , mono_defaults .boolean_class , OP_XEXTRACT , cmp -> dreg , -1 );
558
557
ret -> inst_c0 = SIMD_EXTR_ARE_ALL_SET ;
559
558
ret -> inst_c1 = mono_class_value_size (klass , NULL );
@@ -572,9 +571,9 @@ emit_xequal (MonoCompile *cfg, MonoClass *klass, MonoInst *arg1, MonoInst *arg2)
572
571
}
573
572
574
573
static MonoInst *
575
- emit_not_xequal (MonoCompile * cfg , MonoClass * klass , MonoInst * arg1 , MonoInst * arg2 )
574
+ emit_not_xequal (MonoCompile * cfg , MonoClass * klass , MonoTypeEnum element_type , MonoInst * arg1 , MonoInst * arg2 )
576
575
{
577
- MonoInst * ins = emit_xequal (cfg , klass , arg1 , arg2 );
576
+ MonoInst * ins = emit_xequal (cfg , klass , element_type , arg1 , arg2 );
578
577
int sreg = ins -> dreg ;
579
578
int dreg = alloc_ireg (cfg );
580
579
MONO_EMIT_NEW_BIALU_IMM (cfg , OP_COMPARE_IMM , -1 , sreg , 0 );
@@ -1784,11 +1783,11 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
1784
1783
if (COMPILE_LLVM (cfg )) {
1785
1784
switch (id ) {
1786
1785
case SN_EqualsAll :
1787
- return emit_xequal (cfg , arg_class , args [0 ], args [1 ]);
1786
+ return emit_xequal (cfg , arg_class , arg0_type , args [0 ], args [1 ]);
1788
1787
case SN_EqualsAny : {
1789
1788
MonoInst * cmp_eq = emit_xcompare (cfg , arg_class , arg0_type , args [0 ], args [1 ]);
1790
1789
MonoInst * zero = emit_xzero (cfg , arg_class );
1791
- return emit_not_xequal (cfg , arg_class , cmp_eq , zero );
1790
+ return emit_not_xequal (cfg , arg_class , arg0_type , cmp_eq , zero );
1792
1791
}
1793
1792
}
1794
1793
} else {
@@ -1979,14 +1978,14 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
1979
1978
if (type_enum_is_float (arg0_type )) {
1980
1979
MonoInst * zero = emit_xzero (cfg , arg_class );
1981
1980
MonoInst * inverted_cmp = emit_xcompare (cfg , klass , arg0_type , cmp , zero );
1982
- return emit_xequal (cfg , arg_class , inverted_cmp , zero );
1981
+ return emit_xequal (cfg , arg_class , arg0_type , inverted_cmp , zero );
1983
1982
}
1984
1983
1985
1984
MonoInst * ones = emit_xones (cfg , arg_class );
1986
- return emit_xequal (cfg , arg_class , cmp , ones );
1985
+ return emit_xequal (cfg , arg_class , arg0_type , cmp , ones );
1987
1986
} else {
1988
1987
MonoInst * zero = emit_xzero (cfg , arg_class );
1989
- return emit_not_xequal (cfg , arg_class , cmp , zero );
1988
+ return emit_not_xequal (cfg , arg_class , arg0_type , cmp , zero );
1990
1989
}
1991
1990
} else {
1992
1991
MonoInst * cmp = emit_xcompare_for_intrinsic (cfg , arg_class , id , arg0_type , args [0 ], args [1 ]);
@@ -2516,8 +2515,8 @@ emit_vector64_vector128_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
2516
2515
return NULL ;
2517
2516
MonoClass * arg_class = mono_class_from_mono_type_internal (fsig -> params [0 ]);
2518
2517
switch (id ) {
2519
- case SN_op_Equality : return emit_xequal (cfg , arg_class , args [0 ], args [1 ]);
2520
- case SN_op_Inequality : return emit_not_xequal (cfg , arg_class , args [0 ], args [1 ]);
2518
+ case SN_op_Equality : return emit_xequal (cfg , arg_class , arg0_type , args [0 ], args [1 ]);
2519
+ case SN_op_Inequality : return emit_not_xequal (cfg , arg_class , arg0_type , args [0 ], args [1 ]);
2521
2520
default : g_assert_not_reached ();
2522
2521
}
2523
2522
}
@@ -2600,28 +2599,7 @@ emit_vector_2_3_4 (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *f
2600
2599
// when a method gets enabled should be removed from here
2601
2600
switch (id ) {
2602
2601
case SN_ctor :
2603
- case SN_Clamp :
2604
- case SN_Conjugate :
2605
- case SN_CopyTo :
2606
- case SN_Distance :
2607
- case SN_DistanceSquared :
2608
- case SN_Dot :
2609
- case SN_Length :
2610
- case SN_LengthSquared :
2611
- case SN_Lerp :
2612
- case SN_Negate :
2613
- case SN_Normalize :
2614
- case SN_get_Identity :
2615
2602
case SN_get_Item :
2616
- case SN_get_One :
2617
- case SN_get_UnitW :
2618
- case SN_get_UnitX :
2619
- case SN_get_UnitY :
2620
- case SN_get_UnitZ :
2621
- case SN_get_Zero :
2622
- case SN_op_Equality :
2623
- case SN_op_Inequality :
2624
- case SN_op_UnaryNegation :
2625
2603
case SN_set_Item :
2626
2604
return NULL ;
2627
2605
default :
@@ -2789,8 +2767,7 @@ emit_vector_2_3_4 (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *f
2789
2767
}
2790
2768
case SN_Dot : {
2791
2769
#if defined(TARGET_ARM64 ) || defined(TARGET_WASM )
2792
- int instc0 = OP_FMUL ;
2793
- MonoInst * pairwise_multiply = emit_simd_ins_for_sig (cfg , klass , OP_XBINOP , instc0 , MONO_TYPE_R4 , fsig , args );
2770
+ MonoInst * pairwise_multiply = emit_simd_ins_for_sig (cfg , klass , OP_XBINOP , OP_FMUL , MONO_TYPE_R4 , fsig , args );
2794
2771
return emit_sum_vector (cfg , fsig -> params [0 ], MONO_TYPE_R4 , pairwise_multiply );
2795
2772
#elif defined(TARGET_AMD64 )
2796
2773
if (!(mini_get_cpu_features (cfg ) & MONO_CPU_X86_SSE41 ))
@@ -2815,7 +2792,9 @@ emit_vector_2_3_4 (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *f
2815
2792
case SN_Negate :
2816
2793
case SN_op_UnaryNegation : {
2817
2794
#if defined(TARGET_ARM64 ) || defined(TARGET_AMD64 )
2818
- return emit_simd_ins (cfg , klass , OP_NEGATION , args [0 ]-> dreg , -1 );
2795
+ ins = emit_simd_ins (cfg , klass , OP_NEGATION , args [0 ]-> dreg , -1 );
2796
+ ins -> inst_c1 = MONO_TYPE_R4 ;
2797
+ return ins ;
2819
2798
#else
2820
2799
return NULL ;
2821
2800
#endif
@@ -2840,13 +2819,13 @@ emit_vector_2_3_4 (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *f
2840
2819
if (!(fsig -> param_count == 2 && mono_metadata_type_equal (fsig -> params [0 ], type ) && mono_metadata_type_equal (fsig -> params [1 ], type )))
2841
2820
return NULL ;
2842
2821
MonoClass * arg_class = mono_class_from_mono_type_internal (fsig -> params [0 ]);
2843
- return emit_xequal (cfg , arg_class , args [0 ], args [1 ]);
2822
+ return emit_xequal (cfg , arg_class , MONO_TYPE_R4 , args [0 ], args [1 ]);
2844
2823
}
2845
2824
case SN_op_Inequality : {
2846
2825
if (!(fsig -> param_count == 2 && mono_metadata_type_equal (fsig -> params [0 ], type ) && mono_metadata_type_equal (fsig -> params [1 ], type )))
2847
2826
return NULL ;
2848
2827
MonoClass * arg_class = mono_class_from_mono_type_internal (fsig -> params [0 ]);
2849
- return emit_not_xequal (cfg , arg_class , args [0 ], args [1 ]);
2828
+ return emit_not_xequal (cfg , arg_class , MONO_TYPE_R4 , args [0 ], args [1 ]);
2850
2829
}
2851
2830
case SN_SquareRoot : {
2852
2831
#ifdef TARGET_ARM64
@@ -3207,8 +3186,8 @@ emit_sys_numerics_vector_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSig
3207
3186
mono_metadata_type_equal (fsig -> params [0 ], type ) &&
3208
3187
mono_metadata_type_equal (fsig -> params [1 ], type ));
3209
3188
switch (id ) {
3210
- case SN_op_Equality : return emit_xequal (cfg , klass , args [0 ], args [1 ]);
3211
- case SN_op_Inequality : return emit_not_xequal (cfg , klass , args [0 ], args [1 ]);
3189
+ case SN_op_Equality : return emit_xequal (cfg , klass , etype -> type , args [0 ], args [1 ]);
3190
+ case SN_op_Inequality : return emit_not_xequal (cfg , klass , etype -> type , args [0 ], args [1 ]);
3212
3191
default : g_assert_not_reached ();
3213
3192
}
3214
3193
case SN_GreaterThan :
0 commit comments