This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: reload infrastructure to fix PR target/21623


Joern RENNECKE wrote:
I suppose the best solution for that problem is to make the class describe exclusively a
temp register. If no separate temp register is required, reload_class can be returned
(alternatively, we could say NO_REGS should be returned, and make
push_secondary_reload test the icode as well as the class when deciding if there is any
reload at all.)

That would be fine. So, IIUC the interface would be something like


/* Returns true if a secondary reload is needed for ...input args....
   After return from this function, *PICODE and *PCLASS describe how to
   do the secondary reload.
   If *PICODE is CODE_FOR_nothing, only a simple move instruction with a
   scratch register from *PCLASS is necessary, otherwise we use the
   instruction pattern selected by *PICODE.  CLASS can be NO_REGS in
   that case, or it can describe another scratch register if we need
   a tertiary reload.  In any case, the instruction pattern will be
   examined to determine the necessary class for the secondary reload
   and potential scratch registers needed.  */

bool (*secondary_foo_reload_needed_p)(...input args...,
	enum insn_code *picode, enum reg_class *pclass);

and if an insn code is used, we pick the class of the secondary reload and all scratch registers used by that pattern by looking at the operand constraints?

Or lose the bool return; I suppose it's redundant with
  icode != CODE_FOR_nothing || class != NO_REGS

Either way would be fine. If this works for you, go ahead - or do you see a need to extend this, now or in the future? I'd just like to see proper typing, no relying on the internal structure of enums, and no effect on other parts of the compiler such as gencodes.


Bernd



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]