Avoid casting to char* in prefetch()

Funny enough, gcc __builtin_prefetch() expects
already a void*, instead Windows's _mm_prefetch()
requires a char*.

The patch allows to remove ugly casts from caller
sites.

No functional change.
This commit is contained in:
Marco Costalba
2015-02-07 19:13:41 +01:00
parent 152a4dc5cd
commit 99c9cae586
4 changed files with 9 additions and 9 deletions

View File

@@ -176,11 +176,11 @@ void start_logger(bool b) { Logger::start(b); }
/// which can be quite slow.
#ifdef NO_PREFETCH
void prefetch(char*) {}
void prefetch(void*) {}
#else
void prefetch(char* addr) {
void prefetch(void* addr) {
# if defined(__INTEL_COMPILER)
// This hack prevents prefetches from being optimized away by
@@ -189,7 +189,7 @@ void prefetch(char* addr) {
# endif
# if defined(__INTEL_COMPILER) || defined(_MSC_VER)
_mm_prefetch(addr, _MM_HINT_T0);
_mm_prefetch((char*)addr, _MM_HINT_T0);
# else
__builtin_prefetch(addr);
# endif