Skip to content

Commit

Permalink
Merge pull request #3 from nemequ/master
Browse files Browse the repository at this point in the history
improve prefetch portability
  • Loading branch information
fusiyuan2010 committed Apr 14, 2015
2 parents 78b2e31 + c9f051b commit 906930d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/libcsc/csc_mf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#include <stdio.h>
#include <csc_model.h>

#ifdef _NO_PREFETCH_
#define PREFETCH_T0(addr)
#if defined(__amd64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
# include <emmintrin.h>
# define PREFETCH_T0(addr) _mm_prefetch(((char *)(addr)),_MM_HINT_T0)
#elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
# define PREFETCH_T0(addr) __builtin_prefetch(addr)
#else
#include <emmintrin.h>
#define PREFETCH_T0(addr) _mm_prefetch(((char *)(addr)),_MM_HINT_T0)
# define PREFETCH_T0(addr)
#endif


Expand Down

0 comments on commit 906930d

Please sign in to comment.