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]

[PATCH][mpost]: automatic multi-target compilation


This patch allows to vectorize loops for a different target than the main
compilation target, and automatically initiate DMA to copy the input arrays
to the vector target and DMA the results back.

I have tested this with a simple test file vloop.c, which is the
second attachment to this email.
I've configured the compiler on gcc11.fsffrance.org with the options:
--target=arc-elf32 --with-extra-target-list=mxp-elf --with-headers --with-newlib --with-mpfr=/opt/cfarm/mpfr-2.4.1
The purpose of the build was not to get a fully working toolchain yet, but just
a working cc1.


I've compiled the test file with:
./cc1 -O2 -ftree-vectorize vloop.c -fdump-tree-all -ftree-vectorizer-verbose=9 -msimd


I've attached the compiler output vloop.s as the third attachement to this
email.
The assembler output templates for the dma in / out and target call
are just assembler comments so far; I gather this part is irrelevant for the
review of the tree optimizer patches, or if you want to try to make this work
for other target tuple sets, and I don't want to delay the patch review
unnecessarily any further.

There is certainly still a lot of work to be done to make this truly useful
for common application code, but that goes beyond the scope of the
current milepost project, and I think such work is best done incrementally
on a branch.

Attachment: multi-target-diff-20090716-1224
Description: Text document

#define SIZE 256

typedef unsigned short align_a[SIZE] __attribute__ ((aligned (128)));

align_a a, b, c;

void
f ()
{
  int i;

  for (i = 0; i < SIZE; i++)
{
    a[i] = b[i] + c[i];
}
}

Attachment: vloop.s
Description: Text document


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