Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.target / sparc / pdist-3.c
blobe4d6cb53ed078d7ff33b6ef4cb756fc3d18078ea
1 /* { dg-do run } */
2 /* { dg-options "-mcpu=ultrasparc -mvis -O1" } */
4 typedef long long int64_t;
5 typedef unsigned char vec8 __attribute__((vector_size(8)));
7 extern void abort ();
8 extern void exit (int);
10 #define _(A) (unsigned char)A
12 int64_t foo (vec8 a, vec8 b) {
13 int64_t d = 2;
14 d = __builtin_vis_pdist (a, b, d);
15 return d;
18 int64_t bar () {
19 int64_t d = 2;
20 vec8 a = { _(1), _(2), _(3), _(4), _(5), _(6), _(7), _(255) };
21 vec8 b = { _(2), _(4), _(8), _(16), _(32), _(64), _(128), _(8) };
22 d = __builtin_vis_pdist (a, b, d);
23 return d;
27 static vec8 a = { 1, 2, 3, 4, 5, 6, 7, 255 };
28 static vec8 b = { 2, 4, 8, 16, 32, 64, 128, 8 };
30 int main (int argc, char *argv[]) {
32 if (foo (a, b) != bar ())
33 abort ();
35 exit (0);