From owner-freebsd-mips@FreeBSD.ORG Thu Nov 15 23:09:51 2012 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1A136F8; Thu, 15 Nov 2012 23:09:51 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7F9CC8FC18; Thu, 15 Nov 2012 23:09:51 +0000 (UTC) Received: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 636D3401DC; Thu, 15 Nov 2012 17:09:50 -0600 (CST) Received: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 62629401D9; Thu, 15 Nov 2012 17:09:50 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from mh3.mail.rice.edu ([127.0.0.1]) by mh3.mail.rice.edu (mh3.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id mVjvNfA5WAja; Thu, 15 Nov 2012 17:09:50 -0600 (CST) Received: from [10.212.194.234] (unknown [10.212.194.234]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 47B39401D6; Thu, 15 Nov 2012 17:09:50 -0600 (CST) Message-ID: <50A57649.9020504@rice.edu> Date: Thu, 15 Nov 2012 17:10:01 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Warner Losh Subject: Re: ZERO_REGION_SIZE References: <50A53391.4080909@rice.edu> <50A54CCD.8070409@rice.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Jayachandran C." , mips@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 23:09:51 -0000 On 11/15/2012 3:07 PM, Warner Losh wrote: > On Nov 15, 2012, at 1:13 PM, Alan Cox wrote: >> P.S. I would encourage someone with hardware to look into implementing a >> non-iterative ffs*() using (d)clz. The MIPS pmap would benefit from >> this. Basically, most pmap_enter() calls are doing an ffs*(). > ffs finds the first bit set. clz counts the number of leading zeros and thus finds the last bit set. Would a non-iterative fls* be helpful? The code could probably use fls* in place of ffs*. In any case, there's a standard trick for using (d)clz to implement a non-iterative ffs*. Alan