summaryrefslogtreecommitdiff
path: root/absl/base/prefetch.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/prefetch.h')
-rw-r--r--absl/base/prefetch.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/base/prefetch.h b/absl/base/prefetch.h
index 6fd2a820..609e26e7 100644
--- a/absl/base/prefetch.h
+++ b/absl/base/prefetch.h
@@ -158,7 +158,7 @@ ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheForWrite(
// manually emit prefetchw. PREFETCHW is recognized as a no-op on older Intel
// processors and has been present on AMD processors since the K6-2.
#if defined(__x86_64__)
- asm("prefetchw (%0)" : : "r"(addr));
+ asm("prefetchw %0" : : "m"(*reinterpret_cast<const char*>(addr)));
#else
__builtin_prefetch(addr, 1, 3);
#endif
@@ -187,7 +187,7 @@ ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheForWrite(
// up, PREFETCHW is recognized as a no-op on older Intel processors
// and has been present on AMD processors since the K6-2. We have this
// disabled for MSVC compilers as this miscompiles on older MSVC compilers.
- asm("prefetchw (%0)" : : "r"(addr));
+ asm("prefetchw %0" : : "m"(*reinterpret_cast<const char*>(addr)));
#endif
}