Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/vect/pr65494.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* { dg-do compile } */ /* { dg-additional-options "-Ofast -funroll-loops" } */ typedef unsigned char uchar; typedef struct rgb_ {uchar r; uchar g; uchar b;} rgb; #define N 512 rgb in[N], out[N]; float c[N]; void foo(int n) { int i, j; for (i = 0; i < n; i++) //in and out are RGB byte arrays { float r = 0, g = 0, b = 0; for (j = 0; j < 5; j++) { r += (float)in[i + j].r * c[j]; g += (float)in[i + j].g * c[j]; b += (float)in[i + j].b * c[j]; } out[i].r = (uchar)r; out[i].g = (uchar)g; out[i].b = (uchar)b; } } /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { vect_float && vect_intfloat_cvt } } } } */