fortran/trans-openmp.cc: Use the correct member in gfc_omp_namelist [PR118745]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-dotprod-conv-optab.c
blob63e6c95480da1b7cb68dea9f359aabafc85e1ff7
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_dotprod_hisi } */
3 /* Ensure that, given the same input datatype, both the two-way and four-way
4 dot products are autovectorized, with the correct operation then selected
5 based on the distinct output types. */
6 #include <stdint.h>
8 uint32_t udot4(int n, uint8_t* data) {
9 uint32_t sum = 0;
10 for (int i=0; i<n; i+=1) {
11 sum += data[i] * data[i];
13 return sum;
16 int32_t sdot4(int n, int8_t* data) {
17 int32_t sum = 0;
18 for (int i=0; i<n; i+=1) {
19 sum += data[i] * data[i];
21 return sum;
24 uint32_t udot2(int n, uint16_t* data) {
25 uint32_t sum = 0;
26 for (int i=0; i<n; i+=1) {
27 sum += data[i] * data[i];
29 return sum;
32 int32_t sdot2(int n, int16_t* data) {
33 int32_t sum = 0;
34 for (int i=0; i<n; i+=1) {
35 sum += data[i] * data[i];
37 return sum;
40 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
41 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 4 "vect" } } */