18 #ifndef NDB_PREFETCH_H
19 #define NDB_PREFETCH_H
21 #ifdef HAVE_SUN_PREFETCH_H
22 #include <sun_prefetch.h>
23 #if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x590) \
24 || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590)
26 #define USE_SUN_PREFETCH
27 #elif defined(__sparc)
29 #define USE_SPARC_PREFETCH
33 #ifdef HAVE_SUN_PREFETCH_H
34 #pragma optimize("", off)
38 void NDB_PREFETCH_READ(
void* addr)
40 #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10)
41 __builtin_prefetch(addr, 0, 3);
42 #elif defined(USE_SUN_PREFETCH)
43 sun_prefetch_read_once(addr);
44 #elif defined(USE_SPARC_PREFETCH)
45 sparc_prefetch_read_once(addr);
52 void NDB_PREFETCH_WRITE(
void* addr)
54 #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10)
55 __builtin_prefetch(addr, 1, 3);
56 #elif defined(USE_SUN_PREFETCH)
57 sun_prefetch_write_once(addr);
58 #elif defined(USE_SPARC_PREFETCH)
59 sparc_prefetch_write_once(addr);
65 #ifdef HAVE_SUN_PREFETCH_H
66 #pragma optimize("", on)