[PATCH]: Infrastructure to expand interclass optabs

Richard Guenther richard.guenther@gmail.com
Tue Jan 30 10:40:00 GMT 2007


On 1/30/07, Uros Bizjak <ubizjak@gmail.com> wrote:
> On 1/29/07, Richard Guenther <rguenther@suse.de> wrote:
>
> > +      /* Output to SImode register.  */
> > +      target = gen_reg_rtx (SImode);
> >
> > Are we sure SImode maps to int always?  Maybe better use TYPE_MODE
> > (TREE_TYPE (exp)) here?
>
> I have changed this as you suggested, adding a gcc_assert() if the
> register in specified mode is not accepted by insn predicate.
>
> > +      /* Compute into TARGET.
> > +        Set TARGET to wherever the result comes back.  */
> > +      if (mode != GET_MODE (op0))
> > +       op0 = convert_to_mode (mode, op0, 0);
> > +
> > +      emit_unop_insn (icode, target, op0, UNKNOWN);
> >
> > If target was passed as non-null and has the correct mode you should
> > use it instead of the target created above.
>
> The comment before emit_unop_insn() says that the output is _always_
> stored in non-null target.

Ah, I wasn't clear - I meant the target argument to
expand_builtin_interclass_mathfn ()
which you don't use.

+      /* Make a suitable register to place result in.  */
+      target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));

can you change this to

        if (!target
            || GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
          target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));

also

+
+ /* Before working hard, check whether the instruction is available.  */
+  if (icode != CODE_FOR_nothing)

a space missing before /*

Ok with these changes,

Thanks!
Richard.



More information about the Gcc-patches mailing list