Skip to content
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: 0 additions & 1 deletion src/mono/mono/mini/cpu-amd64.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ float_cgt_membase: dest:i src1:f src2:b len:35
float_cgt_un_membase: dest:i src1:f src2:b len:48
float_clt_membase: dest:i src1:f src2:b len:35
float_clt_un_membase: dest:i src1:f src2:b len:42
float_conv_to_u: dest:i src1:f len:46

# R4 opcodes
r4_conv_to_i1: dest:i src1:f len:32
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-arm.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ float_clt_un: dest:i src1:f src2:f len:20
float_cneq: dest:y src1:f src2:f len:20
float_cge: dest:y src1:f src2:f len:20
float_cle: dest:y src1:f src2:f len:20
float_conv_to_u: dest:i src1:f len:36

# R4 opcodes
rmove: dest:f src1:f len:4
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-arm64.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ float_clt_un: dest:i src1:f src2:f len:20
float_cneq: dest:i src1:f src2:f len:20
float_cge: dest:i src1:f src2:f len:20
float_cle: dest:i src1:f src2:f len:20
float_conv_to_u: dest:i src1:f len:36
setfret: src1:f len:12

# R4 opcodes
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-mips.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ float_cgt: dest:i src1:f src2:f len:20
float_cgt_un: dest:i src1:f src2:f len:20
float_clt: dest:i src1:f src2:f len:20
float_clt_un: dest:i src1:f src2:f len:20
float_conv_to_u: dest:i src1:f len:36
call_handler: len:20 clob:c
endfilter: src1:i len:16
aotconst: dest:i len:8
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-ppc.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ float_cgt: dest:i src1:f src2:f len:16
float_cgt_un: dest:i src1:f src2:f len:20
float_clt: dest:i src1:f src2:f len:16
float_clt_un: dest:i src1:f src2:f len:20
float_conv_to_u: dest:i src1:f len:36
float_cneq: dest:i src1:f src2:f len:16
float_cge: dest:i src1:f src2:f len:16
float_cle: dest:i src1:f src2:f len:16
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-ppc64.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ float_cgt: dest:i src1:f src2:f len:16
float_cgt_un: dest:i src1:f src2:f len:20
float_clt: dest:i src1:f src2:f len:16
float_clt_un: dest:i src1:f src2:f len:20
float_conv_to_u: dest:i src1:f len:36
float_cneq: dest:i src1:f src2:f len:16
float_cge: dest:i src1:f src2:f len:16
float_cle: dest:i src1:f src2:f len:16
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-s390x.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ float_conv_to_u1: dest:i src1:f len:72
float_conv_to_u2: dest:i src1:f len:72
float_conv_to_u4: dest:i src1:f len:72
float_conv_to_u8: dest:i src1:f len:72
float_conv_to_u: dest:i src1:f len:36
float_div: dest:f src1:f src2:f len:24
float_div_un: dest:f src1:f src2:f len:30
float_mul: dest:f src1:f src2:f len:8
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-sparc.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ float_cgt: dest:i src1:f src2:f len:64
float_cgt_un: dest:i src1:f src2:f len:64
float_clt: dest:i src1:f src2:f len:64
float_clt_un: dest:i src1:f src2:f len:64
float_conv_to_u: dest:i src1:f len:64
call_handler: len:64 clob:c
aotconst: dest:i len:64
adc: dest:i src1:i src2:i len:4
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/cpu-x86.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ float_clt_un: dest:y src1:f src2:f len:32
float_cneq: dest:y src1:f src2:f len:25
float_cge: dest:y src1:f src2:f len:37
float_cle: dest:y src1:f src2:f len:37
float_conv_to_u: dest:i src1:f len:36
call_handler: len:11 clob:c
aotconst: dest:i len:5
load_gotaddr: dest:i len:64
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5169,7 +5169,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
MINT_IN_BREAK;
MINT_IN_CASE(MINT_CONV_U4_R8)
#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4
LOCAL_VAR (ip [1], gint32) = mono_fconv_u4_2 (LOCAL_VAR (ip [2], double));
LOCAL_VAR (ip [1], gint32) = mono_fconv_u4 (LOCAL_VAR (ip [2], double));
#else
LOCAL_VAR (ip [1], gint32) = (guint32) LOCAL_VAR (ip [2], double);
#endif
Expand Down Expand Up @@ -5225,7 +5225,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
MINT_IN_BREAK;
MINT_IN_CASE(MINT_CONV_U8_R8)
#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8
LOCAL_VAR (ip [1], gint64) = mono_fconv_u8_2 (LOCAL_VAR (ip [2], double));
LOCAL_VAR (ip [1], gint64) = mono_fconv_u8 (LOCAL_VAR (ip [2], double));
#else
LOCAL_VAR (ip [1], gint64) = (guint64) LOCAL_VAR (ip [2], double);
#endif
Expand Down
26 changes: 2 additions & 24 deletions src/mono/mono/mini/jit-icalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ mono_ldtoken_wrapper_generic_shared (MonoImage *image, int token, MonoMethod *me
return mono_ldtoken_wrapper (image, token, generic_context);
}

