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 *===-----------------------------------------------------------------------===
10 #if !defined __X86INTRIN_H
11 #error "Never use <rdpruintrin.h> directly; include <x86intrin.h> instead."
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.
24 /// \headerfile <x86intrin.h>
26 /// This intrinsic corresponds to the <c> RDPRU </c> instruction.
29 /// A processor register identifier.
30 static __inline__
unsigned long long __DEFAULT_FN_ATTRS
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.
41 /// \headerfile <x86intrin.h>
43 /// This intrinsic generates instruction <c> RDPRU </c> to read the value of
45 #define __mperf() __builtin_ia32_rdpru(__RDPRU_MPERF)
47 /// Reads the content of processor register APERF.
49 /// \headerfile <x86intrin.h>
51 /// This intrinsic generates instruction <c> RDPRU </c> to read the value of
53 #define __aperf() __builtin_ia32_rdpru(__RDPRU_APERF)
55 #undef __DEFAULT_FN_ATTRS
57 #endif /* __RDPRUINTRIN_H */