From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 12 00:11:03 2015 Return-Path: Delivered-To: freebsd-hackers@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8022B726; Fri, 12 Jun 2015 00:11:03 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) Received: from alogt.com (alogt.com [69.36.191.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C621175A; Fri, 12 Jun 2015 00:11:03 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=HxTcRrgirz/MGp63FF6dEs/WeN8kZUGPTrcK9vDNEzA=; b=xIB0bbZAqccj5Ru3OLw7wwEKYUrtcPbUiCA4X61wzAw3fOk8wfGCNQZ4eF/ifLntrExu9CNGRKtBc6wA53d5VG9jTlkmOd7Ig+PoJtLa2tO1mrQIueLJP9TKTHKWzu0fIfEUuZLQxRXgP8Z5raAqoWkUic1ZLPyWPivOgJ5kpHI=; Received: from [39.255.137.235] (port=38526 helo=B85M-HD3-0.alogt.com) by sl-508-2.slc.westdc.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1Z3CYm-0043Qg-Jq; Thu, 11 Jun 2015 18:11:01 -0600 Date: Fri, 12 Jun 2015 08:10:54 +0800 From: Erich Dollansky To: Ian Lepore Cc: Hans Petter Selasky , "freebsd-hackers@freebsd.org\" Subject: Re: allow ffs & co. a binary search Message-ID: <20150612081054.4589dcc7@B85M-HD3-0.alogt.com> In-Reply-To: <1434034310.1415.2.camel@freebsd.org> References: <20150607081315.7c0f09fb@B85M-HD3-0.alogt.com> <5573EA5E.40806@selasky.org> <20150611152107.61f85189@B85M-HD3-0.alogt.com> <1434027471.1200.401.camel@freebsd.org> <20150611224347.64372a76@B85M-HD3-0.alogt.com> <1434034310.1415.2.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2015 00:11:03 -0000 Hi, On Thu, 11 Jun 2015 08:51:50 -0600 Ian Lepore wrote: > On Thu, 2015-06-11 at 22:43 +0800, Erich Dollansky wrote: > > Hi, > > > > On Thu, 11 Jun 2015 06:57:51 -0600 > > Ian Lepore wrote: > > > > > On Thu, 2015-06-11 at 15:21 +0800, Erich Dollansky wrote: > > > > On Sun, 07 Jun 2015 08:53:18 +0200 > > > > Hans Petter Selasky wrote: > > > > > > > Is there any reason that this whole change, userland and kernel, > > > isn't just: > > > > > > #define ffs(n) __builtin_ffs(n) > > > > I did not see this. Where is it? > > > > Of course, if this is already done, it does not have to be done > > again. > > > > Erich > > I'm not quite sure what you're asking. Both clang and gcc support > __builtin_ffs(), so I'm saying why don't we just use it and call the > whole problem solved? > so, it is not in the sources yet. Yes, then use it and let the compiler guys crack their heads. Erich