1292920Sdim/*===---- xsaveintrin.h - XSAVE intrinsic ------------------------------------===
2292920Sdim *
3292920Sdim * Permission is hereby granted, free of charge, to any person obtaining a copy
4292920Sdim * of this software and associated documentation files (the "Software"), to deal
5292920Sdim * in the Software without restriction, including without limitation the rights
6292920Sdim * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7292920Sdim * copies of the Software, and to permit persons to whom the Software is
8292920Sdim * furnished to do so, subject to the following conditions:
9292920Sdim *
10292920Sdim * The above copyright notice and this permission notice shall be included in
11292920Sdim * all copies or substantial portions of the Software.
12292920Sdim *
13292920Sdim * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14292920Sdim * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15292920Sdim * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16292920Sdim * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17292920Sdim * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18292920Sdim * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19292920Sdim * THE SOFTWARE.
20292920Sdim *
21292920Sdim *===-----------------------------------------------------------------------===
22292920Sdim */
23292920Sdim
24292920Sdim#ifndef __IMMINTRIN_H
25292920Sdim#error "Never use <xsaveintrin.h> directly; include <immintrin.h> instead."
26292920Sdim#endif
27292920Sdim
28292920Sdim#ifndef __XSAVEINTRIN_H
29292920Sdim#define __XSAVEINTRIN_H
30292920Sdim
31292920Sdim/* Define the default attributes for the functions in this file. */
32292920Sdim#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__,  __target__("xsave")))
33292920Sdim
34292920Sdimstatic __inline__ void __DEFAULT_FN_ATTRS
35292920Sdim_xsave(void *__p, unsigned long long __m) {
36292920Sdim  return __builtin_ia32_xsave(__p, __m);
37292920Sdim}
38292920Sdim
39292920Sdimstatic __inline__ void __DEFAULT_FN_ATTRS
40292920Sdim_xrstor(void *__p, unsigned long long __m) {
41292920Sdim  return __builtin_ia32_xrstor(__p, __m);
42292920Sdim}
43292920Sdim
44292920Sdim#ifdef __x86_64__
45292920Sdimstatic __inline__ void __DEFAULT_FN_ATTRS
46292920Sdim_xsave64(void *__p, unsigned long long __m) {
47292920Sdim  return __builtin_ia32_xsave64(__p, __m);
48292920Sdim}
49292920Sdim
50292920Sdimstatic __inline__ void __DEFAULT_FN_ATTRS
51292920Sdim_xrstor64(void *__p, unsigned long long __m) {
52292920Sdim  return __builtin_ia32_xrstor64(__p, __m);
53292920Sdim}
54292920Sdim#endif
55292920Sdim
56292920Sdim#undef __DEFAULT_FN_ATTRS
57292920Sdim
58292920Sdim#endif
59