openmp: Add testcases for omp_max_vf
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr109011-2.c
blob4c7e6ad07a46a9e6f2f0cf15d6cdb48d5fafd46b
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 -mbmi -mlzcnt -mno-avx512vpopcntdq" { target { { { { i?86-*-* x86_64-*-* } && avx512cd } && lzcnt } && bmi } } } */
5 /* { dg-additional-options "-mdejagnu-cpu=power9" { target { powerpc_vsx && { ! has_arch_pwr9 } } } } */
6 /* { dg-additional-options "-march=z13 -mzarch" { target s390_vx } } */
8 void
9 foo (int *p, int *q)
11 #pragma omp simd
12 for (int i = 0; i < 2048; ++i)
13 p[i] = __builtin_ctz (q[i]);
16 void
17 bar (int *p, int *q)
19 #pragma omp simd
20 for (int i = 0; i < 2048; ++i)
21 p[i] = q[i] ? __builtin_ctz (q[i]) : __SIZEOF_INT__ * __CHAR_BIT__;
24 void
25 baz (int *p, int *q)
27 #pragma omp simd
28 for (int i = 0; i < 2048; ++i)
29 p[i] = __builtin_ffs (q[i]);
32 /* { dg-final { scan-tree-dump-times " = \.CLZ \\\(vect" 3 "optimized" { target { { { { i?86-*-* x86_64-*-* } && avx512cd } && lzcnt } && bmi } } } } */
33 /* { dg-final { scan-tree-dump-times " = \.CTZ \\\(vect" 3 "optimized" { target powerpc_vsx } } } */
34 /* { dg-final { scan-tree-dump-times " = \.CTZ \\\(vect" 2 "optimized" { target s390_vx } } } */
35 /* { dg-final { scan-tree-dump-times " = \.POPCOUNT \\\(vect" 1 "optimized" { target s390_vx } } } */