Sync with sys/i386/include/endian.h: use the single instruction 'bswap'.
This commit is contained in:
parent
bd2e7b7478
commit
62f696fcfa
@ -46,7 +46,11 @@ __FBSDID("$FreeBSD$");
|
|||||||
.set CNAME(htonl),CNAME(__htonl)
|
.set CNAME(htonl),CNAME(__htonl)
|
||||||
ENTRY(__htonl)
|
ENTRY(__htonl)
|
||||||
movl 4(%esp),%eax
|
movl 4(%esp),%eax
|
||||||
|
#ifdef I386_CPU
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
roll $16,%eax
|
roll $16,%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
|
#else
|
||||||
|
bswap %eax
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
|
@ -46,7 +46,11 @@ __FBSDID("$FreeBSD$");
|
|||||||
.set CNAME(ntohl),CNAME(__ntohl)
|
.set CNAME(ntohl),CNAME(__ntohl)
|
||||||
ENTRY(__ntohl)
|
ENTRY(__ntohl)
|
||||||
movl 4(%esp),%eax
|
movl 4(%esp),%eax
|
||||||
|
#ifdef I386_CPU
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
roll $16,%eax
|
roll $16,%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
|
#else
|
||||||
|
bswap %eax
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user