| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=cascadelake -O3" } */ |
| 3 |
/* { dg-final { scan-assembler-not "kunpck" } } */ |
| 4 |
/* { dg-final { scan-assembler-not "kand" } } */ |
| 5 |
/* { dg-final { scan-assembler-not "kor" } } */ |
| 6 |
/* { dg-final { scan-assembler-not "kshift" } } */ |
| 7 |
|
| 8 |
typedef unsigned char uint8_t; |
| 9 |
|
| 10 |
static uint8_t x264_clip_uint8 (int x, unsigned int y) |
| 11 |
{ |
| 12 |
return x & (~255) ? (-x) >> 31 : y; |
| 13 |
} |
| 14 |
|
| 15 |
void |
| 16 |
mc_weight (uint8_t* __restrict dst, uint8_t* __restrict src, |
| 17 |
int i_width,int i_scale, unsigned int* __restrict y) |
| 18 |
{ |
| 19 |
for(int x = 0; x < i_width; x++) |
| 20 |
dst[x] = x264_clip_uint8 (src[x] * i_scale, y[x]); |
| 21 |
} |