Commit 8aa88cd1 by Martijn Vels Committed by Copybara-Service

Remove _m_prefetchw() in favor of supporting only _mm_prefetch() or __builtin_prefetch()

Supporting _m_prefetchw() (officially part of 3DNOW) across various compilers and platforms turns out to be difficult. This change removes the explicit _m_prefetchw call aimed at MSVC compilers given that it causes issues in clang / chromium compilations.

PiperOrigin-RevId: 509632497
Change-Id: Ib1b6b2cf667cbc1af5ed6651cd9aa0294a9265b6
parent 15957950
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
(defined(_M_X64) || defined(_M_IX86)) (defined(_M_X64) || defined(_M_IX86))
#include <intrin.h> #include <intrin.h>
#pragma intrinsic(_mm_prefetch) #pragma intrinsic(_mm_prefetch)
#pragma intrinsic(_m_prefetchw)
#endif #endif
namespace absl { namespace absl {
...@@ -176,10 +175,6 @@ inline void PrefetchToLocalCacheNta(const void* addr) { ...@@ -176,10 +175,6 @@ inline void PrefetchToLocalCacheNta(const void* addr) {
inline void PrefetchToLocalCacheForWrite(const void* addr) { inline void PrefetchToLocalCacheForWrite(const void* addr) {
#if defined(_MM_HINT_ET0) #if defined(_MM_HINT_ET0)
_mm_prefetch(reinterpret_cast<const char*>(addr), _MM_HINT_ET0); _mm_prefetch(reinterpret_cast<const char*>(addr), _MM_HINT_ET0);
#elif defined(_MSC_VER) && _MSC_VER >= 1900 && \
(defined(_M_X64) || defined(_M_IX86))
// MSVC 2015 and up on x86/x64 supports prefetchw (feature listed as 3DNOW)
_m_prefetchw(const_cast<void*>(addr));
#elif !defined(_MSC_VER) && defined(__x86_64__) #elif !defined(_MSC_VER) && defined(__x86_64__)
// _MM_HINT_ET0 is not universally supported. As we commented further // _MM_HINT_ET0 is not universally supported. As we commented further
// up, PREFETCHW is recognized as a no-op on older Intel processors // up, PREFETCHW is recognized as a no-op on older Intel processors
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment