From owner-freebsd-current@FreeBSD.ORG Sat Oct 16 17:49:27 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 246F816A4CE for ; Sat, 16 Oct 2004 17:49:27 +0000 (GMT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8B0643D2D for ; Sat, 16 Oct 2004 17:49:26 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.13.1/8.13.1) with ESMTP id i9GHnQk8097726 for ; Sat, 16 Oct 2004 10:49:26 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.13.1/8.13.1/Submit) id i9GHnPHK097723 for freebsd-current@freebsd.org; Sat, 16 Oct 2004 10:49:25 -0700 (PDT) (envelope-from obrien) Date: Sat, 16 Oct 2004 10:49:25 -0700 From: "David O'Brien" To: freebsd-current@freebsd.org Message-ID: <20041016174925.GA96809@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 6.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Subject: [PATCH] optimizing X now that we don't support i386 CPU's on 6-CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2004 17:49:27 -0000 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)