From 0b5944ae6c2a6da6cd48c332e8cd04e43c3b2fdf Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Thu, 28 May 2015 17:25:30 +0800 Subject: [PATCH] PerfLocal: fix i386 compatible with perf_local Signed-off-by: Haomai Wang --- src/test/perf_local.cc | 4 ++++ 1 file changed, 4 insertions(+) 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. -- 2.47.3