3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 11:25:51 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-04-30 09:30:43 -07:00
commit f525f43e43
155 changed files with 3188 additions and 1043 deletions

View file

@ -21,32 +21,26 @@ Revision History:
#include "util/debug.h"
#include "util/memory_manager.h"
#include "util/z3_omp.h"
#include<iostream>
#include<climits>
#include<limits>
#include"z3_omp.h"
#include<stdint.h>
#ifndef SIZE_MAX
#define SIZE_MAX std::numeric_limits<std::size_t>::max()
#endif
#ifndef uint64
typedef unsigned long long uint64;
#endif
static_assert(sizeof(uint64) == 8, "64 bits please");
static_assert(sizeof(uint64_t) == 8, "64 bits please");
#ifndef int64
typedef long long 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
@ -111,7 +105,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");
@ -137,11 +131,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;
}