This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patches] Re: small emit_case_nodes tweek
> On Thu, Jun 14, 2001 at 01:16:48PM +0200, Jan Hubicka wrote:
> > expand_case needs to be redesigned (Bo and I are now investigating how),
>
> Please also consider a way to call back into expand_case from rtl
> generation. I'd like to give an array of label_refs and an index
> rtx. There are fixme's in the exception handling code that want
> to do this sort of thing. (For now they are doing sequential ifs.)
Sure.
The loop unrolling needs exactly the same beast, so I believe that
we should have something as emit_case at lower level, that will
receive RTX index and some plausible representaiton of nodes.
>
> > * stmt.c (emit_case_nodes): Optimize test whether index is in given
> > interval.
>
> Ok, but,
>
> > + rtx add_value = expand_expr (build1 (NEGATE_EXPR, index_type, node->low),
> > + NULL_RTX, VOIDmode, 0);
> > + rtx new_index;
> > +
> > + new_index = expand_binop (mode, add_optab, index,
> > + add_value,
> > + NULL_RTX, 0, OPTAB_WIDEN);
>
> Why a NEGATE_EXPR instead of using sub_optab?
Hmm, I was overoptimizing in my mind. Just tried to canonize the instruction.
I know, that expand_binop will do that for me.
I will change that before installing.
Thanks!
Honza
>
>
> r~