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 } */
10 #define SIGNEDNESS_1 signed
11 #define SIGNEDNESS_2 unsigned
12 #define SIGNEDNESS_3 signed
15 SIGNEDNESS_1
int __attribute__ ((noipa
))
16 f (SIGNEDNESS_1
int res
,
17 SIGNEDNESS_2
char *restrict a
,
18 SIGNEDNESS_2
char *restrict b
,
19 SIGNEDNESS_3
short *restrict c
,
20 SIGNEDNESS_3
short *restrict d
,
21 SIGNEDNESS_1
int *restrict e
)
23 for (int i
= 0; i
< N
; ++i
)
25 short diff
= a
[i
] - b
[i
];
26 SIGNEDNESS_2
short abs
= diff
< 0 ? -diff
: diff
;
34 #define BASE2 ((SIGNEDNESS_2 int) -1 < 0 ? -126 : 4)
35 #define BASE3 ((SIGNEDNESS_3 int) -1 < 0 ? -1236 : 373)
43 SIGNEDNESS_2
char a
[N
], b
[N
];
44 SIGNEDNESS_3
short c
[N
], d
[N
];
45 SIGNEDNESS_1
int e
[N
];
46 int expected
= 0x12345;
49 for (int i
= 0; i
< N
; ++i
)
54 d
[i
] = BASE3
+ OFFSET
+ i
* 3;
56 short diff
= a
[i
] - b
[i
];
57 SIGNEDNESS_2
short abs
= diff
< 0 ? -diff
: diff
;
59 expected
+= c
[i
] * d
[i
];
63 if (f (0x12345, a
, b
, c
, d
, e
) != expected
)
67 /* { dg-final { scan-tree-dump "vectorizing statement: \\S+ = SAD_EXPR" "vect" { target vect_udot_qi } } } */
68 /* { dg-final { scan-tree-dump "vectorizing statement: \\S+ = DOT_PROD_EXPR" "vect" { target vect_sdot_hi } } } */