Polly 20.0.0git
|
#include "gmp_compat.h"
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
Go to the source code of this file.
Macros | |
#define | CHECK(res) assert(((res) == MP_OK) && "expected MP_OK") |
#define | HOST_ENDIAN (*(signed char *)&endian_test) |
Functions | |
void GMPQAPI() | clear (mp_rat x) |
int GMPQAPI() | cmp (mp_rat op1, mp_rat op2) |
void GMPQAPI() | init (mp_rat x) |
void GMPQAPI() | mul (mp_rat product, mp_rat multiplier, mp_rat multiplicand) |
void GMPQAPI() | set (mp_rat rop, mp_rat op) |
void GMPZAPI() | abs (mp_int rop, mp_int op) |
void GMPZAPI() | add (mp_int rop, mp_int op1, mp_int op2) |
void GMPZAPI() | clear (mp_int x) |
int GMPZAPI() | cmp_si (mp_int op1, long op2) |
int GMPZAPI() | cmpabs (mp_int op1, mp_int op2) |
int GMPZAPI() | cmp (mp_int op1, mp_int op2) |
void GMPZAPI() | init (mp_int x) |
void GMPZAPI() | mul (mp_int rop, mp_int op1, mp_int op2) |
void GMPZAPI() | neg (mp_int rop, mp_int op) |
void GMPZAPI() | set_si (mp_int rop, long op) |
void GMPZAPI() | set (mp_int rop, mp_int op) |
void GMPZAPI() | sub (mp_int rop, mp_int op1, mp_int op2) |
void GMPZAPI() | swap (mp_int rop1, mp_int rop2) |
int GMPQAPI() | sgn (mp_rat op) |
int GMPZAPI() | sgn (mp_int op) |
void GMPQAPI() | set_ui (mp_rat rop, unsigned long op1, unsigned long op2) |
void GMPZAPI() | set_ui (mp_int rop, unsigned long op) |
mp_int GMPQAPI() | denref (mp_rat op) |
mp_int GMPQAPI() | numref (mp_rat op) |
void GMPQAPI() | canonicalize (mp_rat op) |
void GMPZAPI() | addmul (mp_int rop, mp_int op1, mp_int op2) |
void GMPZAPI() | divexact (mp_int q, mp_int n, mp_int d) |
int GMPZAPI() | divisible_p (mp_int n, mp_int d) |
void GMPZAPI() | submul (mp_int rop, mp_int op1, mp_int op2) |
void GMPZAPI() | add_ui (mp_int rop, mp_int op1, unsigned long op2) |
void GMPZAPI() | divexact_ui (mp_int q, mp_int n, unsigned long d) |
void GMPZAPI() | mul_ui (mp_int rop, mp_int op1, unsigned long op2) |
void GMPZAPI() | pow_ui (mp_int rop, mp_int base, unsigned long exp) |
void GMPZAPI() | sub_ui (mp_int rop, mp_int op1, unsigned long op2) |
void GMPZAPI() | gcd (mp_int rop, mp_int op1, mp_int op2) |
char *GMPZAPI() | get_str (char *str, int radix, mp_int op) |
char *GMPQAPI() | get_str (char *str, int radix, mp_rat op) |
int GMPZAPI() | set_str (mp_int rop, char *str, int base) |
int GMPQAPI() | set_str (mp_rat rop, char *s, int base) |
static unsigned long | get_long_bits (mp_int op) |
unsigned long GMPZAPI() | get_ui (mp_int op) |
long GMPZAPI() | get_si (mp_int op) |
void GMPZAPI() | lcm (mp_int rop, mp_int op1, mp_int op2) |
void GMPZAPI() | mul_2exp (mp_int rop, mp_int op1, unsigned long op2) |
void GMPZAPI() | cdiv_q (mp_int q, mp_int n, mp_int d) |
void GMPZAPI() | fdiv_q (mp_int q, mp_int n, mp_int d) |
void GMPZAPI() | fdiv_r (mp_int r, mp_int n, mp_int d) |
void GMPZAPI() | tdiv_q (mp_int q, mp_int n, mp_int d) |
unsigned long GMPZAPI() | fdiv_q_ui (mp_int q, mp_int n, unsigned long d) |
void *GMPZAPI() | export (void *rop, size_t *countp, int order, size_t size, int endian, size_t nails, mp_int op) |
void GMPZAPI() | import (mp_int rop, size_t count, int order, size_t size, int endian, size_t nails, const void *op) |
size_t GMPZAPI() | sizeinbase (mp_int op, int base) |
Variables | |
static const uint16_t | endian_test = 0x1FF |
Definition at line 43 of file imath/gmp_compat.c.
#define HOST_ENDIAN (*(signed char *)&endian_test) |
Definition at line 50 of file imath/gmp_compat.c.
Definition at line 75 of file imath/gmp_compat.c.
References CHECK, mp_int_abs, and op.
Referenced by error_string(), isl_sioimath_lcm(), main(), parse_int_values(), and parse_rat_values().
Definition at line 78 of file imath/gmp_compat.c.
References CHECK, and mp_int_add.
Referenced by collect_validity(), FN(), isl_schedule_band_replace_ast_build_option(), LIST(), and MULTI().
Definition at line 207 of file imath/gmp_compat.c.
References CHECK, mp_int_add, mp_int_clear, and mp_int_init_uvalue.
Definition at line 154 of file imath/gmp_compat.c.
References CHECK, mp_int_add, mp_int_clear, mp_int_init, and mp_int_mul.
Definition at line 146 of file imath/gmp_compat.c.
References CHECK, mp_rat_reduce, and op.
Definition at line 531 of file imath/gmp_compat.c.
References CHECK, mp_int_add_value, mp_int_clear, mp_int_compare_zero, mp_int_div, mp_int_init, mp_int_set_value, and n.
Definition at line 83 of file imath/gmp_compat.c.
References mp_int_clear.
Definition at line 58 of file imath/gmp_compat.c.
References mp_rat_clear.
Definition at line 96 of file imath/gmp_compat.c.
References mp_int_compare.
Definition at line 61 of file imath/gmp_compat.c.
References mp_rat_compare.
Referenced by before(), cmp_constraint(), cmp_ineq(), coscheduled(), drop_inequalities(), FN(), is_better_lower_bound(), isl_aff_plain_cmp(), isl_ast_graft_list_merge(), isl_basic_map_plain_cmp(), isl_basic_set_compare_at(), isl_constraint_cmp_last_non_zero(), isl_constraint_plain_cmp(), isl_id_cmp(), isl_local_cmp(), isl_local_space_cmp(), isl_merge_divs(), isl_multi_aff_order_at(), isl_poly_cmp(), isl_poly_plain_cmp(), isl_pw_aff_plain_cmp(), isl_qpolynomial_fold_plain_cmp(), isl_qpolynomial_plain_cmp(), isl_seq_cmp(), isl_set_plain_cmp(), isl_sioimath_is_divisible_by(), isl_sort(), isl_space_cmp(), isl_space_cmp_type(), isl_val_cmp_si(), mp_int_add(), mp_int_compare(), mp_int_compare_value(), mp_int_div(), mp_int_sub(), mp_int_to_string(), mp_rat_compare(), mp_rat_compare_unsigned(), mp_rat_to_decimal(), needs_invert(), S(), select_shared_inequalities(), sort_constraint_cmp(), sort_divs(), and test_eval_1().
Definition at line 86 of file imath/gmp_compat.c.
References mp_int_compare_value.
Definition at line 91 of file imath/gmp_compat.c.
References mp_int_compare_unsigned.
Definition at line 140 of file imath/gmp_compat.c.
References mp_rat_denom_ref, and op.
Definition at line 166 of file imath/gmp_compat.c.
References CHECK, mp_int_div, and n.
Definition at line 219 of file imath/gmp_compat.c.
References CHECK, mp_int_clear, mp_int_div, mp_int_init_uvalue, and n.
Definition at line 173 of file imath/gmp_compat.c.
References CHECK, mp_int_clear, mp_int_compare_zero, mp_int_div, mp_int_init, and n.
void *GMPZAPI() export | ( | void * | rop, |
size_t * | countp, | ||
int | order, | ||
size_t | size, | ||
int | endian, | ||
size_t | nails, | ||
mp_int | op | ||
) |
Definition at line 655 of file imath/gmp_compat.c.
References assert, HOST_ENDIAN, MP_DIGIT_BIT, MP_DIGITS(), mp_int_compare_zero, mp_int_unsigned_len, op, and size.
Definition at line 562 of file imath/gmp_compat.c.
References CHECK, mp_int_clear, mp_int_compare_zero, mp_int_div, mp_int_init, mp_int_set_value, mp_int_sub_value, and n.
Referenced by fdiv_q_ui(), and fdiv_r().
Definition at line 629 of file imath/gmp_compat.c.
References CHECK, fdiv_q(), fdiv_r(), GMPZAPI, mp_int_clear, mp_int_init, mp_int_init_copy, mp_int_init_uvalue, mp_int_to_uint, and n.
Definition at line 593 of file imath/gmp_compat.c.
References CHECK, fdiv_q(), GMPZAPI, mp_int_clear, mp_int_init, mp_int_init_copy, mp_int_mul, mp_int_sub, and n.
Referenced by fdiv_q_ui().
Definition at line 276 of file imath/gmp_compat.c.
References CHECK, mp_int_compare_zero, mp_int_gcd, and mp_int_zero.
Referenced by add_expanded(), add_parametric_cut(), add_strides(), detect_stride(), generate_component(), is_strict(), isl_aff_scale(), isl_aff_scale_down(), isl_basic_map_normalize_constraints(), isl_mat_gcd(), isl_mat_normalize(), isl_mat_row_gcd(), isl_poly_cst_reduce(), isl_seq_gcd(), pw_multi_aff_from_map_check_strides(), pw_multi_aff_from_map_stride(), reduce_stride_constraints(), s_rat_reduce(), split_scaled(), and update_coeff().
|
static |
Definition at line 390 of file imath/gmp_compat.c.
References MP_DIGIT_BIT, MP_DIGITS(), MP_USED(), and op.
Definition at line 435 of file imath/gmp_compat.c.
References CHECK, get_long_bits(), mp_int_to_int, MP_NEG, MP_OK, MP_RANGE, MP_SIGN(), op, and res.
Definition at line 289 of file imath/gmp_compat.c.
References CHECK, mp_int_string_len, mp_int_to_string, op, and str.
Referenced by get_str().
Definition at line 317 of file imath/gmp_compat.c.
References CHECK, get_str(), GMPZAPI, mp_int_compare_value, mp_rat_denom_ref, mp_rat_numer_ref, mp_rat_string_len, mp_rat_to_string, op, and str.
Definition at line 419 of file imath/gmp_compat.c.
References CHECK, get_long_bits(), mp_int_to_uint, MP_OK, MP_RANGE, op, and res.
void GMPZAPI() import | ( | mp_int | rop, |
size_t | count, | ||
int | order, | ||
size_t | size, | ||
int | endian, | ||
size_t | nails, | ||
const void * | op | ||
) |
Definition at line 734 of file imath/gmp_compat.c.
References assert, count(), mpz_t::digits, HOST_ENDIAN, MP_DIGIT_BIT, MP_DIGITS(), mp_int_clear, mp_int_copy, mp_int_init_size, op, size, and mpz_t::used.
Definition at line 99 of file imath/gmp_compat.c.
References CHECK, and mp_int_init.
Definition at line 64 of file imath/gmp_compat.c.
References CHECK, and mp_rat_init.
Referenced by basic_map_collect_diff(), basic_map_partial_lexopt_base_sol(), enter_level(), foreach_iteration(), isl_basic_set_compute_vertices(), isl_basic_set_scan(), isl_tab_basic_set_non_trivial_lexmin(), isl_tab_sample(), refine_degenerate(), and set_for_node_expressions().
Definition at line 466 of file imath/gmp_compat.c.
References CHECK, mp_int_abs, mp_int_compare_zero, mp_int_lcm, and mp_int_zero.
Referenced by add_vertex(), isl_seq_lcm(), and isl_vec_lcm().
Definition at line 102 of file imath/gmp_compat.c.
References CHECK, and mp_int_mul.
Definition at line 67 of file imath/gmp_compat.c.
References CHECK, and mp_rat_mul.
Referenced by arctan().
Definition at line 481 of file imath/gmp_compat.c.
References CHECK, mp_int_compare_zero, mp_int_mul_pow2, and mp_int_zero.
Definition at line 230 of file imath/gmp_compat.c.
References CHECK, mp_int_clear, mp_int_init_uvalue, and mp_int_mul.
Definition at line 107 of file imath/gmp_compat.c.
References CHECK, mp_int_neg, and op.
Referenced by add_bound_from_constraint(), constant_is_considered_positive(), extract_modulos(), FN(), isl_aff_div(), isl_basic_map_drop_redundant_divs_ineq(), isl_basic_map_is_div_constraint(), isl_local_space_is_div_constraint(), isl_mat_left_hermite(), isl_printer_print_val(), isl_set_split_dims(), isl_val_pow2(), neg_halfspace(), poly_print_cst(), propagate_on_bound_pair(), set_for_cond_from_list(), and set_max_constant_term().
Definition at line 143 of file imath/gmp_compat.c.
References mp_rat_numer_ref, and op.
Definition at line 242 of file imath/gmp_compat.c.
References CHECK, mp_int_clear, mp_int_compare_zero, mp_int_expt_full, mp_int_init_uvalue, and mp_int_set_value.
Definition at line 113 of file imath/gmp_compat.c.
References CHECK, mp_int_copy, and op.
Definition at line 72 of file imath/gmp_compat.c.
References CHECK, mp_rat_copy, and op.
Definition at line 110 of file imath/gmp_compat.c.
References CHECK, mp_int_set_value, and op.
Definition at line 350 of file imath/gmp_compat.c.
References mp_int_read_string, MP_OK, res, and str.
Definition at line 356 of file imath/gmp_compat.c.
References mp_int_read_string, mp_int_set_uvalue, MP_OK, mp_rat_denom_ref, mp_rat_numer_ref, res, and str.
Definition at line 135 of file imath/gmp_compat.c.
References CHECK, mp_int_set_uvalue, and op.
Definition at line 130 of file imath/gmp_compat.c.
References CHECK, and mp_rat_set_uvalue.
Definition at line 127 of file imath/gmp_compat.c.
References mp_int_compare_zero, and op.
Definition at line 124 of file imath/gmp_compat.c.
References mp_rat_compare_zero, and op.
Referenced by basic_map_dim_is_bounded(), can_select(), check_samples(), con_is_redundant(), cut_to_hyperplane(), find_pivot(), find_solutions(), get_rounded_sample_value(), isl_printer_print_val(), isl_qpolynomial_aff_sign(), isl_qpolynomial_sign(), isl_tab_add_eq(), isl_tab_add_ineq(), isl_tab_cone_is_bounded(), isl_tab_detect_implicit_equalities(), isl_tab_pivot(), merge_lists(), pivot_row(), poly_print_cst(), qpolynomial_fold_covers_on_domain(), reached(), tab_has_valid_sample(), tab_ineq_sign(), unrelax(), and var_reaches().
Definition at line 802 of file imath/gmp_compat.c.
References CHECK, mp_int_compare_zero, mp_int_string_len, MP_OK, op, res, and size.
Definition at line 116 of file imath/gmp_compat.c.
References CHECK, and mp_int_sub.
Referenced by add_sub_equalities(), contains(), copy_edge(), drop_occurrence(), drop_underscore_occurrence(), generator::find_superclasses(), FN(), identity_on_parameters(), isl_scc_graph_sub(), isl_sched_graph_extract_sub_graph(), monotonicity(), plug_in_at_pos(), cpp_generator::class_printer::print_descendent_overloads(), propagate_on_bound_pair(), recurse(), update_sub(), and update_sub_base().
Definition at line 259 of file imath/gmp_compat.c.
References CHECK, mp_int_clear, mp_int_init_uvalue, and mp_int_sub.
Definition at line 195 of file imath/gmp_compat.c.
References CHECK, mp_int_clear, mp_int_init, mp_int_mul, and mp_int_sub.
Definition at line 121 of file imath/gmp_compat.c.
References mp_int_swap.
Referenced by isl_basic_map_gauss5().
Definition at line 623 of file imath/gmp_compat.c.
References CHECK, mp_int_div, and n.
|
static |
Definition at line 49 of file imath/gmp_compat.c.