| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-ifunc "" } */ |
| 3 |
/* { dg-options "-mavx" } */ |
| 4 |
/* { dg-skip-if "requires hosted libstdc++ for cstdlib malloc" { ! hostedlib } } */ |
| 5 |
|
| 6 |
#include <immintrin.h> |
| 7 |
|
| 8 |
__m256 x, y, z; |
| 9 |
|
| 10 |
__attribute__((target("avx"))) |
| 11 |
int bar() |
| 12 |
{ |
| 13 |
x = _mm256_add_ps (y, z); |
| 14 |
return 1; |
| 15 |
} |
| 16 |
|
| 17 |
__attribute__((target("default"))) |
| 18 |
int bar() |
| 19 |
{ |
| 20 |
return 2; |
| 21 |
} |
| 22 |
|
| 23 |
int |
| 24 |
foobar() |
| 25 |
{ |
| 26 |
if (__builtin_cpu_supports ("avx")) |
| 27 |
return bar(); |
| 28 |
else |
| 29 |
return 0; |
| 30 |
} |
| 31 |
|
| 32 |
__attribute__((target_clones("default","sse3"))) |
| 33 |
int foo() |
| 34 |
{ |
| 35 |
return foobar(); |
| 36 |
} |