From owner-freebsd-hackers@freebsd.org Thu Aug 13 20:37:11 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 6FA959B82A8 for ; Thu, 13 Aug 2015 20:37:11 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED496146; Thu, 13 Aug 2015 20:37:10 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: by lbbtg9 with SMTP id tg9so34220937lbb.1; Thu, 13 Aug 2015 13:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DaK8THBoLCQ9LoDcCcMdaU/tIOEk2u0biUwizVObaMc=; b=W4Bg44P7RohzSX82dJlzhx1uH2NqVvXCn1hYXu2l+3CAvBvwUoxePHFKGTkVFCXdbr 3q97fUKO3rVc+GJDiuq+n8d9wN2x5AGpTA92IAC0hkU5RV1cfhBW9yo007wmaxYQDWwT eXkHXcSKdgXx074ky3DXHLDtRzZxzCeu6X9XOeLDDa+ed9M92ngd7H9OvQag9CeTUmmp 2Zpa1eMtfTEGCy15xa5UZWWLMZHnoEfpyFaij044i7D3CW3dc950QdPPV22m+UIaPPS2 UJb8u0ERxqZ5iAiIMm7SQWWTICbWVH/efoNf1CS0MuSCon5h7kOwlEpFML3vXd8MmlKT utIQ== MIME-Version: 1.0 X-Received: by 10.152.87.116 with SMTP id w20mr38407655laz.119.1439498228921; Thu, 13 Aug 2015 13:37:08 -0700 (PDT) Received: by 10.25.216.232 with HTTP; Thu, 13 Aug 2015 13:37:08 -0700 (PDT) In-Reply-To: <5582CCF1.8010505@FreeBSD.org> 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> Date: Thu, 13 Aug 2015 16:37:08 -0400 Message-ID: Subject: Re: allow ffs & co. a binary search From: Davide Italiano To: Andriy Gapon Cc: Konstantin Belousov , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Thu, 13 Aug 2015 21:18:56 +0000 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: Thu, 13 Aug 2015 20:37:11 -0000 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. -- Davide "A mathematical theory is not to be considered complete until you have made it so clear that you can explain it to the first man whom you meet on the street." (D. Hilbert)