From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85539 invoked by alias); 27 Jul 2017 01:40:58 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 85501 invoked by uid 89); 27 Jul 2017 01:40:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-ua0-f196.google.com Received: from mail-ua0-f196.google.com (HELO mail-ua0-f196.google.com) (209.85.217.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jul 2017 01:40:55 +0000 Received: by mail-ua0-f196.google.com with SMTP id x24so15521336uah.5 for ; Wed, 26 Jul 2017 18:40:55 -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:sender:in-reply-to:references:from :date:message-id:subject:to; bh=th1rzU+n6CXq/iR8DPQDSHxn5ZnIJhmcnZ5g2d3x6DY=; b=BpY8LCgp8IE/Nccv9r5bQGcHtSMtCE1G7VOCwm8Zg9pT0qJFvVNGJYFgXp/lpQnH0V 7F+giiF4hUdrx9+wM3JMAthsQiuekfkhqXyPjBP87PsXfQMVaCd4j6LwtT2Tcnx2UgD4 kLQlZchSEgvuCqAHZL/6mOWr6Xca0Fc52C5a8zLXFJjssNR/O+7V+wJn70fK9OJH5Nss k8ZVBVYpwBSmYLwagURd/wWhyZn9hezfF/uBs14KqvCn2YGiqZAYIxZ03I6l7XJBl3k+ xeqBH1H8b6PT6FWq2BFiL4V0ao7lzpQmkyyrIIL1BZX+41ojy84Dj2tBehaH0mbmlp/e sLhw== X-Gm-Message-State: AIVw112oPKaRclIwLxoxmgVpcGmwnw5HWcnW2193k9edEuZqA4o/QUrI PXExgGSQW0vZw+lN1islttMWrszXQw== X-Received: by 10.159.57.201 with SMTP id p9mr1935531uag.209.1501119653692; Wed, 26 Jul 2017 18:40:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.96.72 with HTTP; Wed, 26 Jul 2017 18:40:33 -0700 (PDT) In-Reply-To: <20170705112609.GD30902@calimero.vinschen.de> References: <20170704133435.9840-3-sebastian.huber@embedded-brains.de> <20170705085414.12755-1-sebastian.huber@embedded-brains.de> <20170705112609.GD30902@calimero.vinschen.de> From: Kito Cheng Date: Thu, 27 Jul 2017 01:40:00 -0000 Message-ID: Subject: Re: [PATCH v2 3/3] Add ffsl(), ffsll(), fls(), flsl(), flsll() To: newlib@sourceware.org, Sebastian Huber Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00656.txt.bz2 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 wrote: > On Jul 5 10:54, Sebastian Huber wrote: >> Use compiler builtin for ffs(). Remove duplicate implementation from >> Cygwin. >> >> Signed-off-by: Sebastian Huber >> --- >> 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