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, rs6000] (3/3) Fix mulv4si3 and mulv8hi3 patterns for little endian


Bill Schmidt <wschmidt@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...

Thanks,
Richard


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