1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-require-effective-target arm_v8_2a_dotprod_neon_hw { target { aarch64*-*-* || arm*-*-* } } } */
5 /* { dg-add-options arm_v8_2a_dotprod_neon } */
10 #define SIGNEDNESS_1 signed
11 #define SIGNEDNESS_2 signed
14 SIGNEDNESS_1
int __attribute__ ((noipa
))
15 f (SIGNEDNESS_1
int res
,
20 for (int i
= 0; i
< n
; i
++)
22 res
+= a
[5 * i
+ 0] * b
[5 * i
+ 0];
23 res
+= a
[5 * i
+ 1] * b
[5 * i
+ 1];
24 res
+= a
[5 * i
+ 2] * b
[5 * i
+ 2];
25 res
+= a
[5 * i
+ 3] * b
[5 * i
+ 3];
26 res
+= a
[5 * i
+ 4] * b
[5 * i
+ 4];
32 #define BASE ((SIGNEDNESS_2 int) -1 < 0 ? -126 : 4)
40 SIGNEDNESS_2
char a
[100], b
[100];
41 int expected
= 0x12345;
45 for (int i
= 0; i
< sizeof (a
) / sizeof (a
[0]); ++i
)
48 b
[i
] = BASE
+ OFFSET
+ i
* 4;
52 for (int i
= 0; i
< n
; i
++)
54 expected
+= a
[5 * i
+ 0] * b
[5 * i
+ 0];
55 expected
+= a
[5 * i
+ 1] * b
[5 * i
+ 1];
56 expected
+= a
[5 * i
+ 2] * b
[5 * i
+ 2];
57 expected
+= a
[5 * i
+ 3] * b
[5 * i
+ 3];
58 expected
+= a
[5 * i
+ 4] * b
[5 * i
+ 4];
61 if (f (0x12345, a
, b
, n
) != expected
)
65 /* { dg-final { scan-tree-dump "vect_recog_dot_prod_pattern: detected" "vect" } } */
66 /* { dg-final { scan-tree-dump "vectorizing SLP node starting from: \\S+ = DOT_PROD_EXPR" "vect" { target vect_sdot_qi } } } */