| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -ffast-math -march=rv64gcv_zvl256b -mabi=lp64d -mtune=generic-ooo -mrvv-vector-bits=zvl" } */ |
| 3 |
/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-O2" "-Og" "-Os" "-Oz" } } */ |
| 4 |
|
| 5 |
/* A core routine of x264 which should not spill for OoO VLS build. */ |
| 6 |
|
| 7 |
inline int abs(int i) |
| 8 |
{ |
| 9 |
return (i < 0 ? -i : i); |
| 10 |
} |
| 11 |
|
| 12 |
int x264_sad_16x16(unsigned char *p1, int st1, unsigned char *p2, int st2) |
| 13 |
{ |
| 14 |
int sum = 0; |
| 15 |
|
| 16 |
for(int y = 0; y < 16; y++) |
| 17 |
{ |
| 18 |
for(int x = 0; x < 16; x++) |
| 19 |
sum += abs (p1[x] - p2[x]); |
| 20 |
p1 += st1; p2 += st2; |
| 21 |
} |
| 22 |
|
| 23 |
return sum; |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-assembler-not {addi\t[a-x0-9]+,sp} } } */ |
| 27 |
/* { dg-final { scan-assembler-not {addi\tsp,sp} } } */ |