public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: newlib@sourceware.org,
		Sebastian Huber <sebastian.huber@embedded-brains.de>
Subject: Re: [PATCH v2 3/3] Add ffsl(), ffsll(), fls(), flsl(), flsll()
Date: Thu, 27 Jul 2017 01:40:00 -0000	[thread overview]
Message-ID: <CA+yXCZAP3qT9NTr4=nBdyaTNAPMOGd+j=EoBd2w9ZUFXzuYpRQ@mail.gmail.com> (raw)
In-Reply-To: <20170705112609.GD30902@calimero.vinschen.de>

Hi

I am testing with RISC-V with newlib/trunk and just hang on ffs,
after investigate, I saw gcc just generate a ffs call in ffs for riscv64
and I guess riscv64 is not the only target will hit this bug,
so maybe we can revert the part of this patch, at least for ffs.c?

Code gen by riscv64-elf-gcc:
  .file "ffs.c"
  .option nopic
  .globl ffs
  .text
  .align 1
  .globl ffs
  .type ffs, @function
ffs:
  add sp,sp,-16
  sd ra,8(sp)
  call ffs
  ld ra,8(sp)
  sext.w a0,a0
  add sp,sp,16
  jr ra
  .size ffs, .-ffs
  .ident "GCC: (GNU) 8.0.0 20170509 (experimental)"

On Wed, Jul 5, 2017 at 7:26 PM, Corinna Vinschen <vinschen@redhat.com> wrote:
> On Jul  5 10:54, Sebastian Huber wrote:
>> Use compiler builtin for ffs().  Remove duplicate implementation from
>> Cygwin.
>>
>> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
>> ---
>>  newlib/libc/misc/ffs.c         | 14 ++-------
>>  newlib/libc/string/Makefile.am |  5 ++++
>>  newlib/libc/string/Makefile.in | 64 +++++++++++++++++++++++++++++++++---------
>>  newlib/libc/string/ffsl.c      | 34 ++++++++++++++++++++++
>>  newlib/libc/string/ffsll.c     | 34 ++++++++++++++++++++++
>>  newlib/libc/string/fls.c       | 38 +++++++++++++++++++++++++
>>  newlib/libc/string/flsl.c      | 38 +++++++++++++++++++++++++
>>  newlib/libc/string/flsll.c     | 38 +++++++++++++++++++++++++
>>  winsup/cygwin/syscalls.cc      | 22 ---------------
>>  9 files changed, 240 insertions(+), 47 deletions(-)
>>  create mode 100644 newlib/libc/string/ffsl.c
>>  create mode 100644 newlib/libc/string/ffsll.c
>>  create mode 100644 newlib/libc/string/fls.c
>>  create mode 100644 newlib/libc/string/flsl.c
>>  create mode 100644 newlib/libc/string/flsll.c
>
> Patchset looks good, please push.
>
> For Cygwin we also need to add the new fls* entry points to
> common.din and to the docs.  I'll do that later, when you
> pushed your patch.
>
>
> Thanks,
> Corinna
>
> --
> Corinna Vinschen
> Cygwin Maintainer
> Red Hat

  reply	other threads:[~2017-07-27  1:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 13:34 [PATCH 1/3] Implement bzero() via memset() Sebastian Huber
2017-07-04 13:34 ` [PATCH 2/3] Synchronize <strings.h> with latest FreeBSD Sebastian Huber
2017-07-04 13:34 ` [PATCH 3/3] Add ffsl(), ffsll(), fls(), flsl(), flsll() Sebastian Huber
2017-07-05  6:06   ` Sebastian Huber
2017-07-05  8:42     ` Corinna Vinschen
2017-07-05  8:54   ` [PATCH v2 " Sebastian Huber
2017-07-05 11:26     ` Corinna Vinschen
2017-07-27  1:40       ` Kito Cheng [this message]
2017-07-27  5:47         ` Sebastian Huber
2017-07-27  6:21           ` Sebastian Huber
2017-07-27  6:38             ` Kito Cheng
2017-07-27  6:40               ` Kito Cheng
2017-07-27  6:50         ` Sebastian Huber
2017-07-27  6:53           ` Kito Cheng
2017-07-27  7:09             ` Sebastian Huber
2017-07-27  7:21               ` Sebastian Huber

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='CA+yXCZAP3qT9NTr4=nBdyaTNAPMOGd+j=EoBd2w9ZUFXzuYpRQ@mail.gmail.com' \
    --to=kito.cheng@gmail.com \
    --cc=newlib@sourceware.org \
    --cc=sebastian.huber@embedded-brains.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).