From bd40d887492c867e12e76790979465fc4b4fa097 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 4 Apr 2005 18:30:13 +0000 Subject: [PATCH] Don't use prefetch on Pentium 4, it actually gives worse results than not prefetching at all. Need to investigate more later. --- lib/prefetch.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/prefetch.h b/lib/prefetch.h index 46d10ca3..a0b045fb 100644 --- a/lib/prefetch.h +++ b/lib/prefetch.h @@ -1,7 +1,7 @@ /* * UCW Library -- Prefetch * - * (c) 1997--2003 Martin Mares + * (c) 1997--2005 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -10,23 +10,28 @@ #ifndef _UCW_PREFETCH_H #define _UCW_PREFETCH_H -#if defined(__athlon) || defined(__i686) +#if defined(__pentium4) + /* Default prefetches are good enough */ +#elif defined(__k6) + /* K6 doesn't have prefetches */ + +#elif defined(__athlon) || defined(__i686) + +#define HAVE_PREFETCH static inline void prefetch(void *addr) { asm volatile ("prefetcht0 %0" : : "m" (*(byte*)addr)); } #else - -#if !defined(__k6) #warning "Don't know how to prefetch on your CPU. Please fix lib/prefetch.h." #endif +#ifndef HAVE_PREFETCH static inline void prefetch(void *addr UNUSED) { } - #endif #endif -- 2.39.2