Sync with sys/i386/include/endian.h: use the single instruction 'bswap'.

This commit is contained in:
David E. O'Brien 2004-10-18 17:19:36 +00:00
parent bd2e7b7478
commit 62f696fcfa
2 changed files with 8 additions and 0 deletions

View File

@ -46,7 +46,11 @@ __FBSDID("$FreeBSD$");
.set CNAME(htonl),CNAME(__htonl)
ENTRY(__htonl)
movl 4(%esp),%eax
#ifdef I386_CPU
xchgb %al,%ah
roll $16,%eax
xchgb %al,%ah
#else
bswap %eax
#endif
ret

View File

@ -46,7 +46,11 @@ __FBSDID("$FreeBSD$");
.set CNAME(ntohl),CNAME(__ntohl)
ENTRY(__ntohl)
movl 4(%esp),%eax
#ifdef I386_CPU
xchgb %al,%ah
roll $16,%eax
xchgb %al,%ah
#else
bswap %eax
#endif
ret