On 03/18/10 08:30, Frank Isamov wrote:

 From the h file:

#define REG_CLASS_CONTENTS                                              \
  {
             \
    {0x00000000, 0x00000000, 0x00000000}, /* NO_REGS*/          \
    {0xFFFFFFFF, 0x0000FFFF, 0x00000000}, /* D_REGS*/          \
    {0x00000000, 0xFFFF0000, 0x0000FFFF}, /* R_REGS*/           \

ABI requires use of R registers for arguments and return value. Other
than that all of these instructions are more or less symmetrical in
sense of using D or R. So, an optimal choice would be use of R for
this example. And if D register is chosen, it involves additional copy
from R to D and back to R.
Define a union class which includes all the registers in D_REGS and R_REGS, then define IRA_COVER_CLASSES to that union class. When register classes are mostly symmetrical, except for stuff like argument passing, return values and the like, you usually get better code by defining IRA_COVER_CLASSES with a single union class rather than the component subclasses.

In fact, if the only reason D & R are separate is calling conventions, then I'd just drop them those classes completely and define GENERAL_REGISTERS. You would typically only define separate register classes if there are instructions which have to operate on specific subsets of the register file.


Jeff

Reply via email to