From eb606a3c279cc2dba8cdd1084405652013c4b9db Mon Sep 17 00:00:00 2001 From: Andrea Di Biagio Date: Mon, 30 Jun 2014 18:23:58 +0000 Subject: [x86] Add Clang support for intrinsic __rdpmc. This patch adds intrinsic __rdpmc to header file 'ia32intrin.h'. Intrinsic __rdmpc can be used to read performance monitoring counters. It is implemented as a direct call to __builtin_ia32_rdpmc. It takes as input a value representing the index of the performance counter to read. The value of the performance counter is then returned as a unsigned 64-bit quantity. llvm-svn: 212053 --- clang/lib/Headers/ia32intrin.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Headers/ia32intrin.h') diff --git a/clang/lib/Headers/ia32intrin.h b/clang/lib/Headers/ia32intrin.h index 55c22473ba7..5adf3f1f5d8 100644 --- a/clang/lib/Headers/ia32intrin.h +++ b/clang/lib/Headers/ia32intrin.h @@ -79,6 +79,11 @@ __writeeflags(unsigned int __f) } #endif /* !__x86_64__ */ +static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__)) +__rdpmc(int __A) { + return __builtin_ia32_rdpmc(__A); +} + /* __rdtsc */ static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__)) __rdtsc(void) { -- cgit v1.2.3