• M
    MIPS: Avoid DIVU in `__div64_32' is result would be zero · c1d337d4
    Maciej W. Rozycki 提交于
    We already check the high part of the divident against zero to avoid the
    costly DIVU instruction in that case, needed to reduce the high part of
    the divident, so we may well check against the divisor instead and set
    the high part of the quotient to zero right away.  We need to treat the
    high part the divident in that case though as the remainder that would
    be calculated by the DIVU instruction we avoided.
    
    This has passed correctness verification with test_div64 and reduced the
    module's average execution time down to 1.0445s and 0.2619s from 1.0668s
    and 0.2629s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
    Signed-off-by: NMaciej W. Rozycki <macro@orcam.me.uk>
    Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
    c1d337d4
div64.h 2.3 KB