r205172 - Added _rdtsc intrinsics by Robert Khasanov
Alexey Volkov
avolkov.intel at gmail.com
Mon Mar 31 01:08:46 PDT 2014
Author: volkalex
Date: Mon Mar 31 03:08:46 2014
New Revision: 205172
URL: http://llvm.org/viewvc/llvm-project?rev=205172&view=rev
Log:
Added _rdtsc intrinsics by Robert Khasanov
Differential Revision: http://llvm-reviews.chandlerc.com/D3212
Modified:
cfe/trunk/lib/Headers/Intrin.h
cfe/trunk/lib/Headers/ia32intrin.h
Modified: cfe/trunk/lib/Headers/Intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/Intrin.h?rev=205172&r1=205171&r2=205172&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/Intrin.h (original)
+++ cfe/trunk/lib/Headers/Intrin.h Mon Mar 31 03:08:46 2014
@@ -976,12 +976,6 @@ _xgetbv(unsigned int __xcr_no) {
__asm__ ("xgetbv" : "=a" (__eax), "=d" (__edx) : "c" (__xcr_no));
return ((unsigned __int64)__edx << 32) | __eax;
}
-static __inline__ unsigned __int64 __attribute__((__always_inline__, __nodebug__))
-__rdtsc(void) {
- unsigned int __eax, __edx;
- __asm__ ("rdtsc" : "=a" (__eax), "=d" (__edx));
- return ((unsigned __int64)__edx << 32) | __eax;
-}
static __inline__ void __attribute__((__always_inline__, __nodebug__))
__halt(void) {
__asm__ volatile ("hlt");
Modified: cfe/trunk/lib/Headers/ia32intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/ia32intrin.h?rev=205172&r1=205171&r2=205172&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/ia32intrin.h (original)
+++ cfe/trunk/lib/Headers/ia32intrin.h Mon Mar 31 03:08:46 2014
@@ -79,4 +79,14 @@ __writeeflags(unsigned int __f)
}
#endif /* !__x86_64__ */
+/* __rdtsc */
+static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
+__rdtsc(void) {
+ unsigned int __eax, __edx;
+ __asm__ ("rdtsc" : "=a" (__eax), "=d" (__edx));
+ return ((unsigned long long)__edx << 32) | __eax;
+}
+
+#define _rdtsc() __rdtsc()
+
#endif /* __IA32INTRIN_H */
More information about the cfe-commits
mailing list