#include "modules/bentleyottmann/include/Int96.h"
#include "tests/Test.h"
#include <cstdint>
#include <limits>
Go to the source code of this file.
◆ DEF_TEST() [1/4]
Definition at line 106 of file Int96Test.cpp.
106 {
107#if (defined(__clang__) || defined(__GNUC__)) && defined(__SIZEOF_INT128__)
112 r128 = a128 + b128;
113
116 r96 = a96 + b96;
117
118
120
121
122 __int128 hi128 = r96.hi,
123 lo128 = r96.lo,
124 all128 = hi128 * 0x1'0000'0000 + lo128;
126 }
127 }
128#endif
129}
static int64_t interesting64[]
#define REPORTER_ASSERT(r, cond,...)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
◆ DEF_TEST() [2/4]
Definition at line 12 of file Int96Test.cpp.
12 {
13 {
14 int32_t t = 0;
17 }
18 {
19 int64_t t = 0;
22 }
23 {
24 int32_t t = -1;
27 }
28 {
29 int64_t t = -1;
32 }
33 {
34 int32_t t = 3;
37 }
38 {
39 int64_t t = 3;
42 }
43 {
44 int32_t t = -3;
47 }
48 {
49 int64_t t = -3;
52 }
53
54 {
55 int64_t t = 1ll << 32;
58 }
59 {
60
61 int64_t t = -(2ll << 32);
64 }
65}
◆ DEF_TEST() [3/4]
Definition at line 84 of file Int96Test.cpp.
84 {
85#if (defined(__clang__) || defined(__GNUC__)) && defined(__SIZEOF_INT128__)
90 bool l128 = a128 < b128,
91 g128 = b128 < a128;
92
95 bool l96 = a96 < b96,
96 g96 = b96 < a96;
97
100
101 }
102 }
103#endif
104}
◆ DEF_TEST() [4/4]
Definition at line 131 of file Int96Test.cpp.
131 {
132#if (defined(__clang__) || defined(__GNUC__)) && defined(__SIZEOF_INT128__)
135 -2,
136 -1,
137 0,
138 1,
139 2,
142
144 for (auto i32 : interesting32) {
145 __int128 a128 = i64,
146 b128 = i32,
147 r128 = a128 * b128;
148
150
151
153
154
155 __int128 hi128 = r96.
hi,
157 all128 = hi128 * 0x1'0000'0000 + lo128;
159 }
160 }
161#endif
162}
static float max(float r, float g, float b)
Int96 multiply(int64_t a, int32_t b)
◆ interesting64