aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/p9-vec-length-4.h
blob: 0ee7fc84502cae5e6723e479a312446bf164969b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "p9-vec-length.h"

/* Test the case that the loop which has multiple vectors (concatenated vectors)
   but with same vector type.  */

#define test(TYPE)                                                             \
  void __attribute__ ((noinline, noclone))                                     \
    test_mv_##TYPE (TYPE *restrict a, TYPE *restrict b, TYPE *restrict c,      \
		    int n)                                                     \
  {                                                                            \
    for (int i = 0; i < n; ++i)                                                \
      {                                                                        \
	a[i] += 1;                                                             \
	b[i * 2] += 2;                                                         \
	b[i * 2 + 1] += 3;                                                     \
	c[i * 4] += 4;                                                         \
	c[i * 4 + 1] += 5;                                                     \
	c[i * 4 + 2] += 6;                                                     \
	c[i * 4 + 3] += 7;                                                     \
      }                                                                        \
  }

TEST_ALL (test)