| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=icelake-server -Ofast -fdump-tree-optimized" } */ |
| 3 |
/* { dg-final { scan-tree-dump-not "\.COND_SHR" "optimized" } } */ |
| 4 |
/* { dg-final { scan-tree-dump-not "\.COND_FMA" "optimized" } } */ |
| 5 |
|
| 6 |
void |
| 7 |
cond_shr (unsigned int* __restrict dst, |
| 8 |
unsigned int* __restrict src, |
| 9 |
unsigned int* __restrict y, |
| 10 |
int i_width) |
| 11 |
{ |
| 12 |
for(int x = 0; x < i_width; x++) |
| 13 |
{ |
| 14 |
unsigned int temp = src[x] >> 3; |
| 15 |
dst[x] = temp > 255 ? temp : y[x]; |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
void |
| 21 |
cond_fma (float* __restrict dst, |
| 22 |
float* __restrict src1, |
| 23 |
float* __restrict src2, |
| 24 |
float* __restrict src3, |
| 25 |
unsigned int* __restrict y, |
| 26 |
int i_width) |
| 27 |
{ |
| 28 |
for(int x = 0; x < i_width; x++) |
| 29 |
{ |
| 30 |
float temp = __builtin_fmaf (src1[x], src2[x], src3[x]); |
| 31 |
dst[x] = temp > 0.0f ? temp : y[x]; |
| 32 |
} |
| 33 |
} |