1 /* { dg-require-effective-target vect_int } */
11 unsigned short X
[N
] __attribute__ ((__aligned__(16)));
12 unsigned short Y
[N
] __attribute__ ((__aligned__(16)));
14 /* short->short->int dot product.
15 Not detected as a dot-product pattern.
16 Not vectorized due to presence of type-conversions. */
20 unsigned int result
= 0;
23 for (i
=0; i
<len
; i
++) {
30 /* short->int->int dot product.
31 Currently not detected as a dot-product pattern: the multiplication
32 promotes the ushorts to int, and then the product is promoted to unsigned
33 int for the addition. Which results in an int->unsigned int cast, which
34 since no bits are modified in the cast should be trivially vectorizable. */
38 unsigned int result
= 0;
40 for (i
=0; i
<len
; i
++) {
41 result
+= (X
[i
] * Y
[i
]);
49 unsigned int dot1
, dot2
;
70 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" { xfail *-*-* } } } */
72 /* Once the dot-product pattern is detected in the second loop, we expect
73 that loop to be vectorized on vect_udot_hi targets (targets that support
74 dot-product of unsigned shorts). */
75 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
77 /* { dg-final { cleanup-tree-dump "vect" } } */