[patch] genrecog.c: Simplify comparisons against small constants in insn-recog.c.

Kazu Hirata kazu@cs.umass.edu
Thu Jan 29 08:26:00 GMT 2004


Hi Zack,

> > Attached is a patch to simplify comparisons against small constants in
> > insn-recog.c by replacing
> >
> >   if (GET_CODE (x3) == CONST_INT
> >       && XWINT (x3, 0) == 10L
> >       && ...
> >
> > with
> >
> >   if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (10)]
> 
> Uhh... that doesn't look equivalent to me.

Why?  Is there a corner case or something?  gen_rtx_CONST_INT starts
out with...

rtx
gen_rtx_CONST_INT (enum machine_mode mode ATTRIBUTE_UNUSED, HOST_WIDE_INT arg)
{
  void **slot;

  if (arg >= - MAX_SAVED_CONST_INT && arg <= MAX_SAVED_CONST_INT)
    return const_int_rtx[arg + MAX_SAVED_CONST_INT];

Kazu Hirata



More information about the Gcc-patches mailing list