From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61964 invoked by alias); 14 Mar 2017 03:59:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 61801 invoked by uid 89); 14 Mar 2017 03:59:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sim X-HELO: mail-lf0-f48.google.com Received: from mail-lf0-f48.google.com (HELO mail-lf0-f48.google.com) (209.85.215.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Mar 2017 03:59:36 +0000 Received: by mail-lf0-f48.google.com with SMTP id z15so49374590lfd.1 for ; Mon, 13 Mar 2017 20:59:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Ucy4CkeCT5EhfV06UsuWs2GmImPRDM5SvGaRSPxTBqU=; b=sWZ3Di5bfUtnNd5D1tZ48razRV6yhOpRPi6lF1WRMcoOnZ1G3rCM7zFCXB1xXY1ylc Ovgp2L/rpp2TDnoP5J3XN81gHlySNnfljacFtYEkJgu2P+4gSLdP7HHJtRiyorfbGnwU FrQF13Ux89wQ4Zv61AkJ8wUvyhm/+xozwArbZpqmmJ+Cv0+GxaBXxje8WHp345KiuyHg fDZm//vtWqePzttDBz5FGsxXMRTub7wFZeoyE6ExY8VFRlcx3e4Oe0EDvoTJPKGF2/OK aS+4mKl1Q7SN9+Ib7KSb3Dc93Oji7gd1cAqATX6YdoWhPA8+xMGZuKOH1/FYOMmty79y 7cxw== X-Gm-Message-State: AMke39l2iwG+48YX0Ks5RBnR21hZ7z2PetzLOC6BVB9YLSLkMzL7SickpizFK10ga2qjJyNZ1M/W/K8cENQhcvWa X-Received: by 10.25.23.33 with SMTP id n33mr8221006lfi.48.1489463973759; Mon, 13 Mar 2017 20:59:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.162.145 with HTTP; Mon, 13 Mar 2017 20:59:33 -0700 (PDT) In-Reply-To: <20170313044143.GV31094@vapier> References: <20170313044143.GV31094@vapier> From: Jim Wilson Date: Tue, 14 Mar 2017 03:59:00 -0000 Message-ID: Subject: Re: popcount support To: Jim Wilson , gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2017-03/txt/msg00227.txt.bz2 On Sun, Mar 12, 2017 at 9:41 PM, Mike Frysinger wrote: > On 25 Feb 2017 19:53, Jim Wilson wrote: >> +/* Return the number of bits set in the input value. */ >> +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) >> +# define popcount __builtin_popcount >> +#else >> +static int >> +popcount (unsigned char x) >> ... > > gas/config/tc-ia64.c does the same thing, and bfd/elf32-arm.c. > should we consolidate these in libiberty ? I noticed the other popcount functions, but 3 didn't seem like a high enough number to me to justify generalizing the function. Also note that the one in the aarch64 sim isn't exactly the same as the others, as the others take int input and mine takes char input. So the aarch64 sim one is faster than the others, as it doesn't need recursion or a loop. Jim