This is the mail archive of the
mailing list for the GCC project.
Re: question about register pairs
- From: DJ Delorie <dj at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at embecosm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 31 Oct 2013 18:11:19 -0400
- Subject: Re: question about register pairs
- Authentication-results: sourceware.org; auth=none
- References: <201310240659 dot r9O6x4jo006247 at greed dot delorie dot com> <CAMqJFCpoeVT6uWFusG6m9AfihEHcLTNwBWYRAi6R-eHmcaFCAw at mail dot gmail dot com> <201310250415 dot r9P4FEZt020568 at greed dot delorie dot com> <CAMqJFCqGiuQnE2Rv0b3WEOOzQYg9iEJcOyEq=0V_wqzaqCJ6jg at mail dot gmail dot com>
> 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.