From: jrp@jrp.tiac.net
To: axp-list@redhat.com
Subject: Re: Byte orders
Date: Thu, 18 Jun 1998 21:35:00 -0400 (EDT) [thread overview]
Message-ID: <199806190135.VAA01551@pentium.localnet> (raw)
In-Reply-To: <199806152030.QAA04912@horizon.ess.sunysb.edu>
On 15 Jun, Aakin N. Patel wrote:
> I've managed to aquire a few binary data sets I need to work with, which
> are in big-endian format. Does anyone know of a quick simple byte-swapping
> utility that I can use to change the bytes around so that I can read the
> data on my alphas?
Unfortunately, this is a problem that can't be solved in the general
case. The reason is how you swap depends on the format of your data.
Character strings typically don't get swapped at all, longwords get
swapped four bytes end-for-end, words get swapped two bytes end-for-end.
Any program that seeks to swap your data around therefore has to know
what data format it is to begin with.
We studied this problem *very* closely when we implemented Freeport
Express (the Sparc->Alpha translator), then concluded that there was
no transform we could apply at translate time to the data segment of
the executable. So yes, we swap on data accesses. (Not on *every*
data access; our optimizer does a ton of analysis to determine when
we have to swap and when we can get away without doing so...)
--
Jim Paradis jrp@jrp.tiac.net "The early bird gets the worm.
http://www.tiac.net/users/jrp/index.html If you want something else for
breakfast, get up later."
prev parent reply other threads:[~1998-06-19 2:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-12 17:58 PC164 for sale Ian Kinner
1998-06-15 19:11 ` Todd Henderson
1998-06-15 19:14 ` Todd Henderson
1998-06-15 20:30 ` Byte orders Aakin N. Patel
1998-06-15 21:04 ` Bill
[not found] ` <3585937C.5BDEE81C@paralleldata.com>
1998-06-15 21:36 ` Wes Bauske
1998-06-19 1:35 ` jrp [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox