From owner-freebsd-current@FreeBSD.ORG Tue Apr 27 07:07:30 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C588106566B for ; Tue, 27 Apr 2010 07:07:30 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 096568FC18 for ; Tue, 27 Apr 2010 07:07:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 55DD69CB0DE; Tue, 27 Apr 2010 09:04:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qkliA3BLwEI8; Tue, 27 Apr 2010 09:04:53 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 1DF6B9CB452; Tue, 27 Apr 2010 09:04:53 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o3R74qqE017138; Tue, 27 Apr 2010 09:04:52 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 27 Apr 2010 09:04:51 +0200 From: Roman Divacky To: Andrew Reilly Message-ID: <20100427070451.GA16910@freebsd.org> References: <20100424080533.GA77435@freebsd.org> <20100427045053.GA64971@duncan.reilly.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100427045053.GA64971@duncan.reilly.home> User-Agent: Mutt/1.4.2.3i Cc: freebsd-multimedia@FreeBSD.org, Alexander Best , freebsd-current@FreeBSD.org Subject: Re: [CFT]: ClangBSD is selfhosting, we need testers now X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 07:07:30 -0000 while I agree that the function is strange there indeed is a bug in llvm. See: http://llvm.org/bugs/show_bug.cgi?id=6941 On Tue, Apr 27, 2010 at 02:50:53PM +1000, Andrew Reilly wrote: > On Sun, Apr 25, 2010 at 12:06:49PM +0200, Alexander Best wrote: > > i was able to pinpoint the > > exact function which is causing the problem: > > > > it's snd_xbytes(). > > This is an odd-looking function. Its purpose is to compute the > size of a target buffer for a block of audio samples that might > be sample-rate-converted or format changed. It has a loop to > compute the gcd of the second two arguments (from, to), so that > it can divide by that common factor so that it can then do v * > (to/x) / (from/x). It's not immediately obvious to me why it > bothers to find the gcd, since the division by the original > from should work anyway, as it's using a 64-bit numerator... > > The only difference that I can see when this is compiled with cc > vs clang on my amd64 system is that the latter uses a divq in > the loop and the former uses a divl. I haven't figured out why, > yet. Hmm. If the same division logic is being used in the i386 > version of clang, then it's possible that this is resulting in > a call to an extended precision divide subroutine, which could > slow things down a bit. > > Cheers, > > -- > Andrew