This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: big-endian for Pentium Pro
- To: Ulf Meerwald <ulf at aero dot tu-darmstadt dot de>
- Subject: Re: big-endian for Pentium Pro
- From: Nathan Hurst <njh at cs dot monash dot edu dot au>
- Date: Fri, 19 Jun 1998 10:57:16 +1000 (EST)
- cc: egcs at cygnus dot com
On Thu, 18 Jun 1998, Ulf Meerwald wrote:
> Is someone working on the big-endian-r/w for Pentiums,..?
Why can't you just shuffle the bytes? You don't want to shuffle all the
bytes - so work out what's in big and what's in little endian, and
shuffle:
long freadbelong(FILE* f) {
long tmp, out;
fread(&tmp, 4, 1, f);
out = tmp >> 24;
out += (tmp >> 16) & 0xff;
out += (tmp >> 8) & 0xff;
out += tmp & 0xff;
return out;
}
I think there are macros in the kernel for this.
njh