diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-28 22:51:12 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-28 22:51:12 +0100 |
| commit | 83270dcaeae598323b9cb2ae5a1a892ac5f72091 (patch) | |
| tree | fd482917ebf8cbb5c17baf7f295be384c336c1f9 /src/utils/prefetch.h | |
| parent | f4523e0422b1994a6fecba0efb336525d4f81d57 (diff) | |
| download | nissy-core-83270dcaeae598323b9cb2ae5a1a892ac5f72091.tar.gz nissy-core-83270dcaeae598323b9cb2ae5a1a892ac5f72091.zip | |
Prefetch
Diffstat (limited to 'src/utils/prefetch.h')
| -rw-r--r-- | src/utils/prefetch.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/prefetch.h b/src/utils/prefetch.h new file mode 100644 index 0000000..89b14e8 --- /dev/null +++ b/src/utils/prefetch.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #if defined(AVX2) | ||
| 2 | |||
| 3 | #define prefetch(a, i) _mm_prefetch(a+i, _MM_HINT_T0) | ||
| 4 | |||
| 5 | #else | ||
| 6 | #if defined(__GNUC__) || defined(__clang__) | ||
| 7 | |||
| 8 | #define prefetch(a, i) __builtin_prefetch(a+i, 0, 0) | ||
| 9 | |||
| 10 | #else | ||
| 11 | |||
| 12 | #define prefetch(a, i) (void)i | ||
| 13 | |||
| 14 | #endif | ||
| 15 | #endif | ||
