src/prefetch.h

Go to the documentation of this file.
00001 #ifndef __PREFETCH_H__
00002 #define __PREFETCH_H__
00003 
00004 #define alternative_input(oldinstr, newinstr, feature, input...)        \
00005     asm volatile ("661:\n\t" oldinstr "\n662:\n"                \
00006             ".section .altinstructions,\"a\"\n"           \
00007             "  .align 4\n"                        \
00008             "  .long 661b\n"            /* label */           \
00009             "  .long 663f\n"        /* new instruction */     \
00010             "  .byte %c0\n"             /* feature bit */     \
00011             "  .byte 662b-661b\n"       /* sourcelen */       \
00012             "  .byte 664f-663f\n"       /* replacementlen */      \
00013             ".previous\n"                     \
00014             ".section .altinstr_replacement,\"ax\"\n"         \
00015             "663:\n\t" newinstr "\n664:\n"   /* replacement */    \
00016             ".previous" :: "i" (feature), ##input)
00017 
00018 
00019 static inline void prefetch(const void *x)
00020 {
00021     alternative_input(ASM_NOP4,
00022             "prefetchnta (%1)",
00023             X86_FEATURE_XMM,
00024             "r" (x));
00025 }
00026 
00027 
00028 #endif

Generated on Mon May 28 04:25:25 2007 for BattletechMUX by  doxygen 1.4.7