RISC-V: Move helper functions above expand_const_vector
[official-gcc.git] / gcc / testsuite / gcc.target / arm / simd / vusdot-autovec.c
blobe7af895b423059f9bdb85674bb5f0dccf923a7ab
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 } */
6 #define N 480
7 #define SIGNEDNESS_1 unsigned
8 #define SIGNEDNESS_2 signed
9 #define SIGNEDNESS_3 signed
10 #define SIGNEDNESS_4 unsigned
12 SIGNEDNESS_1 int __attribute__ ((noipa))
13 f (SIGNEDNESS_1 int res, SIGNEDNESS_3 char *restrict a,
14 SIGNEDNESS_4 char *restrict b)
16 for (__INTPTR_TYPE__ i = 0; i < N; ++i)
18 int av = a[i];
19 int bv = b[i];
20 SIGNEDNESS_2 short mult = av * bv;
21 res += mult;
23 return res;
26 SIGNEDNESS_1 int __attribute__ ((noipa))
27 g (SIGNEDNESS_1 int res, SIGNEDNESS_3 char *restrict b,
28 SIGNEDNESS_4 char *restrict a)
30 for (__INTPTR_TYPE__ i = 0; i < N; ++i)
32 int av = a[i];
33 int bv = b[i];
34 SIGNEDNESS_2 short mult = av * bv;
35 res += mult;
37 return res;
40 /* { dg-final { scan-assembler-times {vusdot.s8} 2 { target { arm-*-*-gnueabihf } } } } */