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

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!gatech!concert!decwrl!adobe!usenet
  3. From: zstern@adobe.com (Zalman Stern)
  4. Subject: Re: Swap byte instruction - how high is the win?
  5. Message-ID: <1993Jan9.060054.2472@adobe.com>
  6. Sender: usenet@adobe.com (USENET NEWS)
  7. Organization: Adobe Systems Incorporated
  8. References: <1993Jan8.111731.19116@odin.diku.dk>
  9. Date: Sat, 9 Jan 1993 06:00:54 GMT
  10. Lines: 24
  11.  
  12. Byte swap instructions are used for two things:
  13.  
  14. 1) Handling network (big-endian) byte order on a little endian machine.
  15. 2) Emulating x86 code on big-endian machines.
  16.  
  17. If you don't do either of these things, then the byte swap instruction is  
  18. close to useless. (It might get used in device drivers that talk to brain  
  19. dead hardware.) Even in these applications, the speed up is dubious because  
  20. there is lots of other stuff going on.
  21.  
  22. I'm not sure I agree that many RISC processors implement byte swap  
  23. instructions. The only one I know of is the POWER architecture which has 16  
  24. bit swap instructions. Many RISC processors implement selectable endianness,  
  25. but that is an entirely different matter. For example, the mechanism the  
  26. R4000 (R3000A, R6000A) uses to switch endianness cannot be used to byte swap  
  27. a word. The mechanism used on the Motorola 88000 series can be used to do  
  28. that though I doubt it is efficient to do so from user mode. Vendors put  
  29. these features in to make their chips more widely marketable more than to  
  30. increase performance. (I.e. some potential customers would only accept a  
  31. big-endian chip and others would only accept a little-endian one.)
  32. --
  33. Zalman Stern           zalman@adobe.com            (415) 962 3824
  34. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  35.   "Yeah. Ask 'em if they'll upgrade my shifters too." Bill Watterson
  36.