Efficiently importing/export GMP floats

Joerg Arndt arndt at jjj.de
Mon Jan 17 16:54:56 CET 2011

* foxmuldrster at yahoo.com <foxmuldrster at yahoo.com> [Jan 17. 2011 16:32]:
> BSWAP or equivalents work on x86 and others, but not on all
> architectures. And it requires a load and store minimally even on
> x86.

I dont understand, bswap allows reg-->reg operation
(but mem-->reg may actually be better here).

// Here's reg-->reg:
static inline ulong asm_bswap(ulong x)
    asm ("bswap %0" : "=r" (x) : "0" (x));
    return x;

> I am currently processing 1min and 30sec resolution geodetic
> topography and bathymetry data sets. Converting the endian takes a
> few seconds on 1min and about 12 on 30sec, and these are 440MB and
> 1.8GB data sets using a single thread, as does GMP.

These times do appear long-ish to me.
But how does that compare with processing time (for the 1.8GB set)?

> It's an architecture-biased form of processing expense that's
> entirely done away with by this convention.

Then you can just do a binary dump (iff the sizes can be determined).
But please let that not be mixed in the portable format.

If TG agrees to make both conventions possible (and do the extra work)
then that's obviously OK.

> - Rick
> [...]

cheers,   jj

More information about the gmp-discuss mailing list