Bill Allombert on Fri, 27 Sep 2002 13:40:49 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

t_INT API


Hello developers,
I am working on a low-level GMP kernel for PARI/GP based on GMP mpn_ class
f functions.

This kernel use an slightly incompatible format for t_INT:

The mantissa words are written low-order to high-order instead of PARI
which use high-order to low-order.
The code words are unchanged and when lgefint(x)=3, both formats
are identical.

This is nice since most assumptions about t_INT mantissa in the code are
for x with lgefint(x)=3.

However there are instance of left-right binary powering that need
fast access to bits.

I propose to use the following interface:
#define int_MSW(x) 
x being a t_INT, return a pointer to the most significant word of an t_INT.

#define int_LSW(x) 
x being a t_int, return a pointer to the least significant word of an t_INT.

#define int_nextW(x) 
x pointing to a mantissa word, return the next (more significant) mantissa word.

#define int_precW(x)
x pointing to a mantissa word, return the previous (less significant) mantissa word.

Any comments ?

Cheers,

Bill