@@ -337,7 +337,7 @@ mono_type_to_regmove (MonoCompile *cfg, MonoType *type)
337
337
return OP_LMOVE ;
338
338
#endif
339
339
case MONO_TYPE_R4 :
340
- return OP_RMOVE ;
340
+ return cfg -> r4fp ? OP_RMOVE : OP_FMOVE ;
341
341
case MONO_TYPE_R8 :
342
342
return OP_FMOVE ;
343
343
case MONO_TYPE_VALUETYPE :
@@ -483,8 +483,9 @@ add_widen_op (MonoCompile *cfg, MonoInst *ins, MonoInst **arg1_ref, MonoInst **a
483
483
MonoInst * arg1 = * arg1_ref ;
484
484
MonoInst * arg2 = * arg2_ref ;
485
485
486
- if ((arg1 -> type == STACK_R4 && arg2 -> type == STACK_R8 ) ||
487
- (arg1 -> type == STACK_R8 && arg2 -> type == STACK_R4 )) {
486
+ if (cfg -> r4fp &&
487
+ ((arg1 -> type == STACK_R4 && arg2 -> type == STACK_R8 ) ||
488
+ (arg1 -> type == STACK_R8 && arg2 -> type == STACK_R4 ))) {
488
489
MonoInst * conv ;
489
490
490
491
/* Mixing r4/r8 is allowed by the spec */
@@ -826,7 +827,7 @@ mini_type_to_eval_stack_type (MonoCompile *cfg, MonoType *type, MonoInst *inst)
826
827
inst -> type = STACK_I8 ;
827
828
return ;
828
829
case MONO_TYPE_R4 :
829
- inst -> type = GINT_TO_UINT8 (STACK_R4 );
830
+ inst -> type = GINT_TO_UINT8 (cfg -> r4_stack_type );
830
831
break ;
831
832
case MONO_TYPE_R8 :
832
833
inst -> type = STACK_R8 ;
@@ -1160,7 +1161,7 @@ type_from_op (MonoCompile *cfg, MonoInst *ins, MonoInst *src1, MonoInst *src2)
1160
1161
ins -> opcode += ovf2ops_op_map [src1 -> type ];
1161
1162
break ;
1162
1163
case MONO_CEE_CONV_R4 :
1163
- ins -> type = GINT_TO_UINT8 (STACK_R4 );
1164
+ ins -> type = GINT_TO_UINT8 (cfg -> r4_stack_type );
1164
1165
ins -> opcode += unops_op_map [src1 -> type ];
1165
1166
break ;
1166
1167
case MONO_CEE_CONV_R8 :
@@ -1218,7 +1219,7 @@ type_from_op (MonoCompile *cfg, MonoInst *ins, MonoInst *src1, MonoInst *src2)
1218
1219
ins -> type = STACK_I8 ;
1219
1220
break ;
1220
1221
case OP_LOADR4_MEMBASE :
1221
- ins -> type = GINT_TO_UINT8 (STACK_R4 );
1222
+ ins -> type = GINT_TO_UINT8 (cfg -> r4_stack_type );
1222
1223
break ;
1223
1224
case OP_LOADR8_MEMBASE :
1224
1225
ins -> type = STACK_R8 ;
@@ -1433,7 +1434,7 @@ mini_type_to_stack_type (MonoCompile *cfg, MonoType *t)
1433
1434
case MONO_TYPE_U8 :
1434
1435
return STACK_I8 ;
1435
1436
case MONO_TYPE_R4 :
1436
- return (MonoStackType )STACK_R4 ;
1437
+ return (MonoStackType )cfg -> r4_stack_type ;
1437
1438
case MONO_TYPE_R8 :
1438
1439
return STACK_R8 ;
1439
1440
case MONO_TYPE_VALUETYPE :
@@ -1916,7 +1917,7 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg)
1916
1917
return 1 ;
1917
1918
return 0 ;
1918
1919
case MONO_TYPE_R4 :
1919
- if (arg -> type != STACK_R4 )
1920
+ if (arg -> type != cfg -> r4_stack_type )
1920
1921
return 1 ;
1921
1922
return 0 ;
1922
1923
case MONO_TYPE_R8 :
@@ -1979,6 +1980,8 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg)
1979
1980
static MonoInst *
1980
1981
convert_value (MonoCompile * cfg , MonoType * type , MonoInst * ins )
1981
1982
{
1983
+ if (!cfg -> r4fp )
1984
+ return ins ;
1982
1985
type = mini_get_underlying_type (type );
1983
1986
switch (type -> type ) {
1984
1987
case MONO_TYPE_R4 :
@@ -2071,7 +2074,7 @@ check_call_signature (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **arg
2071
2074
return TRUE;
2072
2075
continue ;
2073
2076
case MONO_TYPE_R4 :
2074
- if (args [i ]-> type != STACK_R4 )
2077
+ if (args [i ]-> type != cfg -> r4_stack_type )
2075
2078
return TRUE;
2076
2079
continue ;
2077
2080
case MONO_TYPE_R8 :
@@ -4636,7 +4639,7 @@ mini_emit_init_rvar (MonoCompile *cfg, int dreg, MonoType *rtype)
4636
4639
MONO_EMIT_NEW_ICONST (cfg , dreg , 0 );
4637
4640
} else if (t == MONO_TYPE_I8 || t == MONO_TYPE_U8 ) {
4638
4641
MONO_EMIT_NEW_I8CONST (cfg , dreg , 0 );
4639
- } else if (t == MONO_TYPE_R4 ) {
4642
+ } else if (cfg -> r4fp && t == MONO_TYPE_R4 ) {
4640
4643
MONO_INST_NEW (cfg , ins , OP_R4CONST );
4641
4644
ins -> type = STACK_R4 ;
4642
4645
ins -> inst_p0 = (void * )& r4_0 ;
@@ -4672,7 +4675,7 @@ emit_dummy_init_rvar (MonoCompile *cfg, int dreg, MonoType *rtype)
4672
4675
MONO_EMIT_NEW_DUMMY_INIT (cfg , dreg , OP_DUMMY_ICONST );
4673
4676
} else if (t == MONO_TYPE_I8 || t == MONO_TYPE_U8 ) {
4674
4677
MONO_EMIT_NEW_DUMMY_INIT (cfg , dreg , OP_DUMMY_I8CONST );
4675
- } else if (t == MONO_TYPE_R4 ) {
4678
+ } else if (cfg -> r4fp && t == MONO_TYPE_R4 ) {
4676
4679
MONO_EMIT_NEW_DUMMY_INIT (cfg , dreg , OP_DUMMY_R4CONST );
4677
4680
} else if (t == MONO_TYPE_R4 || t == MONO_TYPE_R8 ) {
4678
4681
MONO_EMIT_NEW_DUMMY_INIT (cfg , dreg , OP_DUMMY_R8CONST );
@@ -7278,10 +7281,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
7278
7281
7279
7282
dreg = alloc_freg (cfg );
7280
7283
EMIT_NEW_LOAD_MEMBASE (cfg , ins , OP_LOADR4_MEMBASE , dreg , cons -> dreg , 0 );
7281
- ins -> type = GINT_TO_UINT8 (STACK_R4 );
7284
+ ins -> type = GINT_TO_UINT8 (cfg -> r4_stack_type );
7282
7285
} else {
7283
7286
MONO_INST_NEW (cfg , ins , OP_R4CONST );
7284
- ins -> type = GINT_TO_UINT8 (STACK_R4 );
7287
+ ins -> type = GINT_TO_UINT8 (cfg -> r4_stack_type );
7285
7288
ins -> dreg = alloc_dreg (cfg , STACK_R8 );
7286
7289
ins -> inst_p0 = f ;
7287
7290
MONO_ADD_INS (cfg -> cbb , ins );
0 commit comments