libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr115841.c
blobaa5c66004a03ac65c785464da5bdb24d192c3259
1 /* { dg-do compile } */
2 /* { dg-additional-options "-Ofast -fcommon -fvect-cost-model=dynamic --param vect-partial-vector-usage=1" } */
3 /* { dg-additional-options "-mavx512vl" { target avx512vl } } */
5 /* To trigger the bug costing needs to determine that aligning the A170
6 accesses with a prologue is good and there should be a vectorized
7 epilogue with a smaller vector size, re-using the vector accumulator
8 from the vectorized main loop that's statically known to execute
9 but the epilogue loop is not. */
11 static unsigned char xl[192];
12 unsigned char A170[192*3];
14 void jerate (unsigned char *, unsigned char *);
15 float foo (unsigned n)
17 jerate (xl, A170);
19 unsigned i = 32;
20 int kr = 1;
21 float sfn11s = 0.f;
22 float sfn12s = 0.f;
25 int krm1 = kr - 1;
26 long j = krm1;
27 float a = (*(float(*)[n])A170)[j];
28 float b = (*(float(*)[n])xl)[j];
29 float c = a * b;
30 float d = c * 6.93149983882904052734375e-1f;
31 float e = (*(float(*)[n])A170)[j+48];
32 float f = (*(float(*)[n])A170)[j+96];
33 float g = d * e;
34 sfn11s = sfn11s + g;
35 float h = f * d;
36 sfn12s = sfn12s + h;
37 kr++;
39 while (--i != 0);
40 float tem = sfn11s + sfn12s;
41 return tem;