mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
merge with pull request #1557
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
2dc92e2b94
93 changed files with 526 additions and 548 deletions
|
@ -30,25 +30,16 @@ Revision History:
|
|||
#define SIZE_MAX std::numeric_limits<std::size_t>::max()
|
||||
#endif
|
||||
|
||||
#undef uint64
|
||||
#ifndef uint64
|
||||
typedef uint64_t uint64;
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(uint64) == 8, "64 bits please");
|
||||
static_assert(sizeof(uint64_t) == 8, "64 bits please");
|
||||
|
||||
#undef int64
|
||||
#ifndef int64
|
||||
typedef int64_t int64;
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(int64) == 8, "64 bits");
|
||||
static_assert(sizeof(int64_t) == 8, "64 bits");
|
||||
|
||||
#ifndef INT64_MIN
|
||||
#define INT64_MIN static_cast<int64>(0x8000000000000000ull)
|
||||
#define INT64_MIN static_cast<int64_t>(0x8000000000000000ull)
|
||||
#endif
|
||||
#ifndef INT64_MAX
|
||||
#define INT64_MAX static_cast<int64>(0x7fffffffffffffffull)
|
||||
#define INT64_MAX static_cast<int64_t>(0x7fffffffffffffffull)
|
||||
#endif
|
||||
#ifndef UINT64_MAX
|
||||
#define UINT64_MAX 0xffffffffffffffffull
|
||||
|
@ -113,7 +104,7 @@ inline unsigned next_power_of_two(unsigned v) {
|
|||
\brief Return the position of the most significant bit.
|
||||
*/
|
||||
unsigned log2(unsigned v);
|
||||
unsigned uint64_log2(uint64 v);
|
||||
unsigned uint64_log2(uint64_t v);
|
||||
|
||||
static_assert(sizeof(unsigned) == 4, "unsigned are 32 bits");
|
||||
|
||||
|
@ -139,11 +130,11 @@ static inline unsigned get_num_1bits(unsigned v) {
|
|||
|
||||
// Remark: on gcc, the operators << and >> do not produce zero when the second argument >= 64.
|
||||
// So, I'm using the following two definitions to fix the problem
|
||||
static inline uint64 shift_right(uint64 x, uint64 y) {
|
||||
static inline uint64_t shift_right(uint64_t x, uint64_t y) {
|
||||
return y < 64ull ? (x >> y) : 0ull;
|
||||
}
|
||||
|
||||
static inline uint64 shift_left(uint64 x, uint64 y) {
|
||||
static inline uint64_t shift_left(uint64_t x, uint64_t y) {
|
||||
return y < 64ull ? (x << y) : 0ull;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue