Jason Moxham on Wed, 01 Jul 2009 16:46:23 +0200


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

Pari 64bit on Windows


Hi

I've got Pari-svn running on Windows with/without GMP/MPIR in 64bit mode. This 
is with MSVC , and when MinGW/MSYS goes 64bit it will work with that :)
The main problem with Windows64 is that it uses a LLP data model rather than 
the usual LP data model , this means that long's are 32 bit. I'm doing this 
for the Sage project but it would be nice if the changes could be 
incorporated back into Pari , so I propose this.

Introduce a new type and macro ( with signed and unsigned versions)
typedef long paritemplong_t;
#define PARITEMPLONG(x) (x##L)

replace all occurances of long with paritemplong_t and   numberL with 
PARITEMPLONG(number)

The above is all just simple text replacement and although it means changes to 
every file it will have no "real" changes.

Then for WIN64 only we change the definition

typedef long long paritemplong_t;
#define PARITEMPLONG(x) (x##LL)

There a few other minor bits , but the above gets pari mostly working on WIN64 
and there are no real changes for any other system.

Now comes the hard bit , go through all the code and replace the temp types 
above with the appropriate new pari types. ie If the long was used to store a 
(in GMP terms an mp_limb_t) then use a new type pari_limb_t . If the long was 
a cast from a pointer then use ptrdiff_t . Same for the ULL macros . 

There is a lot text changes involved , but for non-WIN64 system no real 
changes.

Jason