Debian Codegraph @

gcc/testsuite/gcc.dg/vect/pr109011-1.c

raw
1 /* PR tree-optimization/109011 */
2 /* { dg-do compile } */
3 /* { dg-additional-options "-O3 -fno-unroll-loops --param=vect-epilogues-nomask=0 -fdump-tree-optimized" } */
4 /* { dg-additional-options "-mavx512cd" { target { { i?86-*-* x86_64-*-* } && avx512cd } } } */
5 /* { dg-additional-options "-mavx512vpopcntdq" { target { { i?86-*-* x86_64-*-* } && avx512vpopcntdq } } } */
6 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { powerpc_vsx && { ! has_arch_pwr8 } } } } */
7 /* { dg-additional-options "-march=z13 -mzarch" { target s390_vx } } */
8
9 void
10 foo (long long *p, long long *q)
11 {
12 #pragma omp simd
13 for (int i = 0; i < 2048; ++i)
14 p[i] = __builtin_popcountll (q[i]);
15 }
16
17 /* { dg-final { scan-tree-dump-times " = \.POPCOUNT \\\(vect" 1 "optimized" { target { { i?86-*-* x86_64-*-* } && avx512vpopcntdq } } } } */
18 /* { dg-final { scan-tree-dump-times " = \.POPCOUNT \\\(vect" 1 "optimized" { target { powerpc_vsx || s390_vx } } } } */
19
20 void
21 bar (long long *p, long long *q)
22 {
23 #pragma omp simd
24 for (int i = 0; i < 2048; ++i)
25 p[i] = __builtin_clzll (q[i]);
26 }
27
28 /* { dg-final { scan-tree-dump-times " = \.CLZ \\\(vect" 1 "optimized" { target { { i?86-*-* x86_64-*-* } && avx512cd } } } } */
29 /* { dg-final { scan-tree-dump-times " = \.CLZ \\\(vect" 1 "optimized" { target { powerpc_vsx || s390_vx } } } } */