| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target arm_v8_2a_i8mm_ok } */ |
| 3 |
/* { dg-options "-O3" } */ |
| 4 |
/* { dg-add-options arm_v8_2a_i8mm } */ |
| 5 |
|
| 6 |
#define N 480 |
| 7 |
#define SIGNEDNESS_1 unsigned |
| 8 |
#define SIGNEDNESS_2 signed |
| 9 |
#define SIGNEDNESS_3 signed |
| 10 |
#define SIGNEDNESS_4 unsigned |
| 11 |
|
| 12 |
SIGNEDNESS_1 int __attribute__ ((noipa)) |
| 13 |
f (SIGNEDNESS_1 int res, SIGNEDNESS_3 char *restrict a, |
| 14 |
SIGNEDNESS_4 char *restrict b) |
| 15 |
{ |
| 16 |
for (__INTPTR_TYPE__ i = 0; i < N; ++i) |
| 17 |
{ |
| 18 |
int av = a[i]; |
| 19 |
int bv = b[i]; |
| 20 |
SIGNEDNESS_2 short mult = av * bv; |
| 21 |
res += mult; |
| 22 |
} |
| 23 |
return res; |
| 24 |
} |
| 25 |
|
| 26 |
SIGNEDNESS_1 int __attribute__ ((noipa)) |
| 27 |
g (SIGNEDNESS_1 int res, SIGNEDNESS_3 char *restrict b, |
| 28 |
SIGNEDNESS_4 char *restrict a) |
| 29 |
{ |
| 30 |
for (__INTPTR_TYPE__ i = 0; i < N; ++i) |
| 31 |
{ |
| 32 |
int av = a[i]; |
| 33 |
int bv = b[i]; |
| 34 |
SIGNEDNESS_2 short mult = av * bv; |
| 35 |
res += mult; |
| 36 |
} |
| 37 |
return res; |
| 38 |
} |
| 39 |
|
| 40 |
/* { dg-final { scan-assembler-times {vusdot.s8} 2 { target { arm-*-*-gnueabihf } } } } */ |