mirror of
https://github.com/Z3Prover/z3
synced 2025-06-29 09:28:45 +00:00
Fix popcnt64
This commit is contained in:
parent
add66973c5
commit
3586c288ec
3 changed files with 4 additions and 14 deletions
|
@ -75,8 +75,8 @@ namespace xr {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Separate xor constraints in multiple gaussian matrixes
|
// Assign xor constraints to (multiple) gaussian matrixes
|
||||||
// Two xor clauses have to belong to the same matrix if they share at least one variable
|
// If two xor clauses share variables, the clauses have to be together in at least one matrix
|
||||||
bool_var_vector newSet;
|
bool_var_vector newSet;
|
||||||
uint_set to_merge;
|
uint_set to_merge;
|
||||||
unsigned matrix_no = 0;
|
unsigned matrix_no = 0;
|
||||||
|
@ -147,18 +147,13 @@ namespace xr {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_xor.m_xorclauses.clear();
|
m_xor.m_xorclauses.clear();
|
||||||
|
|
||||||
for (auto& m: matrix_shapes)
|
|
||||||
if (m.tot_size() > 0)
|
|
||||||
m.m_density = (double)m.m_sum_xor_sizes / (double)(m.tot_size());
|
|
||||||
|
|
||||||
|
|
||||||
std::sort(matrix_shapes.begin(), matrix_shapes.end(), m_sorter);
|
std::sort(matrix_shapes.begin(), matrix_shapes.end(), m_sorter);
|
||||||
|
|
||||||
unsigned realMatrixNum = 0;
|
unsigned realMatrixNum = 0;
|
||||||
unsigned unusedMatrix = 0;
|
unsigned unusedMatrix = 0;
|
||||||
unsigned too_few_rows_matrix = 0;
|
unsigned too_few_rows_matrix = 0;
|
||||||
unsigned unused_matrix_printed = 0;
|
|
||||||
for (unsigned a = matrix_no; a-- > 0; ) {
|
for (unsigned a = matrix_no; a-- > 0; ) {
|
||||||
matrix_shape& m = matrix_shapes[a];
|
matrix_shape& m = matrix_shapes[a];
|
||||||
unsigned i = m.m_num;
|
unsigned i = m.m_num;
|
||||||
|
|
|
@ -36,11 +36,6 @@ namespace xr {
|
||||||
unsigned m_rows = 0;
|
unsigned m_rows = 0;
|
||||||
unsigned m_cols = 0;
|
unsigned m_cols = 0;
|
||||||
unsigned m_sum_xor_sizes = 0;
|
unsigned m_sum_xor_sizes = 0;
|
||||||
double m_density = 0;
|
|
||||||
|
|
||||||
uint64_t tot_size() const {
|
|
||||||
return (uint64_t)m_rows * (uint64_t)m_cols;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sorter {
|
struct sorter {
|
||||||
|
|
|
@ -135,7 +135,7 @@ static inline unsigned get_num_1bits(uint64_t v) {
|
||||||
v1 &= v1 - 1;
|
v1 &= v1 - 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
v = v - (v >> 1) & 0x5555555555555555;
|
v = v - ((v >> 1) & 0x5555555555555555);
|
||||||
v = (v & 0x3333333333333333) + ((v >> 2) & 0x3333333333333333);
|
v = (v & 0x3333333333333333) + ((v >> 2) & 0x3333333333333333);
|
||||||
v = (v + (v >> 4)) & 0x0F0F0F0F0F0F0F0F;
|
v = (v + (v >> 4)) & 0x0F0F0F0F0F0F0F0F;
|
||||||
uint64_t r = (v * 0x0101010101010101) >> 56;
|
uint64_t r = (v * 0x0101010101010101) >> 56;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue