@@ -710,6 +710,17 @@ MONO_RESTORE_WARNING
710710 opcode = (tto_type == MONO_TYPE_I2 ) ? OP_ICONV_TO_I2 : OP_ICONV_TO_U2 ;
711711 tto_stack = STACK_I4 ;
712712 } else if (size == 4 ) {
713+ #if TARGET_SIZEOF_VOID_P == 4
714+ if (tto_type == MONO_TYPE_I )
715+ tto_type = MONO_TYPE_I4 ;
716+ else if (tto_type == MONO_TYPE_U )
717+ tto_type = MONO_TYPE_U4 ;
718+
719+ if (tfrom_type == MONO_TYPE_I )
720+ tfrom_type = MONO_TYPE_I4 ;
721+ else if (tfrom_type == MONO_TYPE_U )
722+ tfrom_type = MONO_TYPE_U4 ;
723+ #endif
713724 if ((tfrom_type == MONO_TYPE_R4 ) && ((tto_type == MONO_TYPE_I4 ) || (tto_type == MONO_TYPE_U4 ))) {
714725 opcode = OP_MOVE_F_TO_I4 ;
715726 tto_stack = STACK_I4 ;
@@ -722,26 +733,33 @@ MONO_RESTORE_WARNING
722733 }
723734 } else if (size == 8 ) {
724735#if TARGET_SIZEOF_VOID_P == 8
725- if ((tfrom_type == MONO_TYPE_R8 ) && ((tto_type == MONO_TYPE_I8 ) || (tto_type == MONO_TYPE_U8 ))) {
726- opcode = OP_MOVE_F_TO_I8 ;
727- tto_stack = STACK_I8 ;
728- } else if ((tto_type == MONO_TYPE_R8 ) && ((tfrom_type == MONO_TYPE_I8 ) || (tfrom_type == MONO_TYPE_U8 ))) {
729- opcode = OP_MOVE_I8_TO_F ;
730- tto_stack = STACK_R8 ;
731- } else {
732- opcode = OP_MOVE ;
733- tto_stack = STACK_I8 ;
734- }
735- #else
736- return NULL ;
736+ if (tto_type == MONO_TYPE_I )
737+ tto_type = MONO_TYPE_I8 ;
738+ else if (tto_type == MONO_TYPE_U )
739+ tto_type = MONO_TYPE_U8 ;
740+
741+ if (tfrom_type == MONO_TYPE_I )
742+ tfrom_type = MONO_TYPE_I8 ;
743+ else if (tfrom_type == MONO_TYPE_U )
744+ tfrom_type = MONO_TYPE_U8 ;
737745#endif
746+ if ((tfrom_type == MONO_TYPE_R8 ) && ((tto_type == MONO_TYPE_I8 ) || (tto_type == MONO_TYPE_U8 ))) {
747+ opcode = OP_MOVE_F_TO_I8 ;
748+ tto_stack = STACK_I8 ;
749+ } else if ((tto_type == MONO_TYPE_R8 ) && ((tfrom_type == MONO_TYPE_I8 ) || (tfrom_type == MONO_TYPE_U8 ))) {
750+ opcode = OP_MOVE_I8_TO_F ;
751+ tto_stack = STACK_R8 ;
752+ } else {
753+ opcode = OP_MOVE ;
754+ tto_stack = STACK_I8 ;
755+ }
738756 }
739757 } else if (mini_class_is_simd (cfg , tfrom_klass ) && mini_class_is_simd (cfg , tto_klass )) {
740- #if TARGET_SIZEOF_VOID_P == 8
741- opcode = OP_XCAST ;
742- tto_stack = STACK_VTYPE ;
758+ #if TARGET_SIZEOF_VOID_P == 8 || defined( TARGET_WASM )
759+ opcode = OP_XCAST ;
760+ tto_stack = STACK_VTYPE ;
743761#else
744- return NULL ;
762+ return NULL ;
745763#endif
746764 }
747765
0 commit comments