i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr65494.c
blobfe51e716b743a3a5018cde9a9d873f18730765f1
1 /* { dg-do compile } */
2 /* { dg-additional-options "-Ofast -funroll-loops" } */
4 typedef unsigned char uchar;
5 typedef struct rgb_ {uchar r; uchar g; uchar b;} rgb;
6 #define N 512
7 rgb in[N], out[N];
8 float c[N];
9 void foo(int n)
11 int i, j;
12 for (i = 0; i < n; i++) //in and out are RGB byte arrays
14 float r = 0, g = 0, b = 0;
15 for (j = 0; j < 5; j++)
17 r += (float)in[i + j].r * c[j];
18 g += (float)in[i + j].g * c[j];
19 b += (float)in[i + j].b * c[j];
21 out[i].r = (uchar)r;
22 out[i].g = (uchar)g;
23 out[i].b = (uchar)b;
27 /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { vect_float && vect_intfloat_cvt } } } } */