Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mono] Support get_Count and get_AllBitsSet for mini JIT on Arm64 #84180

Merged
merged 3 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3917,6 +3917,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;
fanyang-mono marked this conversation as resolved.
Show resolved Hide resolved
#endif
if (fsig->params [1]->type != MONO_TYPE_GENERICINST)
Expand Down Expand Up @@ -1944,32 +1944,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)
fanyang-mono marked this conversation as resolved.
Show resolved Hide resolved
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