1272343Sngie/* Copyright (C) 2014-2015 Free Software Foundation, Inc.
2272343Sngie
3272343Sngie   This file is part of GCC.
4272343Sngie
5272343Sngie   GCC is free software; you can redistribute it and/or modify
6272343Sngie   it under the terms of the GNU General Public License as published by
7272343Sngie   the Free Software Foundation; either version 3, or (at your option)
8272343Sngie   any later version.
9272343Sngie
10272343Sngie   GCC is distributed in the hope that it will be useful,
11272343Sngie   but WITHOUT ANY WARRANTY; without even the implied warranty of
12272343Sngie   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13272343Sngie   GNU General Public License for more details.
14272343Sngie
15272343Sngie   Under Section 7 of GPL version 3, you are granted additional
16272343Sngie   permissions described in the GCC Runtime Library Exception, version
17272343Sngie   3.1, as published by the Free Software Foundation.
18272343Sngie
19272343Sngie   You should have received a copy of the GNU General Public License and
20272343Sngie   a copy of the GCC Runtime Library Exception along with this program;
21272343Sngie   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
22272343Sngie   <http://www.gnu.org/licenses/>.  */
23272343Sngie
24272343Sngie#if !defined _X86INTRIN_H_INCLUDED
25272343Sngie# error "Never use <xsavesintrin.h> directly; include <x86intrin.h> instead."
26272343Sngie#endif
27272343Sngie
28272343Sngie#ifndef _XSAVESINTRIN_H_INCLUDED
29272343Sngie#define _XSAVESINTRIN_H_INCLUDED
30272343Sngie
31272343Sngie#ifndef __XSAVES__
32272343Sngie#pragma GCC push_options
33272343Sngie#pragma GCC target("xsaves")
34272343Sngie#define __DISABLE_XSAVES__
35272343Sngie#endif /* __XSAVES__ */
36272343Sngie
37272343Sngieextern __inline void
38272343Sngie__attribute__((__gnu_inline__, __always_inline__, __artificial__))
39272343Sngie_xsaves (void *__P, long long __M)
40272343Sngie{
41272343Sngie  __builtin_ia32_xsaves (__P, __M);
42272343Sngie}
43272343Sngie
44272343Sngieextern __inline void
45272343Sngie__attribute__((__gnu_inline__, __always_inline__, __artificial__))
46272343Sngie_xrstors (void *__P, long long __M)
47272343Sngie{
48272343Sngie  __builtin_ia32_xrstors (__P, __M);
49272343Sngie}
50272343Sngie
51272343Sngie#ifdef __x86_64__
52272343Sngieextern __inline void
53272343Sngie__attribute__((__gnu_inline__, __always_inline__, __artificial__))
54272343Sngie_xrstors64 (void *__P, long long __M)
55272343Sngie{
56272343Sngie  __builtin_ia32_xrstors64 (__P, __M);
57272343Sngie}
58272343Sngie
59272343Sngieextern __inline void
60272343Sngie__attribute__((__gnu_inline__, __always_inline__, __artificial__))
61272343Sngie_xsaves64 (void *__P, long long __M)
62272343Sngie{
63272343Sngie  __builtin_ia32_xsaves64 (__P, __M);
64272343Sngie}
65272343Sngie#endif
66272343Sngie
67272343Sngie#ifdef __DISABLE_XSAVES__
68272343Sngie#undef __DISABLE_XSAVES__
69272343Sngie#pragma GCC pop_options
70272343Sngie#endif /* __DISABLE_XSAVES__ */
71272343Sngie
72272343Sngie#endif /* _XSAVESINTRIN_H_INCLUDED */
73272343Sngie