Re: divmod, div, mod

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> My question is:
>> should I implement umodhi3 and udivhi3 and include them in libgcc so
>> __divsi3 is alright,
>> or should I implement divmodsi4 to override __divsi3 and __modsi3?
>
> It's a question of runtime efficiency.  If it is faster to compute just
> the quotient or the remainder, then implement __divsi3 and __modsi3 in
> libgcc.  If the processor gives you both the quotient and the remainder
> at the same time, then implement the udivmodsi4 insn in the MD file
> (e.g., avr.md).

Thank you.
Actually the processor give me nothing. It does not support div or mod
just like MSP430.
But when I take a look at msp430.md I find out that they implemented
divmodM4 with add and sub.
In your opinion, if a machine does not support mul/div/mod, should
these instructions always be
implemented in separate div and mod way?

Regards.

Florent

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux