Efficiently importing/export GMP floats

foxmuldrster at yahoo.com foxmuldrster at yahoo.com
Wed Jan 19 20:02:56 CET 2011

Patrick, in addition on many cache architectures there is a notable penalty for unaligned data access, such as not being 4-, 16- or larger-byte aligned.

x86 is one of them with an entire category of fault devoted to it, called 17 #AC Alignment Check exception. It is maskable, but is present because the CPU must issue two fetches per memory operand, combining the offset bits through additional logic.

- Rick

-----Original message-----
From: Patrick Pelissier <patrick.pelissier at gmail.com>
To: Torbjorn Granlund <tg at gmplib.org>
Cc: gmp-discuss at gmplib.org, mpfr at mpfr.org
Sent: Wed, Jan 19, 2011 18:43:54 GMT+00:00
Subject: Re: Efficiently importing/export GMP floats

> It might therefore make sense to update to a coherent format for GMP and
> MPFR, using function names not to be confused with mpz_out_raw/mpz_inp_raw.
> * The format should by byte-oriented, not 32-bit oriented.

 Why do you prefer the format to be byte-oriented?
 To consume less space?
 Won't it make some compatibility problems across systems where a char is 8 bits
 and systems where a char is 16 bits (or 32 bits)?

> * "Network byte order" should be used, i.e., most significant byte first.

 Do you have a practical example of why it is better?

  Patrick Pélissier
gmp-discuss mailing list
gmp-discuss at gmplib.org

More information about the gmp-discuss mailing list