This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (R5900) Implementing Vector Support
- From: Woon yung Liu <ysai187 at yahoo dot com>
- To: Richard Henderson <rth at redhat dot com>, Gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Sun, 15 May 2016 10:43:56 +0000 (UTC)
- Subject: Re: (R5900) Implementing Vector Support
- Authentication-results: sourceware.org; auth=none
- References: <23a57920-3e9e-05f9-e428-a7e5e89d4de9 at redhat dot com> <133091800 dot 362759 dot 1462978450117 dot JavaMail dot yahoo at mail dot yahoo dot com> <93d40024-8baf-f571-765e-3f3ae59961df at redhat dot com> <687383190 dot 1940916 dot 1463221310394 dot JavaMail dot yahoo at mail dot yahoo dot com>
- Reply-to: Woon yung Liu <ysai187 at yahoo dot com>
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