This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: divmodhi4
- To: jeff hammond <hammondjs at yahoo dot com>
- Subject: Re: divmodhi4
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 18 May 2000 23:28:14 +0100 (BST)
- CC: gcc at gcc dot gnu dot org
> I am creating a .md file for a processor we are
> developing and ran into a problem with divmodhi4.
>
> The instruction that our processor uses for a
> divmodhi4 always put the remainder in the
> register just after the quotient. If the
> quotient goes in register N, the remainder always
> goes in register N+1. I have no idea how to
> express this in rtx. Can anyone suggest a good
> example or point to where this is documented?
You could express this arithmetically with signe/zero-extension, shifts
and ors, but that would be hard to swallow by the optimizers.
It's probably better to make single-register classes for all the
N and N+1 candidates, and then represent the valid register combinations
as alternatives.