Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Prefetch.h
Go to the documentation of this file.
1
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2
// SPDX-FileCopyrightText: 2026 Jorrit Rouwe
3
// SPDX-License-Identifier: MIT
4
5
#pragma once
6
7
JPH_NAMESPACE_BEGIN
8
10
template
<
typename
T>
11
inline
void
PrefetchL1
(
const
T *inAddress)
12
{
13
#ifdef JPH_USE_SSE
14
_mm_prefetch(
reinterpret_cast<
const
char
*
>
(inAddress), _MM_HINT_T0);
15
#elif defined(JPH_COMPILER_GCC) || defined(JPH_COMPILER_CLANG)
16
__builtin_prefetch(inAddress, 0, 3);
17
#endif
18
}
19
20
JPH_NAMESPACE_END
JPH_NAMESPACE_END
#define JPH_NAMESPACE_END
Definition
Core.h:428
JPH_NAMESPACE_BEGIN
#define JPH_NAMESPACE_BEGIN
Definition
Core.h:422
PrefetchL1
JPH_NAMESPACE_BEGIN void PrefetchL1(const T *inAddress)
Prefetch the given address to L1 cache. Can be used to avoid cache misses, but should be used with ca...
Definition
Prefetch.h:11
Jolt
Core
Prefetch.h
Generated by
1.12.0