home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / arch / 12188 < prev    next >
Encoding:
Text File  |  1993-01-08  |  3.2 KB  |  64 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!usc!wupost!uwm.edu!linac!unixhub!kfp-slac-mac.slac.stanford.edu!user
  3. From: dbg@slac.stanford.edu (David B. Gustavson)
  4. Subject: Re: Swap byte instruction, Endianness
  5. Message-ID: <dbg-080193184816@kfp-slac-mac.slac.stanford.edu>
  6. Followup-To: comp.arch
  7. Sender: news@unixhub.SLAC.Stanford.EDU
  8. Organization: SLAC Computation Research Group
  9. References: <1993Jan7.074052.19620@qb.rhein-main.de> <1993Jan8.111731.19116@odin.diku.dk>
  10. Date: Sat, 9 Jan 1993 03:08:20 GMT
  11. Lines: 51
  12.  
  13. In article <1993Jan8.111731.19116@odin.diku.dk>, torbenm@diku.dk (Torben
  14. AEgidius Mogensen) wrote:
  15. > Newer processors (including the new ARMs) tend to have selectable
  16. > endianness instead of byte swap instructions.
  17. That's too bad, because selectable endianness isn't well defined and won't
  18. solve the problem in general. The trouble becomes obvious when you consider
  19. general interconnected systems with multiple bridges connecting data paths
  20. of various widths. Unless these bridges agree to preserve the relative byte
  21. addresses of all data, it gets thoroughly shuffled as it propagates from
  22. one convention to another. 
  23.  
  24. Thus the principle of Address Invariance has (after many person-years of
  25. arguments) been adopted by the IEEE bus standards (like 1596 SCI and 896
  26. FutureBus+). One of the SCI follow-on standards addresses the final part of
  27. this problem, P1596.5 Data Transfer Formats. The idea is to give the
  28. compiler enough information so that it can unscramble the data in a
  29. heterogeneous environment, generating only those swaps that are needed.
  30. Efficient swap instructions work well for this, but selectable endianness
  31. doesn't hack it.
  32. Contact the P1596.5 chair for more info, David James: dvj@apple.com.
  33.  
  34. By the way, the clearest definition of endianness that I know is:
  35.  
  36. In a Big-endian machine, the significance of bytes (or bits) in any data
  37. item decreases as the address (byte or bit number) increases.
  38.  
  39. In a Little-endian machine, the significance of bytes (or bits) in any data
  40. item except character strings increases as the address (byte or bit number
  41. increases. For character strings the significance decreases.
  42.  
  43.  
  44. Numbering bits and bytes oppositely is a loser, as Motorola discovered when
  45. they added the Bit Field instructions in the 68020. They are not
  46. independent choices once instructions exist that couple them. 
  47.  
  48. Endianness describes how data gets loaded into registers, not how it gets
  49. mapped to bus lines or other hardware. For multiplexed buses, an additional
  50. descriptor is needed, which distinguishes "Big addressan" and "Little
  51. addressan" sexes. (Ugh, but that's the term that won out.) The existence of
  52. this independent choice confuses the endianness arguments considerably, and
  53. was a major cause of the confusion that caused selectable endianness to be
  54. implemented incorrectly in some processors. 
  55.  
  56. --------------------------------------------------------------
  57. -- David B. Gustavson, Computation Research Group, SLAC, POB 4349 MS 88,
  58.     Stanford, CA 94309   tel (415)961-3539  fax (415)961-3530
  59. -- What the world needs next is a Scalable Coherent Interface!
  60. -- Any opinions expressed are mine and not necessarily those
  61.    of the Stanford Linear Accelerator Center, the University, or the DOE.
  62.