Debian Codegraph @

gcc/testsuite/gcc.target/i386/xgetsetbv.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mxsave" } */
3 /* { dg-final { scan-assembler-times "xgetbv" 3 } } */
4 /* { dg-final { scan-assembler-times "xsetbv" 3 } } */
5
6 #include <x86intrin.h>
7
8 unsigned long long
9 foo (unsigned x, unsigned y)
10 {
11 _xsetbv (x, y);
12 return _xgetbv (x);
13 }
14
15 unsigned long long
16 bar (unsigned x, unsigned long long y)
17 {
18 _xsetbv (x, y);
19 return _xgetbv (x);
20 }
21
22 unsigned long long
23 baz (void)
24 {
25 _xsetbv (0, 0);
26 return _xgetbv (0);
27 }