1 /* { dg-require-effective-target vect_int } */
10 unsigned char X
[N
] __attribute__ ((__aligned__(16)));
11 unsigned char Y
[N
] __attribute__ ((__aligned__(16)));
13 /* char->short->short dot product.
14 Detected as a dot-product pattern.
15 Should be vectorized on targets that support dot-product for unsigned chars,
16 but currently this test cannot be vectorized as a dot-product on targets
17 that support char->short->int dot-product.
18 Alternatively, this test can be vectorized using vect_widen_mult_qi (or
19 vect_unpack and non-widening multplication: vect_unpack && vect_short_mult).
21 __attribute__ ((noinline
)) unsigned short
24 unsigned short result
= 0;
26 for (i
=0; i
<len
; i
++) {
27 result
+= (unsigned short)(X
[i
] * Y
[i
]);
51 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
53 /* When the vectorizer is enhanced to vectorize accumulation into short for
54 targets that support accumulation into int (powerpc, ia64) we'd have:
55 dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_udot_qi || vect_widen_mult_qi_to_hi } }
57 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target vect_widen_mult_qi_to_hi} } } */
59 /* { dg-final { cleanup-tree-dump "vect" } } */