[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / lib / Headers / rdpruintrin.h
blob89732bb8b3cf1128edbae7ec060a197f1c45d111
1 /*===---- rdpruintrin.h - RDPRU intrinsics ---------------------------------===
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
7 *===-----------------------------------------------------------------------===
8 */
10 #if !defined __X86INTRIN_H
11 #error "Never use <rdpruintrin.h> directly; include <x86intrin.h> instead."
12 #endif
14 #ifndef __RDPRUINTRIN_H
15 #define __RDPRUINTRIN_H
17 /* Define the default attributes for the functions in this file. */
18 #define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, __target__("rdpru")))
22 /// Reads the content of a processor register.
23 ///
24 /// \headerfile <x86intrin.h>
25 ///
26 /// This intrinsic corresponds to the <c> RDPRU </c> instruction.
27 ///
28 /// \param reg_id
29 /// A processor register identifier.
30 static __inline__ unsigned long long __DEFAULT_FN_ATTRS
31 __rdpru (int reg_id)
33 return __builtin_ia32_rdpru(reg_id);
36 #define __RDPRU_MPERF 0
37 #define __RDPRU_APERF 1
39 /// Reads the content of processor register MPERF.
40 ///
41 /// \headerfile <x86intrin.h>
42 ///
43 /// This intrinsic generates instruction <c> RDPRU </c> to read the value of
44 /// register MPERF.
45 #define __mperf() __builtin_ia32_rdpru(__RDPRU_MPERF)
47 /// Reads the content of processor register APERF.
48 ///
49 /// \headerfile <x86intrin.h>
50 ///
51 /// This intrinsic generates instruction <c> RDPRU </c> to read the value of
52 /// register APERF.
53 #define __aperf() __builtin_ia32_rdpru(__RDPRU_APERF)
55 #undef __DEFAULT_FN_ATTRS
57 #endif /* __RDPRUINTRIN_H */