[PATCH] optimizing X now that we don't support i386 CPU's on 6-CURRENT

From: David O'Brien <obrien_at_freebsd.org>
Date: Sat, 16 Oct 2004 10:49:25 -0700
Now that we don't support running 6-CURRENT on i386 class machines (vs.
486 and newer), I'd like to commit this minor optimization.  Issues?
Concerns?

Index: htonl.S
===================================================================
RCS file: /home/ncvs/src/lib/libc/i386/net/htonl.S,v
retrieving revision 1.9
diff -u -r1.9 htonl.S
--- htonl.S	23 Mar 2002 02:06:08 -0000	1.9
+++ htonl.S	16 Oct 2004 17:40:31 -0000
_at__at_ -46,7 +46,11 _at__at_
         .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
Index: ntohl.S
===================================================================
RCS file: /home/ncvs/src/lib/libc/i386/net/ntohl.S,v
retrieving revision 1.9
diff -u -r1.9 ntohl.S
--- ntohl.S	23 Mar 2002 02:06:08 -0000	1.9
+++ ntohl.S	16 Oct 2004 17:38:24 -0000
_at__at_ -46,7 +46,11 _at__at_
         .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

-- 
-- David  (obrien_at_FreeBSD.org)
Received on Sat Oct 16 2004 - 15:49:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:17 UTC