On Mon, 2013-11-04 at 15:48 +0000, Richard Sandiford wrote:
> Bill Schmidt <wschm...@linux.vnet.ibm.com> writes:
> > +   /* We need this to be vmulouh for both big and little endian,
> > +      but for little endian we would swap this, so avoid that.  */
> > +   if (BYTES_BIG_ENDIAN)
> > +     emit_insn (gen_vec_widen_umult_odd_v8hi (low_product, one, two));
> > +   else
> > +     emit_insn (gen_vec_widen_umult_even_v8hi (low_product, one, two));
> 
> FWIW, an alternative would be to turn vec_widen_smult_{even,odd}_* into
> define_expands and have define_insns for the underlying instructions.
> E.g. vec_widen_umult_even_v16qi could call gen_vmuleub or gen_vmuloub
> depending on endianness.
> 
> Then the unspec name would always match the instruction, and you could
> also use gen_vmulouh rather than gen_vec_widen_umult_*_v8hi above.
> 
> It probably works out as more code overall, but maybe it means jumping
> through fewer mental hoops...

Good idea.  I'll have a look and produce a new patch set shortly.

Thanks,
Bill

> 
> Thanks,
> Richard

Reply via email to