Prefixed the big_register* functions with _ecl_

parent 1fb5504a
......@@ -16,6 +16,16 @@ ECL 9.9.1:
numbers. These functions have been made aware of the fact that GMP may
use other allocation routines and always call mpz_clear() to free memory.
- The internal functions dealing with bignums have been renamed with the usual
prefix "_ecl", and some of them have been turned into macros. Do not use
those functions if possible.
- A new compiler macro ECL_NO_LEGACY can be defined to remove all deprecated
macros and functions. Have a look at the end of src/h/external.h to see
what functions are deprecated on each release -- typically they are functions
that have been renamed with one of the prefixes, ecl_, cl_, si_, ext_ or _ecl.
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***
......
......@@ -9,7 +9,7 @@ VPATH = @[email protected]
#
TRUE_CC = @[email protected]
CC = @[email protected]
CFLAGS = -I. -I@[email protected] -I$(srcdir) -I../ecl/gc -DECL_API \
CFLAGS = -I. -I@[email protected] -I$(srcdir) -I../ecl/gc -DECL_API -DECL_NO_LEGACY \
@[email protected] @[email protected] @[email protected] -c \
# -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align \
# -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-prototypes -Wredundant-decls \
......
......@@ -566,8 +566,8 @@ si_gc_stats(cl_object enable)
#endif
}
@(return
big_register_normalize(cl_core.bytes_consed)
big_register_normalize(cl_core.gc_counter)
_ecl_big_register_normalize(cl_core.bytes_consed)
_ecl_big_register_normalize(cl_core.gc_counter)
old_status)
}
......
......@@ -26,38 +26,8 @@
* need big_set_ui() for some stupid code where the register is used
* uninitialized. */
#if 0
#undef big_register0_get
#undef big_register1_get
#undef big_register2_get
cl_object
big_register0_get()
{
cl_object x = cl_env.big_register[0];
big_set_ui(x, 0);
return x;
}
cl_object
big_register1_get()
{
cl_object x = cl_env.big_register[1];
big_set_ui(x, 0);
return x;
}
cl_object
big_register2_get()
{
cl_object x = cl_env.big_register[2];
big_set_ui(x, 0);
return x;
}
#endif
void
big_register_free(cl_object x)
_ecl_big_register_free(cl_object x)
{
/* We only need to free the integer when it gets too large */
if (x->big.big_dim > 3 * ECL_BIG_REGISTER_SIZE) {
......@@ -65,8 +35,8 @@ big_register_free(cl_object x)
}
}
cl_object
big_copy(cl_object old)
static cl_object
_ecl_big_copy(cl_object old)
{
cl_object new_big = ecl_alloc_object(t_bignum);
cl_fixnum dim, bytes;
......@@ -81,15 +51,15 @@ big_copy(cl_object old)
}
cl_object
big_register_copy(cl_object old)
_ecl_big_register_copy(cl_object old)
{
cl_object new_big = big_copy(old);
big_register_free(old);
cl_object new_big = _ecl_big_copy(old);
_ecl_big_register_free(old);
return new_big;
}
cl_object
big_register_normalize(cl_object x)
_ecl_big_register_normalize(cl_object x)
{
int s = x->big.big_size;
if (s == 0)
......@@ -103,15 +73,15 @@ big_register_normalize(cl_object x)
if (y <= -MOST_NEGATIVE_FIXNUM)
return MAKE_FIXNUM(-y);
}
return big_register_copy(x);
return _ecl_big_register_copy(x);
}
cl_object
bignum1(cl_fixnum val)
{
cl_object aux = big_register0_get();
cl_object aux = _ecl_big_register0();
mpz_init_set_si(aux->big.big_num, val);
return big_register_copy(aux);
return _ecl_big_register_copy(aux);
}
/*
......
......@@ -16,35 +16,11 @@
#include <ecl/ecl.h>
#include <ecl/internal.h>
cl_object
big_register0_get()
{
cl_object x = cl_env.big_register[0];
big_set_ui(x, 0);
return x;
}
cl_object
big_register1_get()
{
cl_object x = cl_env.big_register[1];
big_set_ui(x, 0);
return x;
}
cl_object
big_register2_get()
{
cl_object x = cl_env.big_register[2];
big_set_ui(x, 0);
return x;
}
void
big_register_free(cl_object x) {}
_ecl_big_register_free(cl_object x) {}
cl_object
big_register_copy(cl_object old)
_ecl_big_register_copy(cl_object old)
{
cl_object new_big = ecl_alloc_object(t_bignum);
new_big->big.big_num = old->big.big_num;
......@@ -52,13 +28,13 @@ big_register_copy(cl_object old)
}
cl_object
big_register_normalize(cl_object x)
_ecl_big_register_normalize(cl_object x)
{
if (x->big.big_num == 0ll)
return(MAKE_FIXNUM(0));
if (x->big.big_num <= MOST_POSITIVE_FIXNUM && x->big.big_num >= MOST_NEGATIVE_FIXNUM)
return(MAKE_FIXNUM(x->big.big_num));
return big_register_copy(x);
return _ecl_big_register_copy(x);
}
static cl_object
......@@ -79,41 +55,21 @@ bignum1(cl_fixnum val)
return(z);
}
cl_object
bignum2(cl_fixnum hi, cl_fixnum lo)
{
cl_object z;
z = big_alloc(2);
z->big.big_num = hi<<32 + lo;
return(z);
}
cl_object
big_copy(cl_object x)
static cl_object
_ecl_big_copy(cl_object x)
{
volatile cl_object y = ecl_alloc_object(t_bignum);
y->big.big_num = x->big.big_num;
return(y);
return y;
}
int big_num_t_sgn(big_num_t x)
int
_ecl_big_num_t_sgn(big_num_t x)
{
return ( x == (big_num_t)0 ) ? 0 : (x < (big_num_t)0) ? -1 : 1;
}
void init_big_registers(void)
{
int i;
for (i = 0; i < 3; i++) {
cl_env.big_register[i] = ecl_alloc_object(t_bignum);
cl_env.big_register[i]->big.big_num = 0ll;
}
}
void
init_big(void)
{
init_big_registers();
}
......@@ -4731,7 +4731,7 @@ ecl_off_t_to_integer(ecl_off_t offset)
} else if (offset <= MOST_POSITIVE_FIXNUM) {
output = MAKE_FIXNUM((cl_fixnum)offset);
} else {
cl_object y = big_register0_get();
cl_object y = _ecl_big_register0();
#ifdef WITH_GMP
if (sizeof(y->big.big_limbs[0]) == sizeof(cl_index)) {
y->big.big_limbs[0] = (cl_index)offset;
......@@ -4745,7 +4745,7 @@ ecl_off_t_to_integer(ecl_off_t offset)
#else
y->big.big_num = offset;
#endif
output = big_register_normalize(y);
output = _ecl_big_register_normalize(y);
}
return output;
}
......
......@@ -266,7 +266,7 @@ _ecl_dealloc_env(cl_env_ptr env)
*/
int i;
for (i = 0; i < 3; i++) {
big_clear(env->big_register[i]);
_ecl_big_clear(env->big_register[i]);
}
#if defined(ECL_USE_MPROTECT)
if (munmap(env, sizeof(*env)))
......
......@@ -34,10 +34,10 @@
cl_object
fixnum_times(cl_fixnum i, cl_fixnum j)
{
cl_object x = big_register0_get();
cl_object x = _ecl_big_register0();
big_set_si(x, i);
big_mul_si(x, x, j);
return big_register_normalize(x);
return _ecl_big_register_normalize(x);
}
static cl_object
......@@ -47,22 +47,22 @@ big_times_fix(cl_object b, cl_fixnum i)
if (i == 1)
return b;
z = big_register0_get();
z = _ecl_big_register0();
if (i == -1) {
big_complement(z, b);
} else {
big_mul_si(z, b, i);
}
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
}
static cl_object
big_times_big(cl_object x, cl_object y)
{
cl_object z;
z = big_register0_get();
z = _ecl_big_register0();
big_mul(z, x, y);
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
}
cl_object
......@@ -305,12 +305,12 @@ ecl_plus(cl_object x, cl_object y)
case t_bignum:
if ((i = fix(x)) == 0)
return(y);
z = big_register0_get();
z = _ecl_big_register0();
if (i > 0)
big_add_ui(z, y, i);
else
big_sub_ui(z, y, -i);
z = big_register_normalize(z);
z = _ecl_big_register_normalize(z);
return(z);
case t_ratio:
z = ecl_times(x, y->ratio.den);
......@@ -341,16 +341,16 @@ ecl_plus(cl_object x, cl_object y)
case t_fixnum:
if ((j = fix(y)) == 0)
return(x);
z = big_register0_get();
z = _ecl_big_register0();
if (j > 0)
big_add_ui(z, x, j);
else
big_sub_ui(z, x, (-j));
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
case t_bignum:
z = big_register0_get();
z = _ecl_big_register0();
big_add(z, x, y);
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
case t_ratio:
z = ecl_times(x, y->ratio.den);
z = ecl_plus(z, y->ratio.num);
......@@ -540,14 +540,14 @@ ecl_minus(cl_object x, cl_object y)
else
return bignum1(k);
case t_bignum:
z = big_register0_get();
z = _ecl_big_register0();
i = fix(x);
if (i > 0)
big_sub_ui(z, y, i);
else
big_add_ui(z, y, -i);
big_complement(z, z);
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
case t_ratio:
z = ecl_times(x, y->ratio.den);
z = ecl_minus(z, y->ratio.num);
......@@ -574,16 +574,16 @@ ecl_minus(cl_object x, cl_object y)
case t_fixnum:
if ((j = fix(y)) == 0)
return(x);
z = big_register0_get();
z = _ecl_big_register0();
if (j > 0)
big_sub_ui(z, x, j);
else
big_add_ui(z, x, -j);
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
case t_bignum:
z = big_register0_get();
z = _ecl_big_register0();
big_sub(z, x, y);
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
case t_ratio:
z = ecl_times(x, y->ratio.den);
z = ecl_minus(z, y->ratio.num);
......@@ -788,9 +788,9 @@ ecl_negate(cl_object x)
}
}
case t_bignum:
z = big_register0_get();
z = _ecl_big_register0();
big_complement(z, x);
return big_register_normalize(z);
return _ecl_big_register_normalize(z);
case t_ratio:
z1 = ecl_negate(x->ratio.num);
......@@ -1058,7 +1058,7 @@ ecl_integer_divide(cl_object x, cl_object y)
FEtype_error_integer(y);
}
if (tx == t_bignum) {
cl_object q = big_register0_get();
cl_object q = _ecl_big_register0();
if (ty == t_bignum) {
big_tdiv_q(q, x, y);
} else if (ty == t_fixnum) {
......@@ -1069,7 +1069,7 @@ ecl_integer_divide(cl_object x, cl_object y)
} else {
FEtype_error_integer(y);
}
return big_register_normalize(q);
return _ecl_big_register_normalize(q);
}
FEtype_error_integer(x);
}
......@@ -1128,7 +1128,7 @@ ecl_gcd(cl_object x, cl_object y)
case t_fixnum:
y = bignum1(fix(y));
case t_bignum:
gcd = big_register0_get();
gcd = _ecl_big_register0();
#ifdef WITH_GMP
mpz_gcd(gcd->big.big_num, x->big.big_num, y->big.big_num); /* FIXME!!! */
#else /* WITH_GMP */
......@@ -1151,7 +1151,7 @@ ecl_gcd(cl_object x, cl_object y)
}
}
#endif /* WITH_GMP */
return big_register_normalize(gcd);
return _ecl_big_register_normalize(gcd);
default:
FEtype_error_integer(y);
}
......
......@@ -226,18 +226,18 @@ ecl_floor2(cl_object x, cl_object y)
* x = MOST_NEGATIVE_FIXNUM
* y = - MOST_NEGATIVE_FIXNUM
*/
cl_object q = big_register0_get();
cl_object r = big_register1_get();
cl_object q = _ecl_big_register0();
cl_object r = _ecl_big_register1();
#ifdef WITH_GMP
cl_object j = big_register2_get();
cl_object j = _ecl_big_register2();
mpz_set_si(j->big.big_num, fix(x));
mpz_fdiv_qr(q->big.big_num, r->big.big_num, j->big.big_num, y->big.big_num);
#else /* WITH_GMP */
q->big.big_num = (big_num_t)fix(x) / y->big.big_num;
r->big.big_num = (big_num_t)fix(x) % y->big.big_num;
#endif /* WITH_GMP */
v0 = big_register_normalize(q);
v1 = big_register_normalize(r);
v0 = _ecl_big_register_normalize(q);
v1 = _ecl_big_register_normalize(r);
break;
}
case t_ratio: /* FIX / RAT */
......@@ -287,31 +287,31 @@ ecl_floor2(cl_object x, cl_object y)
case t_bignum:
switch(ty) {
case t_fixnum: { /* BIG / FIX */
cl_object q = big_register0_get();
cl_object r = big_register1_get();
cl_object q = _ecl_big_register0();
cl_object r = _ecl_big_register1();
#ifdef WITH_GMP
cl_object j = big_register2_get();
cl_object j = _ecl_big_register2();
mpz_set_si(j->big.big_num, fix(y));
mpz_fdiv_qr(q->big.big_num, r->big.big_num, x->big.big_num, j->big.big_num);
#else /* WITH_GMP */
q->big.big_num = x->big.big_num / fix(y);
r->big.big_num = x->big.big_num % fix(y);
#endif /* WITH_GMP */
v0 = big_register_normalize(q);
v1 = big_register_normalize(r);
v0 = _ecl_big_register_normalize(q);
v1 = _ecl_big_register_normalize(r);
break;
}
case t_bignum: { /* BIG / BIG */
cl_object q = big_register0_get();
cl_object r = big_register1_get();
cl_object q = _ecl_big_register0();
cl_object r = _ecl_big_register1();
#ifdef WITH_GMP
mpz_fdiv_qr(q->big.big_num, r->big.big_num, x->big.big_num, y->big.big_num);
#else /* WITH_GMP */
q = x->big.big_num / y->big.big_num;
r = x->big.big_num % y->big.big_num;
#endif /* WITH_GMP */
v0 = big_register_normalize(q);
v1 = big_register_normalize(r);
v0 = _ecl_big_register_normalize(q);
v1 = _ecl_big_register_normalize(r);
break;
}
case t_ratio: /* BIG / RAT */
......@@ -511,18 +511,18 @@ ecl_ceiling2(cl_object x, cl_object y)
* x = MOST_NEGATIVE_FIXNUM
* y = - MOST_NEGATIVE_FIXNUM
*/
cl_object q = big_register0_get();
cl_object r = big_register1_get();
cl_object q = _ecl_big_register0();
cl_object r = _ecl_big_register1();
#ifdef WITH_GMP
cl_object j = big_register2_get();
cl_object j = _ecl_big_register2();
mpz_set_si(j->big.big_num, fix(x));
mpz_cdiv_qr(q->big.big_num, r->big.big_num, j->big.big_num, y->big.big_num);
#else /* WITH_GMP */
q = (big_num_t)fix(x) / y->big.big_num;
r = (big_num_t)fix(x) % y->big.big_num;
#endif /* WITH_GMP */
v0 = big_register_normalize(q);
v1 = big_register_normalize(r);
v0 = _ecl_big_register_normalize(q);
v1 = _ecl_big_register_normalize(r);
break;
}
case t_ratio: /* FIX / RAT */
......@@ -572,31 +572,31 @@ ecl_ceiling2(cl_object x, cl_object y)
case t_bignum:
switch(type_of(y)) {
case t_fixnum: { /* BIG / FIX */
cl_object q = big_register0_get();
cl_object r = big_register1_get();
cl_object q = _ecl_big_register0();
cl_object r = _ecl_big_register1();
#ifdef WITH_GMP
cl_object j = big_register2_get();
cl_object j = _ecl_big_register2();
mpz_set_si(j->big.big_num, fix(y));
mpz_cdiv_qr(q->big.big_num, r->big.big_num, x->big.big_num, j->big.big_num);
#else /* WITH_GMP */
q = x->big.big_num / fix(y);
r = x->big.big_num % fix(y);
#endif /* WITH_GMP */
v0 = big_register_normalize(q);
v1 = big_register_normalize(r);
v0 = _ecl_big_register_normalize(q);
v1 = _ecl_big_register_normalize(r);
break;
}
case t_bignum: { /* BIG / BIG */
cl_object q = big_register0_get();
cl_object r = big_register1_get();
cl_object q = _ecl_big_register0();
cl_object r = _ecl_big_register1();
#ifdef WITH_GMP
mpz_cdiv_qr(q->big.big_num, r->big.big_num, x->big.big_num, y->big.big_num);
#else /* WITH_GMP */
q->big.big_num = x->big.big_num / y->big.big_num;
r->big.big_num = x->big.big_num % y->big.big_num;
#endif /* WITH_GMP */
v0 = big_register_normalize(q);
v1 = big_register_normalize(r);
v0 = _ecl_big_register_normalize(q);
v1 = _ecl_big_register_normalize(r);
break;
}
case t_ratio: /* BIG / RAT */
......
......@@ -353,24 +353,24 @@ ecl_boole(int op, cl_object x, cl_object y)
return MAKE_FIXNUM(z);
}
case t_bignum: {
cl_object x_copy = big_register0_get();
cl_object x_copy = _ecl_big_register0();
big_set_si(x_copy, fix(x));
bignum_operations[op](x_copy, y);
return big_register_normalize(x_copy);
return _ecl_big_register_normalize(x_copy);
}
default:
FEtype_error_integer(y);
}
break;
case t_bignum: {
cl_object x_copy = big_register0_get();
cl_object x_copy = _ecl_big_register0();
big_set(x_copy, x);
switch (type_of(y)) {
case t_fixnum: {
cl_object z = big_register1_get();
cl_object z = _ecl_big_register1();
big_set_si(z,fix(y));
bignum_operations[op](x_copy, z);
big_register_free(z);
_ecl_big_register_free(z);
break;
}
case t_bignum:
......@@ -379,7 +379,7 @@ ecl_boole(int op, cl_object x, cl_object y)
default:
FEtype_error_integer(y);
}
return big_register_normalize(x_copy);
return _ecl_big_register_normalize(x_copy);
}
default:
FEtype_error_integer(x);
......@@ -411,10 +411,10 @@ count_bits(cl_object x)
if (big_sign(x) >= 0)
count = mpz_popcount(x->big.big_num);
else {
cl_object z = big_register0_get();
cl_object z = _ecl_big_register0();
mpz_com(z->big.big_num, x->big.big_num);
count = mpz_popcount(z->big.big_num);
big_register_free(z);
_ecl_big_register_free(z);
}
#else /* WITH_GMP */
{
......@@ -442,7 +442,7 @@ ecl_ash(cl_object x, cl_fixnum w)
if (w == 0)
return(x);
y = big_register0_get();
y = _ecl_big_register0();
if (w < 0) {
cl_index bits = -w;
if (FIXNUMP(x)) {
......@@ -478,7 +478,7 @@ ecl_ash(cl_object x, cl_fixnum w)
y->big.big_num <<= w;
#endif /* WITH_GMP */
}
return big_register_normalize(y);
return _ecl_big_register_normalize(y);
}
int
......
......@@ -128,9 +128,9 @@ cl_object
ecl_make_integer(cl_fixnum l)
{
if (l > MOST_POSITIVE_FIXNUM || l < MOST_NEGATIVE_FIXNUM) {
cl_object z = big_register0_get();
cl_object z = _ecl_big_register0();
big_set_si(z, l);
return big_register_copy(z);
return _ecl_big_register_copy(z);
}
return MAKE_FIXNUM(l);
}
......@@ -139,9 +139,9 @@ cl_object
ecl_make_unsigned_integer(cl_index l)
{
if (l > MOST_POSITIVE_FIXNUM) {
cl_object z = big_register0_get();
cl_object z = _ecl_big_register0();
big_set_ui(z, l);
return big_register_copy(z);
return _ecl_big_register_copy(z);
}
return MAKE_FIXNUM(l);
}
......@@ -260,7 +260,7 @@ ecl_to_uint64_t(cl_object x) {
} else if (mpz_fits_ulong_p(x->big.big_num)) {
return (ecl_uint64_t)mpz_get_ui(x->big.big_num);
} else {
cl_object copy = big_register0_get();
cl_object copy = _ecl_big_register0();
mpz_fdiv_q_2exp(copy->big.big_num, x->big.big_num, 32);
if (mpz_fits_ulong_p(copy->big.big_num)) {
volatile ecl_uint64_t output;
......@@ -287,7 +287,7 @@ ecl_to_int64_t(cl_object x) {
} else if (mpz_fits_slong_p(x->big.big_num)) {
return (ecl_int64_t)mpz_get_si(x->big.big_num);
} else {
cl_object copy = big_register0_get();
cl_object copy = _ecl_big_register0();
mpz_fdiv_q_2exp(copy->big.big_num, x->big.big_num, 32);
if (mpz_fits_slong_p(copy->big.big_num)) {
ecl_int64_t output;
......@@ -381,7 +381,7 @@ ecl_to_unsigned_long_long(cl_object x) {
} else if (mpz_fits_ulong_p(x->big.big_num)) {
return (ecl_ulong_long_t)mpz_get_ui(x->big.big_num);
} else {
cl_object copy = big_register0_get();
cl_object copy = _ecl_big_register0();
int i = ECL_LONG_LONG_BITS - FIXNUM_BITS;
mpz_fdiv_q_2exp(copy->bit.big_num, x->big.big_num, i);
if (mpz_fits_ulong_p(copy->big.big_num)) {
......@@ -413,7 +413,7 @@ ecl_to_long_long(cl_object x)
} else if (mpz_fits_slong_p(x->big.big_num)) {
return (ecl_long_long_t)mpz_get_si(x->big.big_num);
} else {
cl_object copy = big_register0_get();
cl_object copy = _ecl_big_register0();
int i = ECL_LONG_LONG_BITS - FIXNUM_BITS;
mpz_fdiv_q_2exp(copy->bit.big_num, x->big.big_num, i);
if (mpz_fits_ulong_p(copy->big.big_num)) {
......@@ -882,9 +882,9 @@ double_to_integer(double d)
if (d <= MOST_POSITIVE_FIXNUM && d >= MOST_NEGATIVE_FIXNUM)
return MAKE_FIXNUM((cl_fixnum)d);
else {
cl_object z = big_register0_get();
cl_object z = _ecl_big_register0();
big_set_d(z, d);
return big_register_copy(z);
return _ecl_big_register_copy(z);
}
}
......@@ -894,9 +894,9 @@ float_to_integer(float d)
if (d <= MOST_POSITIVE_FIXNUM && d >= MOST_NEGATIVE_FIXNUM)
return MAKE_FIXNUM((cl_fixnum)d);
else {
cl_object z = big_register0_get();
cl_object z = _ecl_big_register0();
big_set_d(z, d);
return big_register_copy(z);
return _ecl_big_register_copy(z);
}
}
......
......@@ -598,7 +598,7 @@ ecl_parse_integer(cl_object str, cl_index start, cl_index end,
sign = -1;
start++;
}
integer_part = big_register0_get();
integer_part = _ecl_big_register0();
big_set_ui(integer_part, 0);
for (i = start; i < end; i++) {
c = ecl_char(str, i);
......@@ -612,7 +612,7 @@ ecl_parse_integer(cl_object str, cl_index start, cl_index end,
if (sign < 0) {
big_complement(integer_part, integer_part);
}
output = big_register_normalize(integer_part);
output = _ecl_big_register_normalize(integer_part);
*ep = i;
return (i == start)? OBJNULL : output;
}
......
......@@ -234,7 +234,6 @@ ecl_import_current_thread(cl_object name, cl_object bindings)
THREAD_OP_UNLOCK();
ecl_init_env(env);
env->bindings_hash = process->process.initial_bindings;
init_big_registers(env);
ecl_enable_interrupts_env(env);
}
......
......@@ -352,21 +352,13 @@ extern ECL_API void ecl_clear_compiler_properties(cl_object sym);
/* big.c */
extern ECL_API cl_object big_register0_get(void);
extern ECL_API cl_object big_register1_get(void);
extern ECL_API cl_object big_register2_get(void);
extern ECL_API cl_object big_register_copy(cl_object x);
extern ECL_API cl_object big_register_normalize(cl_object x);
extern ECL_API void big_register_free(cl_object x);
#define _ecl_big_register0() ecl_process_env()->big_register[0]
#define _ecl_big_register1() ecl_process_env()->big_register[1]
#define _ecl_big_register2() ecl_process_env()->big_register[2]
extern ECL_API cl_object _ecl_big_register_copy(cl_object x);
extern ECL_API cl_object _ecl_big_register_normalize(cl_object x);
extern ECL_API void _ecl_big_register_free(cl_object x);
extern ECL_API cl_object bignum1(cl_fixnum val);
#ifdef WITH_GMP
extern ECL_API cl_object bignum2(mp_limb_t hi, mp_limb_t lo);
#else /* WITH_GMP */
extern ECL_API cl_object bignum2(cl_fixnum hi, cl_fixnum lo);