extern cycles_t cacheflush_time;
-#define rdtscll(val) \
- __asm__ __volatile__("rdtsc" : "=A" (val))
+#if defined(__x86_64__)
+
+#define rdtscll(lo, hi) \
+ __asm__ __volatile__("rdtsc" : "=a" (lo), "=d" (hi))
+
+static inline cycles_t get_cycles (void)
+{
+ cycles_t lo, hi;
+
+ rdtscll(lo, hi);
+ return lo;
+}
+
+#else
+
+#define rdtscll(val) \
+__asm__ __volatile__("rdtsc" : "=A" (val))
static inline cycles_t get_cycles (void)
{
rdtscll(ret);
return ret & 0xffffffff;
}
+#endif
#elif defined(__powerpc__)
/* debian: sparc, arm, m68k */
+#ifndef COMPILER_MSVC
+/* GRRR... Annoyingly, #warning aborts the compilation for MSVC !! */
#warning You are compiling libardour on a platform for which ardour/cycles.h needs work
+#endif
#include <sys/time.h>