HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
stdint.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2021-2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "architecture.hpp"
8
9#if (HI_COMPILER == HI_CC_GCC || HI_COMPILER == HI_CC_CLANG) && (HI_PROCESSOR == HI_CPU_X64 || HI_PROCESSOR == HI_CPU_ARM64)
10#define HI_HAS_INT128 1
11#endif
12
13#if !defined(HI_HAS_INT128)
14#include "bigint.hpp"
15#endif
16#include <cstdint>
17
36namespace hi::inline v1 {
37
38#if defined(HI_HAS_INT128)
39using int128_t = __int128_t;
40using uint128_t = unsigned __int128_t;
41#else
42using int128_t = bigint<uintreg_t, 128 / (sizeof(uintreg_t) * CHAR_BIT), true>;
43using uint128_t = bigint<uintreg_t, 128 / (sizeof(uintreg_t) * CHAR_BIT), false>;
44#endif
45
46#if HI_PROCESSOR == HI_CPU_X86
47using longreg_t = int64_t;
48using ulongreg_t = uint64_t;
49#elif HI_PROCESSOR == HI_CPU_X64
50using longreg_t = int128_t;
51using ulongreg_t = uint128_t;
52#elif HI_PROCESS = HI_CPU_ARM
53using longreg_t = int64_t;
54using ulongreg_t = uint64_t;
55#elif HI_PROCESS = HI_CPU_ARM64
56using longreg_t = int128_t;
57using ulongreg_t = uint128_t;
58#else
59#error "register_int missing implementation"
60#endif
61
62} // namespace hi::inline v1
Functions and macros for handling architectural difference between compilers, CPUs and operating syst...