aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/monitorx.c
blob: e4ca18d33761ffec5e391b643a3e6294dddcf0ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* { dg-do compile } */
/* { dg-options "-O2 -mmwaitx" } */

/* Verify that they work in both 32bit and 64bit.  */

#include <x86intrin.h>

void
foo (char *p, int x, int y, int z, int c)
{
   _mm_monitorx (p, y, x);
   _mm_mwaitx (z, y, c);
}

void
bar (char *p, long x, long y, long z, long c)
{
   _mm_monitorx (p, y, x);
   _mm_mwaitx (z, y, c);
}

void
foo1 (char *p)
{
   _mm_monitorx (p, 0, 0);
   _mm_mwaitx (0, 0, 0);
}