From owner-freebsd-hackers@freebsd.org Fri Aug 14 01:37:56 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C076F99F23C for ; Fri, 14 Aug 2015 01:37:56 +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 9BC70103E; Fri, 14 Aug 2015 01:37:56 +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=U/Vqnbt+jc0mZSt7tsbmT/+jg/Fbn4vaHDuI5lckUk4=; b=S5TbPifeq/HTwHKaLaS6eUk2o2gKnLLt5J6IV0oEmZPsYV/PPimx6N19rfQnZCVP87wW/DAn33U2llsBaaNU4KUNVwqisf2qYFR+dWUtCumxr82mIxwD5tIOt1NIKAp6Eoko/upvBrnh5jP5dB2Psw/KOUbXaZx8S3/JuXayIjc=; Received: from [114.124.38.158] (port=57461 helo=X220.alogt.com) by sl-508-2.slc.westdc.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZQ3wL-0001xT-3m; Thu, 13 Aug 2015 19:37:49 -0600 Date: Fri, 14 Aug 2015 09:37:43 +0800 From: Erich Dollansky To: Davide Italiano Cc: Andriy Gapon , Konstantin Belousov , "freebsd-hackers@freebsd.org" Subject: Re: allow ffs & co. a binary search Message-ID: <20150814093743.267af1c5@X220.alogt.com> In-Reply-To: References: <20150607081315.7c0f09fb@B85M-HD3-0.alogt.com> <5573EA5E.40806@selasky.org> <20150607195245.62dc191f@B85M-HD3-0.alogt.com> <20150607135453.GH2499@kib.kiev.ua> <558175FA.4040106@FreeBSD.org> <20150617165331.GA2080@kib.kiev.ua> <5582CCF1.8010505@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, 14 Aug 2015 01:37:56 -0000 Hi, On Thu, 13 Aug 2015 16:37:08 -0400 Davide Italiano wrote: > On Thu, Jun 18, 2015 at 9:51 AM, Andriy Gapon wrote: > > On 17/06/2015 19:53, Konstantin Belousov wrote: > >> AFAIR it was about 'sufficiently smart compiler' and the fact that > >> the functions are not on the hottest paths. > > > > It seems that sufficiently smart compilers still do not exist :-) > > At least as far as compilers that are used for compiling FreeBSD > > are considered. > > > > [Offtopic] my impression is that lately smartness of compilers is > > mostly being improved by various tricks and shortcuts (undefined > > behavior, etc), rather than by recognizing patterns in the C code > > that could be turned into more efficient machine code. > > > > -- > > Andriy Gapon > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to > > "freebsd-hackers-unsubscribe@freebsd.org" > > Sorry for resurrect an old thread. > I fixed in LLVM upstream (I'll try to get this pulled in FreeBSD). > http://llvm.org/viewvc/llvm-project?view=revision&revision=244947 > It seems that we can still save another instruction, but LLVM is close > enough to gcc now in code generation for this pattern. > what does this mean? Does clang now recognise loops like this or is the built-in function now optimised? Erich