1 /* { dg-require-effective-target vect_int } */
12 unsigned char X
[N
] __attribute__ ((__aligned__(16)));
13 unsigned char Y
[N
] __attribute__ ((__aligned__(16)));
15 /* char->short->int dot product.
16 Detected as a dot-product pattern.
17 Should be vectorized on targets that support dot-product for unsigned chars.
22 unsigned int result
= 0;
25 for (i
=0; i
<len
; i
++) {
32 /* char->short->short dot product.
33 Detected as a dot-product pattern.
34 Should be vectorized on targets that support dot-product for unsigned chars.
35 This test currently fails to vectorize on targets that support dot-product
36 of chars only when the accumulator is int.
41 unsigned short result
= 0;
43 for (i
=0; i
<len
; i
++) {
44 result
+= (unsigned short)(X
[i
] * Y
[i
]);
49 /* char->int->int dot product.
50 Not detected as a dot-product.
51 Doesn't get vectorized due to presence of type converisons. */
55 unsigned int result
= 0;
57 for (i
=0; i
<len
; i
++) {
58 result
+= (X
[i
] * Y
[i
]);
65 unsigned int dot1
, dot3
;
91 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 2 "vect" } } */
93 /* When the vectorizer is enhanced to vectorize foo2 (accumulation into short) for
94 targets that support accumulation into int (powerpc, ia64) we'd have:
95 dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_udot_qi } }
97 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail *-*-* } } } */
98 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_udot_qi } } } */
100 /* { dg-final { cleanup-tree-dump "vect" } } */