Skip to content

Commit

Permalink
[Mono] Intrinsify Vector unary plus operator (#66586)
Browse files Browse the repository at this point in the history
* Implement unary plus

* Fix param count assertion
  • Loading branch information
simonrozsival authored Mar 15, 2022
1 parent 84de128 commit 2774e52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,7 @@ static guint16 vector64_vector128_t_methods [] = {
SN_op_OnesComplement,
SN_op_Subtraction,
SN_op_UnaryNegation,
SN_op_UnaryPlus,
};

static MonoInst*
Expand Down Expand Up @@ -1466,6 +1467,10 @@ emit_vector64_vector128_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
if (fsig->param_count != 1 )
return NULL;
return emit_simd_ins_for_unary_op (cfg, klass, fsig, args, arg0_type, id);
case SN_op_UnaryPlus:
if (fsig->param_count != 1)
return NULL;
return args [0];
default:
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/mono/mono/mini/simd-methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ METHOD(op_Multiply)
METHOD(op_OnesComplement)
METHOD(op_Subtraction)
METHOD(op_UnaryNegation)
METHOD(op_UnaryPlus)
// Vector
METHOD(ConvertToInt32)
METHOD(ConvertToInt32WithTruncation)
Expand Down

0 comments on commit 2774e52

Please sign in to comment.