From: Haomai Wang Date: Thu, 28 May 2015 09:25:30 +0000 (+0800) Subject: PerfLocal: fix i386 compatible with perf_local X-Git-Tag: v9.0.2~99^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0b5944ae6c2a6da6cd48c332e8cd04e43c3b2fdf;p=ceph.git PerfLocal: fix i386 compatible with perf_local Signed-off-by: Haomai Wang --- diff --git a/src/test/perf_local.cc b/src/test/perf_local.cc index 4c7ac7cecb50..bbe390b57781 100644 --- a/src/test/perf_local.cc +++ b/src/test/perf_local.cc @@ -35,7 +35,9 @@ // * Create a new entry for the test in the #tests table. #include #include +#if defined(__x86_64__) || defined(__amd64__) #include +#endif #include "include/atomic.h" #include "include/buffer.h" @@ -606,10 +608,12 @@ double perf_cycles_to_nanoseconds() */ static inline void prefetch(const void *object, uint64_t num_bytes) { +#if defined(__x86_64__) || defined(__amd64__) uint64_t offset = reinterpret_cast(object) & 0x3fUL; const char* p = reinterpret_cast(object) - offset; for (uint64_t i = 0; i < offset + num_bytes; i += 64) _mm_prefetch(p + i, _MM_HINT_T0); +#endif } // Measure the cost of the prefetch instruction.