This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bytes order and words order

On Friday, August 23, 2002, at 05:04 AM, Gabriel Dos Reis wrote:

OK, thanks.  I was actually thinking of the word-order of
floating-point numbers not that of integral types.  I think I should
Is it reasonable to assume that the byte order of integral and
floating point coincide?

For floating-point numbers, don't you need a lot more than
just "word order"?  The last time I checked this out (about
a year ago), I thought I'd convinced myself that, even if I
knew endianness and knew that float and double were IEEE
format, I didn't know quite enough to find the individual
bits.  And don't forget that on many systems you *don't*
know that floating-point types are IEEE: long double
tends not to be.

I started working on a system to parameterize extraction
of the various parts of an fp number (sign bit, mantissa,
most-significant-mantissa-bit if the format has one,
exponent, exponent bias).  I used a table lookup system,
and set a flag in the header to identify the architecture.
But your idea of getting this from the compiler is better.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]