This is the mail archive of the
mailing list for the GCC project.
Re: Bytes order and words order
- From: Matt Austern <austern at apple dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Richard dot Earnshaw at arm dot com, gcc at gcc dot gnu dot org
- Date: Fri, 23 Aug 2002 09:35:55 -0700
- Subject: 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
name it __TARGET_FLOAT_WORDS_ORDER__ ?
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.