Re: [Vala] vector extensions for Vala



If we want to have vector extensions supported in vala, then a good way to do that might be to take advantage of the Cilk Plus extensions for C and C++ that are now supported by most compilers, including GCC upwards of version 4.8. One benefit of this would be that we wouldn't need to change the underlying implementation based on hardware capabilities, which is especially good, because as of 2011, both Intel and AMD started supporting 256-bit wide vector units instead of the 128-bit wide vector units used for SSE.

e.g. w/ standard loop:

int *a, *b, *c;

for(int i = 0; i < 16; i++)
    c[i] = a[i] + b[i];

e.g. w/ cilk:

//uses either SSE or AVX
c[0:20] = a[0:20] + b[0:20];

e.g. w/ something like gcc vector instructions

int *a, *b, *c;

//strictly uses SSE
v4si at, bt, ct;

for(int i = 0; i < 16; i += 4) {
    at = &a[0];
    bt = &c[0];
    ct = at + bt;
    c[0] = ct;
}

On 08/25/2015 03:24 PM, rastersoft wrote:
Hi:

Are plans to implement vector extensions (to take advantage of SSE
instructions) in Vala?

Just a thin layer over gcc vector extensions would be quite easy...

https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]