24 #include "ppl-config.h"
53 #if PPL_CAN_CONTROL_FPU \
54 && defined(PPL_ARM_CAN_CONTROL_FPU) && PPL_ARM_CAN_CONTROL_FPU
58 float nf1 = -3, pf1 = 3, f2 = 5;
59 double nd1 = -7, pd1 = 7, d2 = 11;
60 long double nl1 = -13, pl1 = 13, l2 = 17;
64 long double nl[2], pl[2];
67 ppl_check_function() {
69 if (nf[0] == nf[1] || pf[0] == pf[1] || -nf[0] != pf[1] || -nf[1] != pf[0]) {
72 if (nd[0] == nd[1] || pd[0] == pd[1] || -nd[0] != pd[1] || -nd[1] != pd[0]) {
75 if (nl[0] == nl[1] || pl[0] == pl[1] || -nl[0] != pl[1] || -nl[1] != pl[0]) {
82 ppl_setround_function(
int rounding_mode) {
83 return fesetround(rounding_mode);
90 namespace Implementation {
92 int (*
volatile ppl_check_function_p)() = ppl_check_function;
93 int (*
volatile ppl_setround_function_p)(
int) = ppl_setround_function;
102 ppl_test_rounding() {
103 if ((*ppl_setround_function_p)(FE_DOWNWARD) != 0) {
114 if ((*ppl_setround_function_p)(FE_UPWARD) != 0) {
125 return (*ppl_check_function_p)();
130 #endif // PPL_CAN_CONTROL_FPU
157 #if PPL_HAVE_DECL_SETITIMER && PPL_HAVE_DECL_SIGACTION
160 #endif // PPL_HAVE_DECL_SETITIMER && PPL_HAVE_DECL_SIGACTION
162 #if PPL_CAN_CONTROL_FPU
169 #if defined(PPL_ARM_CAN_CONTROL_FPU) && PPL_ARM_CAN_CONTROL_FPU
170 if (ppl_test_rounding() != 0) {
171 throw std::logic_error(
"PPL configuration error:"
172 " PPL_ARM_CAN_CONTROL_FPU evaluates to true,"
173 " but rounding does not work.");
175 #endif // defined(PPL_ARM_CAN_CONTROL_FPU) && PPL_ARM_CAN_CONTROL_FPU
177 #endif // PPL_CAN_CONTROL_FPU
188 #if PPL_CAN_CONTROL_FPU
193 #if PPL_HAVE_DECL_SETITIMER && PPL_HAVE_DECL_SIGACTION
196 #endif // PPL_HAVE_DECL_SETITIMER && PPL_HAVE_DECL_SIGACTION
220 namespace Implementation {
230 if (Parma_Polyhedra_Library_initializer_p == 0) {
231 Parma_Polyhedra_Library_initializer_p =
new Init();
237 PPL_ASSERT(Parma_Polyhedra_Library_initializer_p != 0);
238 delete Parma_Polyhedra_Library_initializer_p;
239 Parma_Polyhedra_Library_initializer_p = 0;
static unsigned int count
Count the number of objects created.
void Coefficient_constants_finalize()
Finalizes the Coefficient constants.
static void initialize()
Initializes the class.
fpu_rounding_direction_type
~Init()
Finalizes the PPL.
static void initialize()
Initializes the class.
static void finalize()
Finalizes the class.
static const unsigned DEFAULT_IRRATIONAL_PRECISION
Default precision parameter used for irrational calculations.
void set_irrational_precision(const unsigned p)
Sets the precision parameter used for irrational calculations.
void Coefficient_constants_initialize()
Initializes the Coefficient constants.
fpu_rounding_direction_type fpu_get_rounding_direction()
Returns the current FPU rounding direction.
static void initialize()
Initializes the class.
static void finalize()
Finalizes the class.
static void finalize()
Finalizes the class.
fpu_rounding_direction_type round_fpu_dir(Rounding_Dir dir)
static void initialize()
Initializes the class.
void finalize()
Finalizes the library.
static void initialize()
Initializes the class.
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir unsigned int
static void default_output_function(std::ostream &s, const Variable v)
The default output function.
static void finalize()
Finalizes the class.
Class for initialization and finalization.
Init()
Initializes the PPL.
static void finalize()
Finalizes the class.
static void finalize()
Finalizes the class.
void initialize()
Initializes the library.
static fpu_rounding_direction_type old_rounding_direction
The entire library is confined to this namespace.
static void finalize()
Finalizes the class.
void fpu_initialize_control_functions()
Initializes the FPU control functions.
static void finalize()
Finalizes the class.
void ppl_set_GMP_memory_allocation_functions(void)
static void finalize()
Finalizes the class.
static void initialize()
Initializes the class.
static void initialize()
Initializes the class.
static void initialize()
Initializes the class.
static void set_output_function(output_function_type *p)
Sets the output function to be used for printing Variable objects.
void fpu_set_rounding_direction(fpu_rounding_direction_type dir)
Sets the FPU rounding direction to dir.
static void initialize()
Initializes the class.
static void initialize()
Initializes the class.
static void finalize()
Finalizes the class.