File: pr88497-6.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (65 lines) | stat: -rw-r--r-- 2,706 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* { dg-do compile } */
/* { dg-require-effective-target avx512f } */
/* { dg-options "-O2 -mavx512f -ffast-math -fdump-tree-reassoc1" } */

/* To test reassoc can undistribute vector bit_field_ref on multiple
   vector machine modes.

   v1, v2 of type vector 4 x float
   v3, v4 of type vector 8 x float
   v5, v6 of type vector 16 x float

   reassoc transforms

     accumulator  +=  v1[0]  + v1[1]  + v1[2]  + v1[3]  +
                      v2[0]  + v2[1]  + v2[2]  + v2[3]  +
                      v3[0]  + v3[1]  + v3[2]  + v3[3]  +
                      v3[4]  + v3[5]  + v3[6]  + v3[7]  +
                      v4[0]  + v4[1]  + v4[2]  + v4[3]  +
                      v4[4]  + v4[5]  + v4[6]  + v4[7]  +
                      v5[0]  + v5[1]  + v5[2]  + v5[3]  +
                      v5[4]  + v5[5]  + v5[6]  + v5[7]  +
                      v5[8]  + v5[9]  + v5[10] + v5[11] +
                      v5[12] + v5[13] + v5[14] + v5[15] +
                      v6[0]  + v6[1]  + v6[2]  + v6[3]  +
                      v6[4]  + v6[5]  + v6[6]  + v6[7]  +
                      v6[8]  + v6[9]  + v6[10] + v6[11] +
                      v6[12] + v6[13] + v6[14] + v6[15] ;

   into:

     T12 = v1 + v2;
     T34 = v3 + v4;
     T56 = v5 + v6;
     accumulator += T12[0]  + T12[1]  + T12[2]  + T12[3]  +
     accumulator += T34[0]  + T34[1]  + T34[2]  + T34[3]  +
     accumulator += T34[4]  + T34[5]  + T34[6]  + T34[7]  +
     accumulator += T56[0]  + T56[1]  + T56[2]  + T56[3]  +
     accumulator += T56[4]  + T56[5]  + T56[6]  + T56[7]  +
     accumulator += T56[8]  + T56[9]  + T56[10] + T56[11] +
     accumulator += T56[12] + T56[13] + T56[14] + T56[15] ;  */

typedef float v4sf __attribute__((vector_size(16)));
typedef float v8sf __attribute__((vector_size(32)));
typedef float v16sf __attribute__((vector_size(64)));

float
test (float accumulator, v4sf v1, v4sf v2, v8sf v3, v8sf v4, v16sf v5, v16sf v6)
{
  accumulator += v1[0] + v1[1] + v1[2] + v1[3];
  accumulator += v2[0] + v2[1] + v2[2] + v2[3];
  accumulator += v3[0] + v3[1] + v3[2] + v3[3];
  accumulator += v3[4] + v3[5] + v3[6] + v3[7];
  accumulator += v4[0] + v4[1] + v4[2] + v4[3];
  accumulator += v4[4] + v4[5] + v4[6] + v4[7];
  accumulator += v5[0] + v5[1] + v5[2] + v5[3];
  accumulator += v5[4] + v5[5] + v5[6] + v5[7];
  accumulator += v5[8] + v5[9] + v5[10] + v5[11];
  accumulator += v5[12] + v5[13] + v5[14] + v5[15];
  accumulator += v6[0] + v6[1] + v6[2] + v6[3];
  accumulator += v6[4] + v6[5] + v6[6] + v6[7];
  accumulator += v6[8] + v6[9] + v6[10] + v6[11];
  accumulator += v6[12] + v6[13] + v6[14] + v6[15];
  return accumulator;
}
/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 28 "reassoc1" } } */