-/* Addresses computation */
-void op_addr_add (void)
-{
-/* For compatibility with 32-bit code, data reference in user mode
- with Status_UX = 0 should be casted to 32-bit and sign extended.
- See the MIPS64 PRA manual, section 4.10. */
-#if defined(TARGET_MIPS64)
- if (((env->hflags & MIPS_HFLAG_KSU) == MIPS_HFLAG_UM) &&
- !(env->CP0_Status & (1 << CP0St_UX)))
- T0 = (int64_t)(int32_t)(T0 + T1);
- else
-#endif
- T0 += T1;
- FORCE_RET();
-}
-
-/* Arithmetic */
-void op_add (void)
-{
- T0 = (int32_t)((int32_t)T0 + (int32_t)T1);
- FORCE_RET();
-}
-
-void op_addo (void)
-{
- target_ulong tmp;
-
- tmp = (int32_t)T0;
- T0 = (int32_t)T0 + (int32_t)T1;
- if (((tmp ^ T1 ^ (-1)) & (T0 ^ T1)) >> 31) {
- /* operands of same sign, result different sign */
- CALL_FROM_TB1(do_raise_exception, EXCP_OVERFLOW);
- }
- T0 = (int32_t)T0;
- FORCE_RET();
-}
-
-void op_sub (void)
-{
- T0 = (int32_t)((int32_t)T0 - (int32_t)T1);
- FORCE_RET();
-}
-
-void op_subo (void)
-{
- target_ulong tmp;
-
- tmp = (int32_t)T0;
- T0 = (int32_t)T0 - (int32_t)T1;
- if (((tmp ^ T1) & (tmp ^ T0)) >> 31) {
- /* operands of different sign, first operand and result different sign */
- CALL_FROM_TB1(do_raise_exception, EXCP_OVERFLOW);
- }
- T0 = (int32_t)T0;
- FORCE_RET();
-}
-
-void op_mul (void)
-{
- T0 = (int32_t)((int32_t)T0 * (int32_t)T1);
- FORCE_RET();
-}
-
-#if HOST_LONG_BITS < 64
-void op_div (void)
-{
- CALL_FROM_TB0(do_div);
- FORCE_RET();
-}
-#else
-void op_div (void)
-{
- if (T1 != 0) {
- env->LO[env->current_tc][0] = (int32_t)((int64_t)(int32_t)T0 / (int32_t)T1);
- env->HI[env->current_tc][0] = (int32_t)((int64_t)(int32_t)T0 % (int32_t)T1);
- }
- FORCE_RET();
-}
-#endif
-
-void op_divu (void)
-{
- if (T1 != 0) {
- env->LO[env->current_tc][0] = (int32_t)((uint32_t)T0 / (uint32_t)T1);
- env->HI[env->current_tc][0] = (int32_t)((uint32_t)T0 % (uint32_t)T1);
- }
- FORCE_RET();
-}
-
-#if defined(TARGET_MIPS64)
-/* Arithmetic */
-void op_dadd (void)
-{
- T0 += T1;
- FORCE_RET();
-}
-
-void op_daddo (void)
-{
- target_long tmp;
-
- tmp = T0;
- T0 += T1;
- if (((tmp ^ T1 ^ (-1)) & (T0 ^ T1)) >> 63) {
- /* operands of same sign, result different sign */
- CALL_FROM_TB1(do_raise_exception, EXCP_OVERFLOW);
- }
- FORCE_RET();
-}
-
-void op_dsub (void)
-{
- T0 -= T1;
- FORCE_RET();
-}
-
-void op_dsubo (void)
-{
- target_long tmp;
-
- tmp = T0;
- T0 = (int64_t)T0 - (int64_t)T1;
- if (((tmp ^ T1) & (tmp ^ T0)) >> 63) {
- /* operands of different sign, first operand and result different sign */
- CALL_FROM_TB1(do_raise_exception, EXCP_OVERFLOW);
- }
- FORCE_RET();
-}
-
-void op_dmul (void)
-{
- T0 = (int64_t)T0 * (int64_t)T1;
- FORCE_RET();
-}
-
-/* Those might call libgcc functions. */
-void op_ddiv (void)
-{
- do_ddiv();
- FORCE_RET();
-}
-
-#if TARGET_LONG_BITS > HOST_LONG_BITS
-void op_ddivu (void)
-{
- do_ddivu();
- FORCE_RET();
-}
-#else
-void op_ddivu (void)
-{
- if (T1 != 0) {
- env->LO[env->current_tc][0] = T0 / T1;
- env->HI[env->current_tc][0] = T0 % T1;
- }
- FORCE_RET();
-}
-#endif
-#endif /* TARGET_MIPS64 */
-