Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/slp-perm-1.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
11 #define M21 27271 | 11 #define M21 27271 |
12 #define M02 74 | 12 #define M02 74 |
13 #define M12 191 | 13 #define M12 191 |
14 #define M22 500 | 14 #define M22 500 |
15 | 15 |
16 #if VECTOR_BITS > 128 | |
17 #define N (VECTOR_BITS * 3 / 32 + 4) | |
18 #else | |
16 #define N 16 | 19 #define N 16 |
20 #endif | |
17 | 21 |
18 void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) | 22 void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) |
19 { | 23 { |
20 unsigned int i, a, b, c; | 24 unsigned int i, a, b, c; |
21 | 25 |
32 } | 36 } |
33 | 37 |
34 int main (int argc, const char* argv[]) | 38 int main (int argc, const char* argv[]) |
35 { | 39 { |
36 unsigned int input[N], output[N], i; | 40 unsigned int input[N], output[N], i; |
37 unsigned int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; | |
38 | 41 |
39 check_vect (); | 42 check_vect (); |
40 | 43 |
41 for (i = 0; i < N; i++) | 44 for (i = 0; i < N; i++) |
42 { | 45 { |
43 input[i] = i%256; | 46 input[i] = i%256; |
44 output[i] = 0; | 47 output[i] = 0; |
45 __asm__ volatile (""); | 48 __asm__ volatile (""); |
46 } | 49 } |
50 | |
51 #if N == 16 | |
52 unsigned int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; | |
53 #else | |
54 volatile unsigned int check_results[N] = {}; | |
55 | |
56 for (unsigned int i = 0; i < N / 3; i++) | |
57 { | |
58 unsigned int a = input[i * 3]; | |
59 unsigned int b = input[i * 3 + 1]; | |
60 unsigned int c = input[i * 3 + 2]; | |
61 | |
62 check_results[i * 3] = M00 * a + M01 * b + M02 * c; | |
63 check_results[i * 3 + 1] = M10 * a + M11 * b + M12 * c; | |
64 check_results[i * 3 + 2] = M20 * a + M21 * b + M22 * c; | |
65 | |
66 asm volatile ("" ::: "memory"); | |
67 } | |
68 #endif | |
47 | 69 |
48 foo (input, output); | 70 foo (input, output); |
49 | 71 |
50 for (i = 0; i < N; i++) | 72 for (i = 0; i < N; i++) |
51 { | 73 { |
56 | 78 |
57 return 0; | 79 return 0; |
58 } | 80 } |
59 | 81 |
60 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ | 82 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ |
61 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */ | 83 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm3_int && {! vect_load_lanes } } } } } */ |
62 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ | 84 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ |
63 /* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */ | 85 /* { dg-final { scan-tree-dump "Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm3_int && vect_load_lanes } } } } */ |
64 /* { dg-final { scan-tree-dump "LOAD_LANES" "vect" { target vect_load_lanes } } } */ | 86 /* { dg-final { scan-tree-dump "LOAD_LANES" "vect" { target vect_load_lanes } } } */ |
65 /* { dg-final { scan-tree-dump "STORE_LANES" "vect" { target vect_load_lanes } } } */ | 87 /* { dg-final { scan-tree-dump "STORE_LANES" "vect" { target vect_load_lanes } } } */ |
66 | 88 |