Skip to content

Commit

Permalink
[Mono] Support get_Count and get_AllBitsSet for mini JIT on Arm64 (#8…
Browse files Browse the repository at this point in the history
…4180)

* Support get_Count and get_AllBitsSet

* nint and nuint are 8 bytes on arm64 as well.

* Fix syntax
  • Loading branch information
fanyang-mono committed Apr 4, 2023
1 parent 7b645f7 commit 6ad78ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
1 change: 1 addition & 0 deletions src/mono/mono/mini/cpu-arm64.mdesc
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ atomic_store_r4: dest:b src1:f len:28
atomic_store_r8: dest:b src1:f len:24
xbinop: dest:x src1:x src2:x len:8 clob:1
xzero: dest:x len:4
xones: dest:x len:8
xmove: dest:x src1:x len:4
xconst: dest:x len:10
xcompare: dest:x src1:x src2:x len:4
Expand Down
4 changes: 4 additions & 0 deletions src/mono/mono/mini/mini-arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -3910,6 +3910,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
case OP_XZERO:
arm_neon_eor_16b (code, dreg, dreg, dreg);
break;
case OP_XONES:
arm_neon_eor_16b (code, dreg, dreg, dreg);
arm_neon_not_16b (code, dreg, dreg);
break;
case OP_XEXTRACT:
code = emit_xextract (code, VREG_FULL, ins->inst_c0, dreg, sreg1);
break;
Expand Down
28 changes: 3 additions & 25 deletions src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ emit_simd_ins_for_binary_op (MonoCompile *cfg, MonoClass *klass, MonoMethodSigna
case SN_Multiply:
case SN_op_Multiply: {
#ifdef TARGET_ARM64
if (!COMPILE_LLVM (cfg) && (arg_type == MONO_TYPE_I8 || arg_type == MONO_TYPE_U8))
if (!COMPILE_LLVM (cfg) && (arg_type == MONO_TYPE_I8 || arg_type == MONO_TYPE_U8 || arg_type == MONO_TYPE_I || arg_type == MONO_TYPE_U))
return NULL;
#endif
if (fsig->params [1]->type != MONO_TYPE_GENERICINST)
Expand Down Expand Up @@ -1950,32 +1950,10 @@ emit_vector64_vector128_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
return NULL;
#endif

// FIXME: This limitation could be removed once everything here are supported by mini JIT on arm64
// FIXME: Support Vector64 for mini JIT on arm64
#ifdef TARGET_ARM64
if (!COMPILE_LLVM (cfg)) {
if (!COMPILE_LLVM (cfg) && (size != 16))
return NULL;
if (size != 16)
return NULL;
switch (id) {
case SN_get_One:
case SN_get_Zero:
case SN_op_OnesComplement:
case SN_op_UnaryNegation:
case SN_op_UnaryPlus:
case SN_op_Addition:
case SN_op_Subtraction:
case SN_op_BitwiseAnd:
case SN_op_BitwiseOr:
case SN_op_ExclusiveOr:
case SN_op_Equality:
case SN_op_Inequality:
case SN_op_Division:
case SN_op_Multiply:
break;
default:
return NULL;
}
}
#endif

switch (id) {
Expand Down

0 comments on commit 6ad78ff

Please sign in to comment.