mirror of
https://github.com/Z3Prover/z3
synced 2026-07-19 21:45:49 +00:00
Merge master branch and resolve conflicts
- Resolved conflict in src/test/memory.cpp: Accept const qualifier on catch - Resolved conflict in src/util/mpz.h: Keep HEAD's 64-bit digit handling - Resolved conflict in src/util/mpz.cpp: Combine ptr() method with fdiv fix - Resolved conflict in src/util/mpz.cpp: Adapt hash function for 64-bit values
This commit is contained in:
parent
dcf81a2592
commit
468a1cb658
3 changed files with 7 additions and 31 deletions
|
|
@ -39,11 +39,7 @@ static void hit_me(char const* wm) {
|
|||
Z3_mk_bv_sort(ctx,i);
|
||||
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
catch (std::bad_alloc&) {
|
||||
=======
|
||||
catch (const std::bad_alloc&) {
|
||||
>>>>>>> origin/master
|
||||
std::cout << "caught\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -601,11 +601,7 @@ mpz mpz_manager<SYNCH>::mod2k(mpz const & a, unsigned k) {
|
|||
ensure_mpz_t a1(a);
|
||||
mk_big(result);
|
||||
MPZ_BEGIN_CRITICAL();
|
||||
<<<<<<< HEAD
|
||||
mpz_tdiv_r_2exp(*result.ptr(), a1(), k);
|
||||
=======
|
||||
mpz_fdiv_r_2exp(*result.m_ptr, a1(), k);
|
||||
>>>>>>> origin/master
|
||||
mpz_fdiv_r_2exp(*result.ptr(), a1(), k);
|
||||
MPZ_END_CRITICAL();
|
||||
#endif
|
||||
STRACE(mpz, tout << to_string(result) << '\n';);
|
||||
|
|
@ -1763,16 +1759,14 @@ std::string mpz_manager<SYNCH>::to_string(mpz const & a) const {
|
|||
|
||||
template<bool SYNCH>
|
||||
unsigned mpz_manager<SYNCH>::hash(mpz const & a) {
|
||||
<<<<<<< HEAD
|
||||
if (is_small(a))
|
||||
return ::abs(a.value());
|
||||
=======
|
||||
if (is_small(a)) {
|
||||
// compute abs in unsigned arithmetic: ::abs(INT_MIN) is undefined
|
||||
unsigned u = static_cast<unsigned>(a.m_val);
|
||||
return a.m_val < 0 ? 0u - u : u;
|
||||
// compute abs in unsigned arithmetic to avoid undefined behavior with INT_MIN
|
||||
int64_t val = a.value();
|
||||
uint64_t u = static_cast<uint64_t>(val);
|
||||
uint64_t abs_val = val < 0 ? 0u - u : u;
|
||||
// For 64-bit values, combine high and low 32 bits for better hash distribution
|
||||
return static_cast<unsigned>(abs_val) ^ static_cast<unsigned>(abs_val >> 32);
|
||||
}
|
||||
>>>>>>> origin/master
|
||||
#ifndef _MP_GMP
|
||||
unsigned sz = size(a);
|
||||
if (sz == 1)
|
||||
|
|
|
|||
|
|
@ -385,23 +385,9 @@ class mpz_manager {
|
|||
cell->m_digits[0] = static_cast<digit_t>(abs_val);
|
||||
}
|
||||
else {
|
||||
<<<<<<< HEAD
|
||||
cell->m_digits[0] = static_cast<unsigned>(abs_val);
|
||||
cell->m_digits[1] = static_cast<unsigned>(abs_val >> 32);
|
||||
cell->m_size = (abs_val >> 32) == 0 ? 1 : 2;
|
||||
=======
|
||||
cell = reserve;
|
||||
cell->m_size = 1;
|
||||
digit_t* cell_digits = reinterpret_cast<digit_t*>(cell + 1);
|
||||
if (a.value() < 0) {
|
||||
sign = -1;
|
||||
cell_digits[0] = -a.value();
|
||||
}
|
||||
else {
|
||||
sign = 1;
|
||||
cell_digits[0] = a.value();
|
||||
}
|
||||
>>>>>>> origin/master
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue