From: Timothy Wall <twall@oculustech.com>
To: gdb@sources.redhat.com
Subject: packing/unpacking 4-octet longs
Date: Tue, 04 Dec 2001 05:44:00 -0000 [thread overview]
Message-ID: <3C0CD32D.A118C5A0@oculustech.com> (raw)
I'm working on a DSP port (yes, I'm the one tossing the OCTETS_PER_BYTE
strangeness about) and TI has introduced yet another Really Strange Thing.
Longs on this chip are packed little-endian. No wait, they're packed
big-endian. No-wait, it's both!
Basically, words are packed little-endian w/r/t octets, but the two words are
big-endian, e.g.
0xaabbccdd is stored as 0xbb 0xaa 0xdd 0xcc. This I can account for in the
long/float/double packing/unpacking routines (though I'm not sure how I'm
going to make a clean patch yet...). The problem is that the word order
switches if the value is accessed at an odd address (apparently this made
sense to the hardware designers). The MS word of a long is always the first
one accessed (they must have forgotten that the chip was little-endian).
Any ideas of how to make this happen? I remember doing a fix for something
similar way back, but looking at the code now, by the time the data is
packed/unpacked, the target address is long gone. I doubt I can reliably do
swapping every time I access a 4-octet block of target data.
T.
next reply other threads:[~2001-12-04 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-04 5:44 Timothy Wall [this message]
2001-12-05 8:26 ` Andrew Cagney
2001-12-05 8:46 ` Richard Earnshaw
2001-12-05 10:11 ` Lars Brinkhoff
2001-12-05 10:42 ` Andrew Cagney
2001-12-06 2:03 ` Richard Earnshaw
2001-12-05 9:31 ` Timothy Wall
2001-12-05 10:03 ` Andrew Cagney
2001-12-05 10:20 ` Timothy Wall
2001-12-05 10:49 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C0CD32D.A118C5A0@oculustech.com \
--to=twall@oculustech.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox