Support for w*ndows
Torbjorn Granlund
tg at gmplib.org
Mon Nov 28 23:24:16 CET 2011
Torbjorn Granlund <tg at gmplib.org> writes:
I did something similar to the mechanism for nails. An assembly file
that supports more than the standard ABI need to provide ABI
declarations:
ABI_SUPPORT(DOS64)
ABI_SUPPORT(ELF64)
In configure, for environments that do not comply to the standard ABI,
we need to issue a statement declaration
AC_SUBST(GMP_NONSTD_ABI,DOS64)
Finally, in the loop for selecting mpn code, when GMP_NONSTD_ABI is set,
files without the corresponding ABI_SUPPORT seclaration will be skipped.
Things seem to work well on a virtual dos64 machine around here.
I pushed this change.
I have converted 4 assembly files with 5 functions to support Windoze-64
under cygwin and mingw64, providing mul_1, addmul_1, submul_1,
mul_basecase, and sqr_basecase.
For the first 3 functions I made the port in a tricker way, resulting in
no extra overhead. The last 2 files just use a mechanism similar to the
one Niels described which is used by Nettle crypto library.
It probably could take some cleanup; some things are now repeated for
each asm file. The DOS64_ENTRY macro is somewhat dumb, and cannot
handle sign/zero extension of stack-based parameters. It therefore only
handles the (up to) 4 register parameters.
Converting more asm files is not hard, but it is also no terrible hurry.
The improved configure will use the converted files and ignore the rest.
--
Torbjörn
More information about the gmp-devel
mailing list