1 /* { dg-require-effective-target vect_int } */
12 signed char X
[N
] __attribute__ ((__aligned__(16)));
13 signed char Y
[N
] __attribute__ ((__aligned__(16)));
15 /* char->short->int dot product.
16 The dot-product pattern should be detected.
17 Vectorizable on vect_sdot_qi targets (targets that support dot-product of
20 In the future could also be vectorized as widening-mult + widening-summation,
21 or with type-conversion support.
29 for (i
=0; i
<len
; i
++) {
36 /* char->short->short dot product.
37 The dot-product pattern should be detected.
38 The reduction is currently not vectorized becaus of the signed->unsigned->signed
39 casts, since this patch:
41 2005-12-26 Kazu Hirata <kazu@codesourcery.com>
43 PR tree-optimization/25125
45 When the dot-product is detected, the loop should be vectorized on vect_sdot_qi
46 targets (targets that support dot-product of signed char).
47 This test would currently fail to vectorize on targets that support
48 dot-product of chars when the accumulator is int.
50 In the future could also be vectorized as widening-mult + summation,
51 or with type-conversion support.
58 for (i
=0; i
<len
; i
++) {
59 result
+= (X
[i
] * Y
[i
]);
64 /* char->int->int dot product.
65 Not detected as a dot-product pattern.
66 Currently fails to be vectorized due to presence of type conversions. */
72 for (i
=0; i
<len
; i
++) {
73 result
+= (X
[i
] * Y
[i
]);
105 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 2 "vect" { xfail *-*-* } } } */
106 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
108 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail *-*-* } } } */
109 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_qi } } } */
111 /* { dg-final { cleanup-tree-dump "vect" } } */