From owner-freebsd-current@FreeBSD.ORG Tue Apr 27 04:50:56 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 C022F1065672; Tue, 27 Apr 2010 04:50:56 +0000 (UTC) (envelope-from areilly@bigpond.net.au) Received: from nschwmtas04p.mx.bigpond.com (nschwmtas04p.mx.bigpond.com [61.9.189.146]) by mx1.freebsd.org (Postfix) with ESMTP id 01AE78FC15; Tue, 27 Apr 2010 04:50:55 +0000 (UTC) Received: from nschwotgx02p.mx.bigpond.com ([124.188.161.100]) by nschwmtas04p.mx.bigpond.com with ESMTP id <20100427045054.MHBU9850.nschwmtas04p.mx.bigpond.com@nschwotgx02p.mx.bigpond.com>; Tue, 27 Apr 2010 04:50:54 +0000 Received: from duncan.reilly.home ([124.188.161.100]) by nschwotgx02p.mx.bigpond.com with ESMTP id <20100427045054.EAPH2131.nschwotgx02p.mx.bigpond.com@duncan.reilly.home>; Tue, 27 Apr 2010 04:50:54 +0000 Date: Tue, 27 Apr 2010 14:50:53 +1000 From: Andrew Reilly To: Alexander Best Message-ID: <20100427045053.GA64971@duncan.reilly.home> References: <20100424080533.GA77435@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Authentication-Info: Submitted using SMTP AUTH LOGIN at nschwotgx02p.mx.bigpond.com from [124.188.161.100] using ID areilly@bigpond.net.au at Tue, 27 Apr 2010 04:50:54 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150201.4BD66D2E.00ED,ss=1,fgs=0 X-SIH-MSG-ID: rRw7FNX/TAD0zmQs0WyzOwJxyArnqyN48Z4QX81loRIGTUDCp8DeQ9rHNvZRsM6kxDxLJhqBNGQgaangTY3Rs9mK Cc: freebsd-multimedia@freebsd.org, Roman Divacky , 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 04:50:56 -0000 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