[hn]to[nh][sl] functions used xchgb %h1,%b1 instead of the faster (on the

i486 & i586) rorw $8, %w1.
This commit is contained in:
jtc 1994-03-16 17:34:14 +00:00
parent 91906bc019
commit 5ac78ccb34
4 changed files with 14 additions and 14 deletions

View File

@ -34,19 +34,19 @@
* SUCH DAMAGE.
*
* from: @(#)htonl.s 5.3 (Berkeley) 12/17/90
* $Id: htonl.S,v 1.3 1994/03/12 01:52:12 jtc Exp $
* $Id: htonl.S,v 1.4 1994/03/16 17:34:14 jtc Exp $
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$Id: htonl.S,v 1.3 1994/03/12 01:52:12 jtc Exp $")
RCSID("$Id: htonl.S,v 1.4 1994/03/16 17:34:14 jtc Exp $")
#endif
/* netorder = htonl(hostorder) */
ENTRY(htonl)
movl 4(%esp),%eax
xchgb %al,%ah
rorw $8,%ax
roll $16,%eax
xchgb %al,%ah
rorw $8,%ax
ret

View File

@ -34,17 +34,17 @@
* SUCH DAMAGE.
*
* from: @(#)htons.s 5.2 (Berkeley) 12/17/90
* $Id: htons.S,v 1.3 1994/03/12 01:52:14 jtc Exp $
* $Id: htons.S,v 1.4 1994/03/16 17:34:15 jtc Exp $
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$Id: htons.S,v 1.3 1994/03/12 01:52:14 jtc Exp $")
RCSID("$Id: htons.S,v 1.4 1994/03/16 17:34:15 jtc Exp $")
#endif
/* netorder = htons(hostorder) */
ENTRY(htons)
movzwl 4(%esp),%eax
xchgb %al,%ah
rorw $8,%ax
ret

View File

@ -34,19 +34,19 @@
* SUCH DAMAGE.
*
* from: @(#)ntohl.s 5.2 (Berkeley) 12/17/90
* $Id: ntohl.S,v 1.3 1994/03/12 01:52:15 jtc Exp $
* $Id: ntohl.S,v 1.4 1994/03/16 17:34:16 jtc Exp $
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$Id: ntohl.S,v 1.3 1994/03/12 01:52:15 jtc Exp $")
RCSID("$Id: ntohl.S,v 1.4 1994/03/16 17:34:16 jtc Exp $")
#endif
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
movl 4(%esp),%eax
xchgb %al,%ah
rorw $8,%ax
roll $16,%eax
xchgb %al,%ah
rorw $8,%ax
ret

View File

@ -34,17 +34,17 @@
* SUCH DAMAGE.
*
* from: @(#)ntohs.s 5.2 (Berkeley) 12/17/90
* $Id: ntohs.S,v 1.3 1994/03/12 01:52:16 jtc Exp $
* $Id: ntohs.S,v 1.4 1994/03/16 17:34:17 jtc Exp $
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$Id: ntohs.S,v 1.3 1994/03/12 01:52:16 jtc Exp $")
RCSID("$Id: ntohs.S,v 1.4 1994/03/16 17:34:17 jtc Exp $")
#endif
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
movzwl 4(%esp),%eax
xchgb %al,%ah
rorw $8,%ax
ret