111
|
1 // PR libstdc++/81706
|
|
2 // { dg-do compile { target i?86-*-* x86_64-*-* } }
|
|
3 // { dg-options "-O3 -mavx2 -mno-avx512f" }
|
131
|
4 // { dg-final { scan-assembler "call\[^\n\r]__?ZGVdN4v_cos" } }
|
|
5 // { dg-final { scan-assembler "call\[^\n\r]__?ZGVdN4v_sin" } }
|
111
|
6
|
|
7 #ifdef __cplusplus
|
|
8 extern "C" {
|
|
9 #endif
|
|
10 extern double cos (double) __attribute__ ((nothrow, leaf, simd ("notinbranch")));
|
|
11 extern double sin (double) __attribute__ ((nothrow, leaf, simd ("notinbranch")));
|
|
12 #ifdef __cplusplus
|
|
13 }
|
|
14 #endif
|
|
15 double p[1024] = { 1.0 };
|
|
16 double q[1024] = { 1.0 };
|
|
17
|
|
18 void
|
|
19 foo (void)
|
|
20 {
|
|
21 int i;
|
|
22 for (i = 0; i < 1024; i++)
|
|
23 p[i] = cos (q[i]);
|
|
24 }
|
|
25
|
|
26 void
|
|
27 bar (void)
|
|
28 {
|
|
29 int i;
|
|
30 for (i = 0; i < 1024; i++)
|
|
31 p[i] = __builtin_sin (q[i]);
|
|
32 }
|