Date: Mon, 13 Apr 1998 15:26:41 +1000 (EST) From: Peter Jeremy <Peter.Jeremy@alcatel.com.au> To: freebsd-hackers@FreeBSD.ORG Subject: Intel-specific libkern code Message-ID: <199804130526.PAA05696@gsms01.alcatel.com.au>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804130526.PAA05696>