| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fdump-tree-phiopt1-details" } */ |
| 3 |
/* { dg-final { scan-tree-dump-times "changed to factor operation out from COND_EXPR." 1 "phiopt1" } } */ |
| 4 |
|
| 5 |
typedef unsigned char uint8_t; |
| 6 |
|
| 7 |
#if __SIZEOF_INT__ < 4 |
| 8 |
#define int __INT32_TYPE__ |
| 9 |
#endif |
| 10 |
|
| 11 |
static uint8_t x264_clip_uint8 (int x) |
| 12 |
{ |
| 13 |
return x & (~255) ? (-x) >> 31 : x; |
| 14 |
} |
| 15 |
|
| 16 |
void |
| 17 |
mc_weight (uint8_t* __restrict dst, uint8_t* __restrict src, |
| 18 |
int i_width,int i_scale) |
| 19 |
{ |
| 20 |
for(int x = 0; x < i_width; x++) |
| 21 |
dst[x] = x264_clip_uint8 (src[x] * i_scale); |
| 22 |
} |