| 1 |
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ |
| 2 |
/* { dg-additional-options "-mavx2" } */ |
| 3 |
|
| 4 |
typedef float __v4sf __attribute__((vector_size (16))); |
| 5 |
typedef int __v4si __attribute__((vector_size (16))); |
| 6 |
typedef float __v8sf __attribute__((vector_size (32))); |
| 7 |
typedef int __v8si __attribute__((vector_size (32))); |
| 8 |
__v4si f1 (__v4sf, __v4sf, float *); |
| 9 |
__v8si f2 (__v8sf, __v8sf, float *); |
| 10 |
__v4si f3 (__v4si, int, __v4si); |
| 11 |
|
| 12 |
#pragma omp declare variant (f1) match (construct={parallel,for,simd(simdlen(4),notinbranch,uniform(z),aligned(z:4 * sizeof (*z)))}) |
| 13 |
int f4 (float x, float y, float *z); |
| 14 |
#pragma omp declare variant (f1) match (construct={parallel,for,simd(uniform(w),simdlen(8*2-12),aligned(w:4*sizeof (float)),notinbranch)}) |
| 15 |
int f5 (float u, float v, float *w); |
| 16 |
#pragma omp declare variant (f1) match (construct={parallel,for,simd(linear(w),notinbranch,simdlen(4),aligned(w:4*sizeof (float)))}) /* { dg-error "'f1' used as a variant with incompatible 'construct' selector sets" "" { target c } } */ |
| 17 |
int f6 (float u, float v, float *w); |
| 18 |
#pragma omp declare variant (f1) match (construct={parallel,for,simd(uniform(w),notinbranch,simdlen(4),aligned(w:2*sizeof (float)))}) /* { dg-error "'f1' used as a variant with incompatible 'construct' selector sets" "" { target c } } */ |
| 19 |
int f7 (float u, float v, float *w); |
| 20 |
#pragma omp declare variant (f1) match (construct={parallel,for,simd(uniform(w),notinbranch,simdlen(4),aligned(w))}) /* { dg-error "'f1' used as a variant with incompatible 'construct' selector sets" "" { target c } } */ |
| 21 |
int f8 (float u, float v, float *w); |
| 22 |
#pragma omp declare variant (f2) match (construct={for,simd(uniform(z),simdlen(8),notinbranch)}) |
| 23 |
int f9 (float x, float y, float *z); |
| 24 |
#pragma omp declare variant (f2) match (construct={for,simd(notinbranch,simdlen(2+2+4),uniform (q))}) |
| 25 |
int f10 (float x, float y, float *q); |
| 26 |
#pragma omp declare variant (f2) match (construct={for,simd(linear(z:2),simdlen(8),notinbranch)}) /* { dg-error "'f2' used as a variant with incompatible 'construct' selector sets" "" { target c } } */ |
| 27 |
int f11 (float x, float y, float *z); |
| 28 |
#pragma omp declare variant (f3) match (construct={simd(simdlen(4),inbranch,linear(y:1))}) |
| 29 |
int f12 (int x, int y); |
| 30 |
#pragma omp declare variant (f3) match (construct={simd(inbranch, simdlen (5-1), linear (q:4-3))}) |
| 31 |
int f13 (int x, int q); |
| 32 |
#pragma omp declare variant (f3) match (construct={simd(inbranch,simdlen(4),linear(q:2))}) /* { dg-error "'f3' used as a variant with incompatible 'construct' selector sets" "" { target c } } */ |
| 33 |
int f14 (int x, int q); |
| 34 |
#pragma omp declare variant (f3) match (construct={simd(inbranch simdlen (4) linear (q:1))}) /* { dg-error "clauses in 'simd' trait should be separated by ','" } */ |
| 35 |
int f15 (int x, int q); |
| 36 |
#pragma omp declare variant (f3) match (construct={simd(inbranch, simdlen (5-1) linear (q:4-3))}) /* { dg-error "clauses in 'simd' trait should be separated by ','" } */ |
| 37 |
int f16 (int x, int q); |