Loading target-mips/exec.h +6 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,9 @@ void do_drotrv (void); #endif #endif #if HOST_LONG_BITS < 64 void do_div (void); #endif #if TARGET_LONG_BITS > HOST_LONG_BITS void do_mult (void); void do_multu (void); Loading @@ -89,10 +92,12 @@ void do_madd (void); void do_maddu (void); void do_msub (void); void do_msubu (void); #endif #ifdef TARGET_MIPS64 void do_ddiv (void); #if TARGET_LONG_BITS > HOST_LONG_BITS void do_ddivu (void); #endif #ifdef TARGET_MIPS64 void do_dmult (void); void do_dmultu (void); #endif Loading target-mips/op.c +11 −12 Original line number Diff line number Diff line Loading @@ -368,14 +368,22 @@ void op_mul (void) RETURN(); } #if HOST_LONG_BITS < 64 void op_div (void) { CALL_FROM_TB0(do_div); RETURN(); } #else void op_div (void) { if (T1 != 0) { env->LO = (int32_t)((int32_t)T0 / (int32_t)T1); env->HI = (int32_t)((int32_t)T0 % (int32_t)T1); env->LO = (int32_t)((int64_t)(int32_t)T0 / (int32_t)T1); env->HI = (int32_t)((int64_t)(int32_t)T0 % (int32_t)T1); } RETURN(); } #endif void op_divu (void) { Loading Loading @@ -432,7 +440,6 @@ void op_dmul (void) RETURN(); } #if TARGET_LONG_BITS > HOST_LONG_BITS /* Those might call libgcc functions. */ void op_ddiv (void) { Loading @@ -440,21 +447,13 @@ void op_ddiv (void) RETURN(); } #if TARGET_LONG_BITS > HOST_LONG_BITS void op_ddivu (void) { do_ddivu(); RETURN(); } #else void op_ddiv (void) { if (T1 != 0) { env->LO = (int64_t)T0 / (int64_t)T1; env->HI = (int64_t)T0 % (int64_t)T1; } RETURN(); } void op_ddivu (void) { if (T1 != 0) { Loading target-mips/op_helper.c +11 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,17 @@ void do_msubu (void) } #endif #if HOST_LONG_BITS < 64 void do_div (void) { /* 64bit datatypes because we may see overflow/underflow. */ if (T1 != 0) { env->LO = (int32_t)((int64_t)(int32_t)T0 / (int32_t)T1); env->HI = (int32_t)((int64_t)(int32_t)T0 % (int32_t)T1); } } #endif #ifdef TARGET_MIPS64 void do_dmult (void) { Loading Loading
target-mips/exec.h +6 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,9 @@ void do_drotrv (void); #endif #endif #if HOST_LONG_BITS < 64 void do_div (void); #endif #if TARGET_LONG_BITS > HOST_LONG_BITS void do_mult (void); void do_multu (void); Loading @@ -89,10 +92,12 @@ void do_madd (void); void do_maddu (void); void do_msub (void); void do_msubu (void); #endif #ifdef TARGET_MIPS64 void do_ddiv (void); #if TARGET_LONG_BITS > HOST_LONG_BITS void do_ddivu (void); #endif #ifdef TARGET_MIPS64 void do_dmult (void); void do_dmultu (void); #endif Loading
target-mips/op.c +11 −12 Original line number Diff line number Diff line Loading @@ -368,14 +368,22 @@ void op_mul (void) RETURN(); } #if HOST_LONG_BITS < 64 void op_div (void) { CALL_FROM_TB0(do_div); RETURN(); } #else void op_div (void) { if (T1 != 0) { env->LO = (int32_t)((int32_t)T0 / (int32_t)T1); env->HI = (int32_t)((int32_t)T0 % (int32_t)T1); env->LO = (int32_t)((int64_t)(int32_t)T0 / (int32_t)T1); env->HI = (int32_t)((int64_t)(int32_t)T0 % (int32_t)T1); } RETURN(); } #endif void op_divu (void) { Loading Loading @@ -432,7 +440,6 @@ void op_dmul (void) RETURN(); } #if TARGET_LONG_BITS > HOST_LONG_BITS /* Those might call libgcc functions. */ void op_ddiv (void) { Loading @@ -440,21 +447,13 @@ void op_ddiv (void) RETURN(); } #if TARGET_LONG_BITS > HOST_LONG_BITS void op_ddivu (void) { do_ddivu(); RETURN(); } #else void op_ddiv (void) { if (T1 != 0) { env->LO = (int64_t)T0 / (int64_t)T1; env->HI = (int64_t)T0 % (int64_t)T1; } RETURN(); } void op_ddivu (void) { if (T1 != 0) { Loading
target-mips/op_helper.c +11 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,17 @@ void do_msubu (void) } #endif #if HOST_LONG_BITS < 64 void do_div (void) { /* 64bit datatypes because we may see overflow/underflow. */ if (T1 != 0) { env->LO = (int32_t)((int64_t)(int32_t)T0 / (int32_t)T1); env->HI = (int32_t)((int64_t)(int32_t)T0 % (int32_t)T1); } } #endif #ifdef TARGET_MIPS64 void do_dmult (void) { Loading