DragonFly BSD
DragonFly submit List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[PATCH] Suggested FreeBSD merge


From: Xin LI <delphij@xxxxxxxxxxxxx>
Date: Fri, 12 Nov 2004 13:39:13 +0800

Hi,

I think you would interest the patch attached.  This brings FreeBSD
rev. 1.10 of htonl.S and ntohl.S's changes by David O'Brien, which
is positive for application performance on 80486 and above.

Cheers,
-- 
Xin LI <delphij frontfree net>	http://www.delphij.net/
See complete headers for GPG key and other information.

Index: htonl.S
===================================================================
RCS file: /home/dcvs/src/lib/libc/i386/net/htonl.S,v
retrieving revision 1.3
diff -u -r1.3 htonl.S
--- htonl.S	6 Dec 2003 03:11:35 -0000	1.3
+++ htonl.S	12 Nov 2004 05:33:48 -0000
@@ -43,7 +43,11 @@
 
 ENTRY(htonl)
 	movl	4(%esp),%eax
+#ifdef I386_CPU
 	xchgb	%al,%ah
 	roll	$16,%eax
 	xchgb	%al,%ah
+#else
+	bswap	%eax
+#endif
 	ret
Index: ntohl.S
===================================================================
RCS file: /home/dcvs/src/lib/libc/i386/net/ntohl.S,v
retrieving revision 1.3
diff -u -r1.3 ntohl.S
--- ntohl.S	6 Dec 2003 03:11:35 -0000	1.3
+++ ntohl.S	12 Nov 2004 05:34:37 -0000
@@ -43,7 +43,11 @@
 
 ENTRY(ntohl)
 	movl	4(%esp),%eax
+#ifdef I386_CPU
 	xchgb	%al,%ah
 	roll	$16,%eax
 	xchgb	%al,%ah
+#else
+	bswap	%eax
+#endif
 	ret

Attachment: pgp00002.pgp
Description: PGP signature



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]