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: question about register pairs


> Seeing the patched code in its entirety like this, I notice that we
> would use HARD_REGNO_NREGS for a regno that's not ok for the mode.
> That can be avoided if we put a break into the if.  And then the
> !bad term in the loop condition becomes redundant.  Although the
> HARD_REGNO_NREGS definition in tm.texi says that HARD_REGNO_NREGS
> must never return zero.  That wouldn't be technically violated with
> an assert, but I suppose the spirit of the text is that the macro
> should return always a non-positive value, so I suppose this use of
> HARD_REGNO_MODE_OK is not actually a problem.

Alternately, we could assume that if there's a gap in the register
class, that the next register that *is* in the register class is a
legitimate register pair?  I can't think of any reason why you'd do
otherwise, and certainly if it *isn't* the first of a pair, there's no
way to pass the test anyway.

Then we'd just increment by HARD_REGNO_NREGS *or* 1, depending on
whether the register is in the set or not, and break out of the test
for the first reg that's in the set but not valid for the mode, so no
need to increment after that case.


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