Craig Topper | 934f86a | 2018-05-04 21:45:25 +0000 | [diff] [blame] | 1 | /*===---- xsaveoptintrin.h - XSAVEOPT intrinsic ----------------------------=== |
Peter Collingbourne | e919b0f | 2015-10-15 10:33:27 +0000 | [diff] [blame] | 2 | * |
Chandler Carruth | 4cf5743 | 2019-04-08 20:51:30 +0000 | [diff] [blame] | 3 | * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | * See https://llvm.org/LICENSE.txt for license information. |
| 5 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Peter Collingbourne | e919b0f | 2015-10-15 10:33:27 +0000 | [diff] [blame] | 6 | * |
| 7 | *===-----------------------------------------------------------------------=== |
| 8 | */ |
| 9 | |
| 10 | #ifndef __IMMINTRIN_H |
| 11 | #error "Never use <xsaveoptintrin.h> directly; include <immintrin.h> instead." |
| 12 | #endif |
| 13 | |
| 14 | #ifndef __XSAVEOPTINTRIN_H |
| 15 | #define __XSAVEOPTINTRIN_H |
| 16 | |
| 17 | /* Define the default attributes for the functions in this file. */ |
| 18 | #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xsaveopt"))) |
| 19 | |
| 20 | static __inline__ void __DEFAULT_FN_ATTRS |
| 21 | _xsaveopt(void *__p, unsigned long long __m) { |
Craig Topper | 819f2a2 | 2018-05-30 17:23:45 +0000 | [diff] [blame] | 22 | __builtin_ia32_xsaveopt(__p, __m); |
Peter Collingbourne | e919b0f | 2015-10-15 10:33:27 +0000 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | #ifdef __x86_64__ |
| 26 | static __inline__ void __DEFAULT_FN_ATTRS |
| 27 | _xsaveopt64(void *__p, unsigned long long __m) { |
Craig Topper | 819f2a2 | 2018-05-30 17:23:45 +0000 | [diff] [blame] | 28 | __builtin_ia32_xsaveopt64(__p, __m); |
Peter Collingbourne | e919b0f | 2015-10-15 10:33:27 +0000 | [diff] [blame] | 29 | } |
| 30 | #endif |
| 31 | |
| 32 | #undef __DEFAULT_FN_ATTRS |
| 33 | |
| 34 | #endif |