Condition branch on least significant bit
Michael Meissner
gcc-mail@the-meissners.org
Wed Jun 25 21:46:00 GMT 2003
On Wed, Jun 25, 2003 at 02:01:48PM +0200, Jan Hoogerbrugge wrote:
> Hi Richard,
>
> >From: Richard Henderson <rth@redhat.com>
> >> Any idea how to deal with this problem?
> >
> >Michael's BImode suggestion is most correct for the common case:
> >emit BImode compare and then branch.
>
> I followed your and Michael's suggestion (thank you) and that seems to
> work.... almost. The problem is that I have a benchmark where gcc keeps on
> looping in reload1.c:
>
> enum machine_mode narrow_mode;
> for (narrow_mode = GET_CLASS_NARROWEST_MODE
> (MODE_INT);
> narrow_mode != GET_MODE (reg);
> narrow_mode = GET_MODE_WIDER_MODE (narrow_mode))
> {
> if (have_insn_for (STRICT_LOW_PART, narrow_mode)
> ...
> }
>
> This code loops over all integer modes starting with the smallest one which
> happens to be QImode. In the case that gcc loops forever, reg is BImode and
> therefore the loop never terminates. What is wrong?
>
> - Is it that have_insn_for (STRICT_LOW_PART, narrow_mode) is always false?
> If so, how to fix this?
> - Is it that the termination condition of the loop is not correct. I see
> many of these loops in gcc where mode != VOIDmode is the termination
> condition?
> - Should GET_CLASS_NARROWEST_MODE (MODE_INT) return BImode instead of
> SImode which it currently seems to do?
Do you have patterns for moving BI values? If BI values aren't in general
registers, you will probably need the reload in and reload out patterns as
well.
--
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org
More information about the Gcc
mailing list