From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#22689: [PATCH] Add logcount Date: Sat, 30 Sep 2017 19:22:33 -0400 Message-ID: <20170930232233.3dtcrcijapknju45@logos.localdomain> References: <484ef24a-8fbe-6e9c-cdb4-ef7c4467ada9@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1506813790 17901 195.159.176.226 (30 Sep 2017 23:23:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Sep 2017 23:23:10 +0000 (UTC) User-Agent: NeoMutt/20170912-48-0df7d3-dirty Cc: 22689@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 01 01:23:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyR69-00045M-I4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Oct 2017 01:23:05 +0200 Original-Received: from localhost ([::1]:40628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyR6F-0004st-4K for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 19:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyR6A-0004sn-5m for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:23:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyR66-0008Tp-OV for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:23:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyR66-0008Ta-LA for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dyR66-0005vD-9o for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2017 23:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22689 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22689-submit@debbugs.gnu.org id=B22689.150681376322715 (code B ref 22689); Sat, 30 Sep 2017 23:23:02 +0000 Original-Received: (at 22689) by debbugs.gnu.org; 30 Sep 2017 23:22:43 +0000 Original-Received: from localhost ([127.0.0.1]:41594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyR5n-0005uJ-7w for submit@debbugs.gnu.org; Sat, 30 Sep 2017 19:22:43 -0400 Original-Received: from mail-qt0-f178.google.com ([209.85.216.178]:45157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyR5l-0005u0-2I for 22689@debbugs.gnu.org; Sat, 30 Sep 2017 19:22:41 -0400 Original-Received: by mail-qt0-f178.google.com with SMTP id t46so3567543qtj.2 for <22689@debbugs.gnu.org>; Sat, 30 Sep 2017 16:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GxM+hFMl2LfrXWHVcagT44711vXCYlLQ1QMt8d0EZ10=; b=Rzzlk6toIsPjkzBiszV1vUPqHAXekaWCaQgOHb7hyNF26Y99+3B+JhD9O/25qSivN4 lNtiu+e/o+80V69tPekYc/0Elm5P9Ln1qzOcq43xvofInvf4eVUV3vO16Q/kZG9VZAL6 N+EGTvInOoALWUPXjiVJBA2YEST5hAfAH0FZus6O3qGhcmhcHXCwidzf2x8NnoHZWm6I DVoUi0XMXgju7fPVxxs30uGNUzdcpo1+EHr1asF9tOvL4xR/GN4wMTiFqGfxtlsJyae7 a20rcYszxzL3nzEZ6E99ri19TOoHh7KyY20jN3XUd1GLM18zKTnRpKi3FUNAdBktlaHn oLpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GxM+hFMl2LfrXWHVcagT44711vXCYlLQ1QMt8d0EZ10=; b=YBWtdfOXU/XuacWM2OsBKcP/PHeleKm8uZLEDXuCWEMOiaMCxq7duV1yKIk/Xp2smx SeFRveXA7ymFBpUV8cH5SXFGL7zaON3HfK+9lZPqF2agaWz33+khUcdTb67GGHzmPtHO GUBhbKlQwqv2oNJDSCYJqM7+mJWjpKRvYxA5sIYqP9vOOXSzi9zdibV71WTgwXNXG7IU sRP4ycDd6Yc6dYnyhjNGI9rZm1WYXUshSLuKKKpMeW7crbxUSE8GzYmhVD0sFCza2r+a ijivHFjomuB2FoLf32IXSnrKTyOiHVuweQKhQinR57fAVRJa1Qn7UCuJknsNYOq0SglM +jJQ== X-Gm-Message-State: AMCzsaUK9gVg3aF5UVVCVSPYMh9CKNOkGOo5MaG9JDKNcIKBIYdX3gmm WjPxtMEchOdh8uxGzHeLvwe55w== X-Google-Smtp-Source: AOwi7QBlwriKreu3LGaFVUu04te3sDZp7c89inhXb+9l0Kb+ZllW+fkObwOf4hno55fB3vzXklM27A== X-Received: by 10.200.27.28 with SMTP id y28mr13008472qtj.297.1506813755631; Sat, 30 Sep 2017 16:22:35 -0700 (PDT) Original-Received: from logos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id y68sm4630015qkd.87.2017.09.30.16.22.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Sep 2017 16:22:34 -0700 (PDT) Content-Disposition: inline In-Reply-To: <484ef24a-8fbe-6e9c-cdb4-ef7c4467ada9@cs.ucla.edu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137721 Archived-At: On 30/09/17 at 03:48pm, Paul Eggert wrote: > I looked at this patch after it landed in 'master'. Thanks for contributing it. > > A couple of minor improvements. First, the implementation of logcount can > use the count_one_bits functions already used by Emacs, rather than > reinventing that wheel; these functions should be just as fast as > __builtin_popcount etc. when using GCC. Second, logcount should count zero > bits in negative numbers, for compatibility with Common Lisp. I installed > the attached two patches to implement these improvements. Thank you for the improvements--I was not aware of count-one-bits.h but am pleasantly surprised.