#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8
guint64
mono_fconv_u8 (double v)
{
Expand All @@ -935,18 +936,6 @@ mono_fconv_u8 (double v)
#endif
}

#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8
guint64
mono_fconv_u8_2 (double v)
{
// Separate from mono_fconv_u8 to avoid duplicate JIT icall.
//
// When there are duplicates, there is single instancing
// against function address that breaks stuff. For example,
// wrappers are only produced for one of them, breaking FullAOT.
return mono_fconv_u8 (v);
}

guint64
mono_rconv_u8 (float v)
{
Expand All @@ -973,6 +962,7 @@ mono_fconv_i8 (double v)
}
#endif

#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4
guint32
mono_fconv_u4 (double v)
{
Expand All @@ -982,18 +972,6 @@ mono_fconv_u4 (double v)
return (guint32)v;
}

#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4
guint32
mono_fconv_u4_2 (double v)
{
// Separate from mono_fconv_u4 to avoid duplicate JIT icall.
//
// When there are duplicates, there is single instancing
// against function address that breaks stuff. For example,
// wrappers are only produced for one of them, breaking FullAOT.
return mono_fconv_u4 (v);
}

guint32
mono_rconv_u4 (float v)
{
Expand Down
2 changes: 0 additions & 2 deletions src/mono/mono/mini/jit-icalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ ICALL_EXPORT gpointer mono_ldtoken_wrapper (MonoImage *image, int token, MonoGen
ICALL_EXPORT gpointer mono_ldtoken_wrapper_generic_shared (MonoImage *image, int token, MonoMethod *method);

ICALL_EXPORT guint64 mono_fconv_u8 (double v);
ICALL_EXPORT guint64 mono_fconv_u8_2 (double v);

ICALL_EXPORT guint64 mono_rconv_u8 (float v);

ICALL_EXPORT gint64 mono_fconv_i8 (double v);

ICALL_EXPORT guint32 mono_fconv_u4 (double v);
ICALL_EXPORT guint32 mono_fconv_u4_2 (double v);

ICALL_EXPORT guint32 mono_rconv_u4 (float v);

Expand Down
5 changes: 4 additions & 1 deletion src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,10 @@ type_from_op (MonoCompile *cfg, MonoInst *ins, MonoInst *src1, MonoInst *src2)
ins->opcode = OP_LCONV_TO_U;
break;
case STACK_R8:
ins->opcode = OP_FCONV_TO_U;
if (TARGET_SIZEOF_VOID_P == 8)
ins->opcode = OP_FCONV_TO_U8;
else
ins->opcode = OP_FCONV_TO_U4;
break;
case STACK_R4:
if (TARGET_SIZEOF_VOID_P == 8)
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5686,7 +5686,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
break;
case OP_FCONV_TO_U4:
case OP_FCONV_TO_U:
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE);
break;
case OP_FCONV_TO_I8:
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,6 @@ op_to_llvm_type (int opcode)
case OP_RCONV_TO_U8:
return LLVMInt64Type ();
case OP_FCONV_TO_I:
case OP_FCONV_TO_U:
return TARGET_SIZEOF_VOID_P == 8 ? LLVMInt64Type () : LLVMInt32Type ();
case OP_IADD_OVF:
case OP_IADD_OVF_UN:
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -4270,7 +4270,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
break;
case OP_FCONV_TO_U4:
case OP_FCONV_TO_U:
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE);
break;
case OP_SQRT:
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ MINI_OP(OP_FCGT_UN_MEMBASE,"float_cgt_un_membase", IREG, FREG, IREG)
MINI_OP(OP_FCLT_MEMBASE, "float_clt_membase", IREG, FREG, IREG)
MINI_OP(OP_FCLT_UN_MEMBASE,"float_clt_un_membase", IREG, FREG, IREG)

