HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
stdint.hpp
Go to the documentation of this file.
1// Copyright Take Vos 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 "utility/module.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#ifndef HI_HAS_INT128
39
42using int128_t = bigint<uintreg_t, 128 / (sizeof(uintreg_t) * CHAR_BIT), true>;
43
46using uint128_t = bigint<uintreg_t, 128 / (sizeof(uintreg_t) * CHAR_BIT), false>;
47
48// clang-format off
49template<> struct has_intxx<128> : std::true_type {};
50template<> struct has_uintxx<128> : std::true_type {};
51template<> struct make_uintxx<128> { using type = uint128_t; };
52template<> struct make_intxx<128> { using type = int128_t; };
53// clang-format on
54
55#endif
56
57#if HI_PROCESSOR == HI_CPU_X86 || HI_PROCESSOR == HI_CPU_ARM
58
61using longreg_t = int64_t;
62
65using ulongreg_t = uint64_t;
66
67#elif HI_PROCESSOR == HI_CPU_X64 || HI_PROCESSOR == HI_CPU_ARM64
68
71using longreg_t = int128_t;
72
75using ulongreg_t = uint128_t;
76
77#else
78#error "longreg_t ulongreg_t missing implementation"
79#endif
80
81} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:13
int64_t longreg_t
Signed integer twice the size of a standard CPU register.
Definition stdint.hpp:61
unsigned __int128_t uint128_t
Unsigned 128 bit integer.
Definition architecture.hpp:184
__int128_t int128_t
Signed 128 bit integer.
Definition architecture.hpp:180
uint64_t ulongreg_t
Unsigned integer twice the size of a standard CPU register.
Definition stdint.hpp:65