From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/vmx/newton-1.c | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/vmx/newton-1.c (limited to 'gcc/testsuite/gcc.dg/vmx/newton-1.c') diff --git a/gcc/testsuite/gcc.dg/vmx/newton-1.c b/gcc/testsuite/gcc.dg/vmx/newton-1.c new file mode 100644 index 000000000..c5963c034 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vmx/newton-1.c @@ -0,0 +1,67 @@ +/* { dg-do compile } */ +#include + +#define SPLAT76 ((vector unsigned char)\ + {0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3}) +#define SPLAT54 ((vector unsigned char)\ + {4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7}) +#define SPLAT32 ((vector unsigned char)\ + {8,9,10,11,8,9,10,11,8,9,10,11,8,9,10,11}) +#define SPLAT10 ((vector unsigned char)\ + {12,13,14,15,12,13,14,15,12,13,14,15,12,13,14,15}) +#define INTERLEAVE ((vector unsigned char)\ + {0,1,16,17,4,5,20,21,8,9,24,25,12,13,28,29}) + +long real_32_manytaps (long ntaps, vector signed short *c, long ndat, + vector signed short *x, vector signed short *y) +{ + long i, j, op, ndatavec, ncoefvec; + vector signed short x0, x1; + vector signed short coef; + vector signed short cr10, cr32, cr54, cr76; + vector signed int y_even, y_odd; + vector signed short *x1p; + + op = 0; + ndatavec = ndat >> 3; + ncoefvec = ntaps >> 3; + + for (i = 0; i < ndatavec; i += 1) { + x0 = x[i]; + + y_even = ((vector signed int){0x8000,0x8000,0x8000,0x8000}); + y_odd = ((vector signed int){0x8000,0x8000,0x8000,0x8000}); + + j = 0; + x1p = x + 1 + i; + + do { + + coef = c[j]; + x1 = x1p[j]; + + cr10 = vec_perm(coef, coef, SPLAT10); + y_odd = vec_msums(cr10, x1, y_odd); + y_even = vec_msums(cr10, vec_sld(x0, x1, 14), y_even); + + cr32 = vec_perm(coef, coef, SPLAT32); + y_odd = vec_msums(cr32, vec_sld(x0, x1, 12), y_odd); + y_even = vec_msums(cr32, vec_sld(x0, x1, 10), y_even); + + cr54 = vec_perm(coef, coef, SPLAT54); + y_odd = vec_msums(cr54, vec_sld(x0, x1, 8), y_odd); + y_even = vec_msums(cr54, vec_sld(x0, x1, 6), y_even); + + cr76 = vec_perm(coef, coef, SPLAT76); + y_odd = vec_msums(cr76, vec_sld(x0, x1, 4), y_odd); + y_even = vec_msums(cr76, vec_sld(x0, x1, 2), y_even); + + x0 = x1; + + } while (++j < ncoefvec); + y[op++] = (vector signed short) vec_perm(y_even, y_odd, INTERLEAVE); + + } + + return op*8; +} -- cgit v1.2.3