From owner-freebsd-hackers Sun Apr 12 22:27:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA07746 for freebsd-hackers-outgoing; Sun, 12 Apr 1998 22:27:27 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gatekeeper.alcatel.com.au (gatekeeper.alcatel.com.au [203.17.66.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA07739 for ; Sun, 12 Apr 1998 22:27:21 -0700 (PDT) (envelope-from Peter.Jeremy@alcatel.com.au) Received: from mfg1.cim.alcatel.com.au ([139.188.23.1]) by gatekeeper.alcatel.com.au (PMDF V5.1-7 #U2695) with ESMTP id <01IVTQ97Q0FK000GTX@gatekeeper.alcatel.com.au> for freebsd-hackers@freebsd.org; Mon, 13 Apr 1998 15:26:48 +1000 Received: from cbd.alcatel.com.au by cim.alcatel.com.au (PMDF V5.1-10 #U2695) with ESMTP id <01IVTQ95TRU8B4SVZX@cim.alcatel.com.au> for freebsd-hackers@freebsd.org; Mon, 13 Apr 1998 15:26:45 +1000 Received: from gsms01.alcatel.com.au by cbd.alcatel.com.au (PMDF V5.1-7 #U2695) with ESMTP id <01IVTQ93ICCWAZTSEU@cbd.alcatel.com.au> for freebsd-hackers@freebsd.org; Mon, 13 Apr 1998 15:26:42 +1100 Received: (from jeremyp@localhost) by gsms01.alcatel.com.au (8.8.8/8.7.3) id PAA05696 for freebsd-hackers@freebsd.org; Mon, 13 Apr 1998 15:26:41 +1000 (EST) Date: Mon, 13 Apr 1998 15:26:41 +1000 (EST) From: Peter Jeremy Subject: Intel-specific libkern code To: freebsd-hackers@FreeBSD.ORG Message-id: <199804130526.PAA05696@gsms01.alcatel.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I recently had a look through the 2.2.5 libkern code and noticed that two of the modules appear to be excellent candidates for adding Intel- specific versions. qdivrem.c provides an excellent, portable multi-precision division implementation. Unfortunately it is also large and slow. The equivalent code in libgcc2.c is an order of magnitude smaller and should be similarly faster since it makes use of the 64:32 bit division instructions available (rather than relying only on 32:32 bit division). I have a suitable replacment, but it is GPL code (since it's basically a cut-and-paste job from libgcc2.c). random.c can also benefit from the use of 32:64 bit multiply and 64:32 bit divide instructions. This is especially useful with gcc 2.8.1, which include an `optimisation' which interacts very badly with the existing code. I'm not sure how useful these changes would be overall (I don't have a profiled kernel), but I suspect __qdivrem() is used more than might be expected given the use of 64-bit offsets within the filesystem code. The rest of the (used) library doesn't appear to offer much scope for machine-specific enhancements. Has anyone bothered to see if other parts of the generic kernel could be tweaked to take advantage of Intel idiosyncracies? Note that I am not suggesting that we turn FreeBSD into an Intel- specific kernel. I am suggesting that we look at the possibility of adding hooks to allow processor-specific code to replace `portable' C where this is worthwhile. Peter -- Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au Alcatel Australia Limited 41 Mandible St Phone: +61 2 9690 5019 ALEXANDRIA NSW 2015 Fax: +61 2 9690 5247 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message