This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcc intrinsics for am33 parallel integer arithmetic
On Aug 28, 2000, Richard Henderson <rth@cygnus.com> wrote:
> On Mon, Aug 28, 2000 at 05:07:17PM -0700, Matthew Hiller wrote:
>> + static rtx
>> + am33_expand_dsp_builtin (icode, arglist)
>> + enum insn_code icode;
>> + tree arglist;
>> + {
>> + rtx pat;
>> + tree arg0 = TREE_VALUE (arglist);
>> + tree arg1 = TREE_VALUE (TREE_CHAIN (arglist));
>> + tree arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
>> + tree arg3 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist))));
>> + rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
> I don't think this is right. Consider
> __ADD_ADD(0, 1, 2, 3);
> Which is obviously nonsense, but expand_expr is going to give
> you that 0 as a constant instead of the error you deserve.
Nope, the predicates for output operands require
nonimmediate_operands, so you'd get an error message like:
if (! (*insn_data[icode].operand[1].predicate) (op1, mode1))
error ("operand 1 of dsp intrinsic of unsuitable type");
But the predicates don't force the operands to be lvalues, indeed. If
they happen to be pseudos with the results of other calculations,
they're going to be accepted, while they shouldn't.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me