This is the mail archive of the gcc@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: (R5900) Implementing Vector Support


Hi again,




On Saturday, May 14, 2016 6:21 PM, Woon yung Liu <ysai187@yahoo.com> wrote:

> Hopefully, the addition of such a multiplication pattern that involves parallel multiplication operations > will not result in many more obscure problems. :/


I've somewhat implemented the patterns, although the description for the pcpyld and pcpyud instructions are wrong. GCC compiles fine though.

I haven't figured out how to test the vec_widen_smult patterns, although I've discovered that my implementation of vec_cmp was actually somewhat functional (wrong sign-type was previously used in tests).

Normal (non-widening) multiplication of V8HI vectors is working fine, with the PMULTH and PMFHL.LH instruction combo.


You mentioned earlier that the vec_widen_smult patterns are used for widening multiplication, and I've figured out that it's only possible to observe if the GCC autovectorizer functionality uses it.
Unfortunately, it doesn't seem like autovectorization is working. Compiling a simple function like this, does not result in vectorization:
  int v8wmultout[8] __attribute__((aligned(16)));
  short int v8wmult1[8] __attribute__((aligned(16))), v8wmult2[8] __attribute__((aligned(16)));

  void testv8wmult(void)
  {
    int i;

   	for(i = 0; i < 8; i++)
      v8wmultout[i] = v8wmult1[i] * v8wmult2[i];
  }

Compilation was done with these options:
  -ftree-vectorize
  -ftree-vectorizer-verbose=10
  -fopt-info-vec-missed
  -fdump-tree-vect-details

The dump file contains a few odd messages:
  testv.c:70:2: note: ==> examining statement: _5 = (int) _4;

  ...


  testv.c:70:2: note: conversion not supported by target.

  ...

  testv.c:70:2: note: not vectorized: relevant stmt not supported: _5 = (int) _4;
  testv.c:70:2: note: bad operation or unsupported loop bound.


_5 is an int and _4 is a short int. _4 is assigned like this: _4 = v8wmult1[i_13];


My port is still missing the instructions for initializing vectors, and inserting/setting and extracting values from vectors. They aren't implemented yet because I haven't figured out how to implement them; the documentation describes them as simple operations, but yet the implementations within mips.c do a lot more things!


But how can I tell what operations are required by autovectorization, that are currently not supported?

Thanks and regards,
-W Y


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