Greg McGary <g...@mcgary.org> writes:

> I have a port without div or mod machine instructions.  I wrote
> divmodsi4 patterns that do the libcall directly, hoping that GCC would
> recognize the opportunity to use a single divmodsi4 to compute both
> quotient and remainder.  Alas, GCC calls divmodsi4 twice with the same
> divisor and dividend operands.  Is this supposed to work?  Is there a
> special trick to help the optimizer recognize the redundant insn?  I
> saw the 4yr-old thread regarding picochip's desire for the same effect
> and followed the same approach implemented in the current picochip.md
> (as well as my own approach) but no luck.

Using a divmodsi4 insn instead of divsi3/modsi3 insns ought to work.
You may need to give more information, such as the test case you are
using, and what your divmodsi4 insn looks like.

Ian

Reply via email to