Revision 60445285 target-mips/op.c

b/target-mips/op.c
1481 1481

  
1482 1482
void op_mtc0_index (void)
1483 1483
{
1484
    env->CP0_Index = (env->CP0_Index & 0x80000000) | (T0 % env->tlb->nb_tlb);
1484
    int num = 1;
1485
    unsigned int tmp = env->tlb->nb_tlb;
1486

  
1487
    do {
1488
        tmp >>= 1;
1489
        num <<= 1;
1490
    } while (tmp);
1491
    env->CP0_Index = (env->CP0_Index & 0x80000000) | (T0 & (num - 1));
1485 1492
    RETURN();
1486 1493
}
1487 1494

  

Also available in: Unified diff