3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

Merge branch 'master' into intel-compiler

This commit is contained in:
Nikolaj Bjorner 2018-10-02 11:54:52 -07:00 committed by GitHub
commit 69f35a2970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 420 additions and 464 deletions

View file

@ -45,7 +45,7 @@ Revision History:
// For SSE2, it is best to use compiler intrinsics because this makes it completely
// clear to the compiler what instructions should be used. E.g., for sqrt(), the Windows compiler selects
// the x87 FPU, even when /arch:SSE2 is on.
// Luckily, these are kind of standardized, at least for Windows/Linux/OSX.
// Luckily, these are kind of standardized, at least for Windows/Linux/macOS.
#ifdef __clang__
#undef USE_INTRINSICS
#endif
@ -75,14 +75,14 @@ hwf_manager::hwf_manager() :
#endif
#endif
#else
// OSX/Linux: Nothing.
// macOS/Linux: Nothing.
#endif
// We only set the precision of the FPU here in the constructor. At the moment, there are no
// other parts of the code that could overwrite this, and Windows takes care of context switches.
// CMW: I'm not sure what happens on CPUs with hyper-threading (since the FPU is shared).
// I have yet to discover whether Linux and OSX save the FPU state when switching context.
// I have yet to discover whether Linux and macOS save the FPU state when switching context.
// As long as we stick to using the SSE2 FPU though, there shouldn't be any problems with respect
// to the precision (not sure about the rounding modes though).
}
@ -279,7 +279,7 @@ void hwf_manager::fma(mpf_rounding_mode rm, hwf const & x, hwf const & y, hwf co
#endif
#endif
#else
// Linux, OSX
// Linux, macOS
o.value = ::fma(x.value, y.value, z.value);
#endif
#endif
@ -331,7 +331,7 @@ void hwf_manager::round_to_integral(mpf_rounding_mode rm, hwf const & x, hwf & o
}
#endif
#else
// Linux, OSX.
// Linux, macOS.
o.value = nearbyint(x.value);
#endif
}
@ -623,7 +623,7 @@ void hwf_manager::set_rounding_mode(mpf_rounding_mode rm)
UNREACHABLE(); // Note: MPF_ROUND_NEAREST_TAWAY is not supported by the hardware!
}
#endif
#else // OSX/Linux
#else // macOS/Linux
switch (rm) {
case MPF_ROUND_NEAREST_TEVEN:
SETRM(FE_TONEAREST);

View file

@ -817,7 +817,7 @@ public:
}
const bool column_is_bounded(unsigned j) const {
bool column_is_bounded(unsigned j) const {
switch(m_column_types()[j]) {
case column_type::fixed:
case column_type::boxed:

View file

@ -397,7 +397,7 @@ public:
column_type get_column_type(unsigned j) const;
std::string get_column_name(unsigned j) const;
std::string get_column_name(unsigned j) const override;
bool all_constrained_variables_are_registered(const vector<std::pair<mpq, var_index>>& left_side);

View file

@ -84,6 +84,7 @@ template lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::lp_core_s
const vector<lp::numeric_pair<lp::mpq> >&);
template bool lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::print_statistics_with_cost_and_check_that_the_time_is_over(lp::numeric_pair<lp::mpq>, std::ostream&);
template void lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::snap_xN_to_bounds_and_fill_xB();
template void lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_Ax_eq_b();
template void lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_Bd(unsigned int);
template bool lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::update_basis_and_x(int, int, lp::numeric_pair<lp::mpq> const&);
template void lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::update_x(unsigned int, const lp::numeric_pair<lp::mpq>&);

View file

@ -154,7 +154,7 @@ namespace nra {
polynomial::polynomial* ps[1] = { p };
bool even[1] = { false };
nlsat::literal lit = m_nlsat->mk_ineq_literal(nlsat::atom::kind::EQ, 1, ps, even);
m_nlsat->mk_clause(1, &lit, 0);
m_nlsat->mk_clause(1, &lit, nullptr);
}
void add_constraint(unsigned idx) {

View file

@ -57,10 +57,10 @@ public:
template <> class numeric_traits<int> {
public:
static bool precise() { return true; }
static int const zero() { return 0; }
static int const one() { return 1; }
static int zero() { return 0; }
static int one() { return 1; }
static bool is_zero(int v) { return v == 0; }
static double const get_double(int const & d) { return d; }
static double get_double(int const & d) { return d; }
static bool is_int(int) {return true;}
static bool is_pos(int j) {return j > 0;}
static bool is_neg(int j) {return j < 0;}

View file

@ -27,6 +27,7 @@ Revision History:
# define __has_builtin(x) 0
#endif
#ifdef __GNUC__
# if ((__GNUC__ * 100 + __GNUC_MINOR__) >= 409 || __has_builtin(returns_nonnull)) && !defined(__INTEL_COMPILER)
# define GCC_RET_NON_NULL __attribute__((returns_nonnull))

View file

@ -115,7 +115,7 @@ public:
*/
T * steal() {
T * r = m_obj;
m_obj = 0;
m_obj = nullptr;
return r;
}
};

View file

@ -27,7 +27,7 @@ Revision History:
// Windows
#include<windows.h>
#elif defined(__APPLE__) && defined(__MACH__)
// Mac OS X
// macOS
#include<mach/mach.h>
#include<mach/clock.h>
#include<sys/time.h>
@ -59,7 +59,7 @@ struct scoped_timer::imp {
HANDLE m_timer;
bool m_first;
#elif defined(__APPLE__) && defined(__MACH__)
// Mac OS X
// macOS
pthread_t m_thread_id;
pthread_attr_t m_attributes;
unsigned m_interval;
@ -89,7 +89,7 @@ struct scoped_timer::imp {
}
}
#elif defined(__APPLE__) && defined(__MACH__)
// Mac OS X
// macOS
static void * thread_func(void * arg) {
scoped_timer::imp * st = static_cast<scoped_timer::imp*>(arg);
@ -153,7 +153,7 @@ struct scoped_timer::imp {
ms,
WT_EXECUTEINTIMERTHREAD);
#elif defined(__APPLE__) && defined(__MACH__)
// Mac OS X
// macOS
m_interval = ms?ms:0xFFFFFFFF;
if (pthread_attr_init(&m_attributes) != 0)
throw default_exception("failed to initialize timer thread attributes");
@ -194,7 +194,7 @@ struct scoped_timer::imp {
m_timer,
INVALID_HANDLE_VALUE);
#elif defined(__APPLE__) && defined(__MACH__)
// Mac OS X
// macOS
// If the waiting-thread is not up and waiting yet,
// we can make sure that it finishes quickly by

View file

@ -70,7 +70,7 @@ public:
#undef min
#elif defined(__APPLE__) && defined (__MACH__) // Mac OS X
#elif defined(__APPLE__) && defined (__MACH__) // macOS
#include<mach/mach.h>
#include<mach/clock.h>