LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-dot-s8a.c
blobac674749b6fe09f3c0adc991c825fb9eacc9eee5
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target arm_v8_2a_dotprod_neon_hw { target { aarch64*-*-* || arm*-*-* } } } */
3 /* { dg-additional-options "-march=armv8.2-a+dotprod" { target { aarch64*-*-* } } } */
4 /* { dg-add-options arm_v8_2a_dotprod_neon } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #define N 64
11 #define DOT1 43680
13 signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
14 signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
16 /* char->short->int dot product.
17 The dot-product pattern should be detected.
18 Vectorizable on vect_sdot_qi targets (targets that support dot-product of
19 signed chars).
21 In the future could also be vectorized as widening-mult + widening-summation,
22 or with type-conversion support.
24 __attribute__ ((noinline)) int
25 foo1(int len) {
26 int i;
27 int result = 0;
28 short prod;
30 for (i=0; i<len; i++) {
31 prod = X[i] * Y[i];
32 result += prod;
34 return result;
37 int main (void)
39 int i, dot1;
41 check_vect ();
43 for (i=0; i<N; i++) {
44 X[i] = i;
45 Y[i] = 64-i;
46 __asm__ volatile ("");
49 dot1 = foo1 (N);
50 if (dot1 != DOT1)
51 abort ();
53 return 0;
56 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
57 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */
58 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_qi } } } */
59 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi && vect_widen_sum_hi_to_si } } } } */