12#include "../macros.hpp"
18#include <TargetConditionals.h>
21hi_export_module(hikogui.utility.architecture);
25#if HI_PROCESSOR == HI_CPU_X86
26constexpr std::size_t hardware_destructive_interference_size = 128;
27constexpr std::size_t hardware_constructive_interference_size = 64;
28using intreg_t = int32_t;
29using uintreg_t = uint32_t;
30#elif HI_PROCESSOR == HI_CPU_X64
31constexpr std::size_t hardware_destructive_interference_size = 128;
32constexpr std::size_t hardware_constructive_interference_size = 64;
33using intreg_t = int64_t;
34using uintreg_t = uint64_t;
35#elif HI_PROCESSOR == HI_CPU_ARM
36constexpr std::size_t hardware_destructive_interference_size = 128;
37constexpr std::size_t hardware_constructive_interference_size = 64;
38using intreg_t = int32_t;
39using uintreg_t = uint32_t;
40#elif HI_PROCESSOR == HI_CPU_ARM64
41constexpr std::size_t hardware_destructive_interference_size = 128;
42constexpr std::size_t hardware_constructive_interference_size = 64;
43using intreg_t = int64_t;
44using uintreg_t = uint64_t;
46#error "missing implementation for CPU specific register and cache-line sizes"
50#if (HI_COMPILER == HI_CC_GCC || HI_COMPILER == HI_CC_CLANG) && (HI_PROCESSOR == HI_CPU_X64 || HI_PROCESSOR == HI_CPU_ARM64)
51#define HI_HAS_INT128 1
62#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
63using os_handle =
void *;
64using file_handle = os_handle;
65using thread_id = uint32_t;
68#elif HI_OPERATING_SYSTEM == HI_OS_MACOS
70using file_handle =
int;
71using thread_id = uint32_t;
74#elif HI_OPERATING_SYSTEM == HI_OS_LINUX
76using file_handle =
int;
77using thread_id = uint32_t;
81#error "Not implemented."
DOXYGEN BUG.
Definition algorithm.hpp:16
__int128 int128_t
Signed 128 bit integer.
Definition architecture.hpp:54
unsigned __int128 uint128_t
Unsigned 128 bit integer.
Definition architecture.hpp:58
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377