--- a/timer.h
+++ b/timer.h
@@ -75,8 +75,12 @@
             return 0;
 #endif
         case TIDEWAYS_XHPROF_CLOCK_TSC:
+#if !defined (__powerpc64__)
             asm volatile("rdtsc" : "=a" (a), "=d" (d));
             (val) = ((uint64)a) | (((uint64)d)<<32);
+#else
+	     asm volatile ("mftb %0" : "=r" (val));
+#endif
             return val / timebase_factor;
 
         default:
