Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Oct 2004 10:49:25 -0700
From:      "David O'Brien" <obrien@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   [PATCH] optimizing X now that we don't support i386 CPU's on 6-CURRENT
Message-ID:  <20041016174925.GA96809@dragon.nuxi.com>

next in thread | raw e-mail | index | archive | help
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
@@ -46,7 +46,11 @@
         .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
@@ -46,7 +46,11 @@
         .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@FreeBSD.org)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041016174925.GA96809>