Revision 80c27194 target-mips/op.c

b/target-mips/op.c
368 368
    RETURN();
369 369
}
370 370

  
371
#if HOST_LONG_BITS < 64
372
void op_div (void)
373
{
374
    CALL_FROM_TB0(do_div);
375
    RETURN();
376
}
377
#else
371 378
void op_div (void)
372 379
{
373 380
    if (T1 != 0) {
374
        env->LO = (int32_t)((int32_t)T0 / (int32_t)T1);
375
        env->HI = (int32_t)((int32_t)T0 % (int32_t)T1);
381
        env->LO = (int32_t)((int64_t)(int32_t)T0 / (int32_t)T1);
382
        env->HI = (int32_t)((int64_t)(int32_t)T0 % (int32_t)T1);
376 383
    }
377 384
    RETURN();
378 385
}
386
#endif
379 387

  
380 388
void op_divu (void)
381 389
{
......
432 440
    RETURN();
433 441
}
434 442

  
435
#if TARGET_LONG_BITS > HOST_LONG_BITS
436 443
/* Those might call libgcc functions.  */
437 444
void op_ddiv (void)
438 445
{
......
440 447
    RETURN();
441 448
}
442 449

  
450
#if TARGET_LONG_BITS > HOST_LONG_BITS
443 451
void op_ddivu (void)
444 452
{
445 453
    do_ddivu();
446 454
    RETURN();
447 455
}
448 456
#else
449
void op_ddiv (void)
450
{
451
    if (T1 != 0) {
452
        env->LO = (int64_t)T0 / (int64_t)T1;
453
        env->HI = (int64_t)T0 % (int64_t)T1;
454
    }
455
    RETURN();
456
}
457

  
458 457
void op_ddivu (void)
459 458
{
460 459
    if (T1 != 0) {

Also available in: Unified diff