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: [patch] genrecog.c: Simplify comparisons against smallconstants in insn-recog.c.


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


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