Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Wilson <jim.wilson@linaro.org>
To: Jim Wilson <jim.wilson@linaro.org>, gdb-patches@sourceware.org
Subject: Re: popcount support
Date: Tue, 14 Mar 2017 03:59:00 -0000	[thread overview]
Message-ID: <CABXYE2VREi8sHp4hxQAGV2YYjwzmRRMvhmUAao+jpByqJhzVcg@mail.gmail.com> (raw)
In-Reply-To: <20170313044143.GV31094@vapier>

On Sun, Mar 12, 2017 at 9:41 PM, Mike Frysinger <vapier@gentoo.org> 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


      reply	other threads:[~2017-03-14  3:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26  3:54 [PATCH] aarch64 sim, add cnt insn support Jim Wilson
2017-03-13  4:41 ` popcount support Mike Frysinger
2017-03-14  3:59   ` Jim Wilson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABXYE2VREi8sHp4hxQAGV2YYjwzmRRMvhmUAao+jpByqJhzVcg@mail.gmail.com \
    --to=jim.wilson@linaro.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox