🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #12532

Re: Swap byte instruction - how high is the win?

#12532
From: Zalman Stern
Date: Sat, 09 Jan 1993 06:00
24 lines
1815 bytes
Byte swap instructions are used for two things:

1) Handling network (big-endian) byte order on a little endian machine.
2) Emulating x86 code on big-endian machines.

If you don't do either of these things, then the byte swap instruction is  
close to useless. (It might get used in device drivers that talk to brain  
dead hardware.) Even in these applications, the speed up is dubious because  
there is lots of other stuff going on.

I'm not sure I agree that many RISC processors implement byte swap  
instructions. The only one I know of is the POWER architecture which has 16  
bit swap instructions. Many RISC processors implement selectable endianness,  
but that is an entirely different matter. For example, the mechanism the  
R4000 (R3000A, R6000A) uses to switch endianness cannot be used to byte swap  
a word. The mechanism used on the Motorola 88000 series can be used to do  
that though I doubt it is efficient to do so from user mode. Vendors put  
these features in to make their chips more widely marketable more than to  
increase performance. (I.e. some potential customers would only accept a  
big-endian chip and others would only accept a little-endian one.)
--
Zalman Stern		   zalman@adobe.com		    (415) 962 3824
Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  "Yeah. Ask 'em if they'll upgrade my shifters too." Bill Watterson
Technical Details
Message-ID: <1993Jan9.060054.2472@adobe.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!concert!decwrl!adobe!usenet
References: <1993Jan8.111731.19116@odin.diku.dk>

Show Full Headers
Complete Article Headers
Newsgroups: comp.arch
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!concert!decwrl!adobe!usenet
From: zstern@adobe.com (Zalman Stern)
Subject: Re: Swap byte instruction - how high is the win?
Message-ID: <1993Jan9.060054.2472@adobe.com>
Sender: usenet@adobe.com (USENET NEWS)
Organization: Adobe Systems Incorporated
References: <1993Jan8.111731.19116@odin.diku.dk>
Date: Sat, 9 Jan 1993 06:00:54 GMT
Lines: 24