Index: target-mips/op_helper.c =================================================================== RCS file: /sources/qemu/qemu/target-mips/op_helper.c,v retrieving revision 1.74 diff -u -r1.74 op_helper.c --- target-mips/op_helper.c 18 Nov 2007 14:33:24 -0000 1.74 +++ target-mips/op_helper.c 19 Dec 2007 17:31:23 -0000 @@ -230,9 +237,16 @@ void do_ddiv (void) { if (T1 != 0) { - lldiv_t res = lldiv((int64_t)T0, (int64_t)T1); - env->LO[0][env->current_tc] = res.quot; - env->HI[0][env->current_tc] = res.rem; + int64_t arg0 = (int64_t)T0; + int64_t arg1 = (int64_t)T1; + if (arg0 == ((int64_t)-1 << 63) && arg1 == (int64_t)-1) { + env->LO[0][env->current_tc] = arg0; + env->HI[0][env->current_tc] = 0; + } else { + lldiv_t res = lldiv(arg0, arg1); + env->LO[0][env->current_tc] = res.quot; + env->HI[0][env->current_tc] = res.rem; + } } }