File: pr88497-5.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 (37 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download
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
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
/* { dg-require-effective-target powerpc_altivec_ok { target { powerpc*-*-* } } } */
/* { dg-require-effective-target sse2 { target { i?86-*-* x86_64-*-* } } } */
/* { dg-additional-options "-O2 -ffast-math -fdump-tree-reassoc1" } */
/* { dg-additional-options "-maltivec" { target { powerpc*-*-* } } } */
/* { dg-additional-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */

/* To test reassoc can undistribute vector bit_field_ref on bitwise XOR.

   v1, v2, v3, v4 of type vector int.

   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] ^
                    v4[0] ^ v4[1] ^ v4[2] ^ v4[3] ;

   into:

     T = v1 ^ v2 ^ v3 ^ v4;
     accumulator ^= T[0] ^ T[1] ^ T[2] ^ T[3];

   Fewer bit_field_refs, only four for 128 or more bits vector.  */

typedef int v4si __attribute__ ((vector_size (16)));
int
test (int accumulator, v4si v1, v4si v2, v4si v3, v4si v4)
{
  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 ^= v4[0] ^ v4[1] ^ v4[2] ^ v4[3];
  return accumulator;
}
/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 4 "reassoc1" { target { powerpc*-*-* i?86-*-* x86_64-*-* } } } } */