MINI_OP(OP_FCONV_TO_U, "float_conv_to_u", IREG, FREG, NONE)
MINI_OP(OP_CKFINITE, "ckfinite", FREG, FREG, NONE)

/* r4 opcodes: must be in the same order as the matching CEE_ opcodes: ovfops_op_map */
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-ppc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4163,7 +4163,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
break;
case OP_FCONV_TO_U4:
case OP_FCONV_TO_U:
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE);
break;
case OP_LCONV_TO_R_UN:
Expand Down
11 changes: 2 additions & 9 deletions src/mono/mono/mini/mini-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -4760,11 +4760,11 @@ register_icalls (void)
#endif

#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8
register_opcode_emulation (OP_FCONV_TO_U8, __emul_fconv_to_u8, mono_icall_sig_ulong_double, mono_fconv_u8_2, FALSE);
register_opcode_emulation (OP_FCONV_TO_U8, __emul_fconv_to_u8, mono_icall_sig_ulong_double, mono_fconv_u8, FALSE);
register_opcode_emulation (OP_RCONV_TO_U8, __emul_rconv_to_u8, mono_icall_sig_ulong_float, mono_rconv_u8, FALSE);
#endif
#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4
register_opcode_emulation (OP_FCONV_TO_U4, __emul_fconv_to_u4, mono_icall_sig_uint32_double, mono_fconv_u4_2, FALSE);
register_opcode_emulation (OP_FCONV_TO_U4, __emul_fconv_to_u4, mono_icall_sig_uint32_double, mono_fconv_u4, FALSE);
register_opcode_emulation (OP_RCONV_TO_U4, __emul_rconv_to_u4, mono_icall_sig_uint32_float, mono_rconv_u4, FALSE);
#endif
register_opcode_emulation (OP_FCONV_TO_OVF_I8, __emul_fconv_to_ovf_i8, mono_icall_sig_long_double, mono_fconv_ovf_i8, FALSE);
Expand Down Expand Up @@ -4842,13 +4842,6 @@ register_icalls (void)
register_icall (mono_class_interface_match, mono_icall_sig_uint32_ptr_int32, TRUE);
#endif

// FIXME Elsewhere these are registered with no_wrapper = FALSE
#if SIZEOF_REGISTER == 4
register_opcode_emulation (OP_FCONV_TO_U, __emul_fconv_to_u, mono_icall_sig_uint32_double, mono_fconv_u4, TRUE);
#else
register_opcode_emulation (OP_FCONV_TO_U, __emul_fconv_to_u, mono_icall_sig_ulong_double, mono_fconv_u8, TRUE);
#endif

/* other jit icalls */
register_icall (ves_icall_mono_delegate_ctor, mono_icall_sig_void_object_object_ptr, FALSE);
register_icall (ves_icall_mono_delegate_ctor_interp, mono_icall_sig_void_object_object_ptr, FALSE);
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-s390x.c
Original file line number Diff line number Diff line change
Expand Up @@ -4290,7 +4290,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
s390_cfdbr (code, ins->dreg, 5, ins->sreg1);
break;
case OP_FCONV_TO_U4:
case OP_FCONV_TO_U:
if (mono_hwcap_s390x_has_fpe) {
s390_clgdbr (code, ins->dreg, 5, ins->sreg1, 0);
} else {
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-sparc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3395,7 +3395,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
case OP_FCONV_TO_U2:
#ifndef SPARCV9
case OP_FCONV_TO_I:
case OP_FCONV_TO_U:
#endif
case OP_FCONV_TO_I4:
case OP_FCONV_TO_U4: {
Expand Down