From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1851 invoked by alias); 27 Jul 2017 06:38:40 -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 569 invoked by uid 89); 27 Jul 2017 06:38:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*f:nBdyaTNAPMOGd, H*f:yXCZAP3qT9NTr4, H*f:sk:EoBd2w9, local.h 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 06:38:16 +0000 Received: by mail-ua0-f196.google.com with SMTP id q25so13805991uah.0 for ; Wed, 26 Jul 2017 23:38:16 -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:cc:content-transfer-encoding; bh=cm12aR5jr/SYhI8/SHaNAL/zadDXY9LVRC1HUL1DGYI=; b=Shl8Knjb4MeTd6KOQ+h6gWW9NaEljD0YT6SHHv2FE94bgkXkN+wct48hPC1uaXCywh 9r15TDWpVmrzqkvETu10F1zDbQHJy8/2uX7lXD2Ww+5wMq2vAfqFI55bhrhkmFvRvU9u ok4nApkys+q3iOFPN6qIceaIPHh6v8r9NR0sE6jtWRxW/4mcjOncA6fFMcXSC2X8KHBh prVj+8elkYEXBsBZFaJttDLLe0FPpCI3L6vL+soU/JsqoGxE+Vqo44RTkwjU7aiZC9ig C22kUJyncvMe57sKyGrQ2Xd/Y6Bh9CeGbNEHPzCjaccUlCT0CmHP8nTrXDpYs69AUAlr /73g== X-Gm-Message-State: AIVw112zU8wUQ+KyiwCCYpnKTTJxvfpfXYnaOyBFwTun+vKEj0Yl/3ta FY5b/xPzCPHPHsJqFQF7W8STz4zFPg== X-Received: by 10.176.16.202 with SMTP id x10mr2291348uab.186.1501137494593; Wed, 26 Jul 2017 23:38:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.96.72 with HTTP; Wed, 26 Jul 2017 23:37:54 -0700 (PDT) In-Reply-To: <9dbceb47-3a48-b8f9-056e-875597024d2c@embedded-brains.de> References: <20170704133435.9840-3-sebastian.huber@embedded-brains.de> <20170705085414.12755-1-sebastian.huber@embedded-brains.de> <20170705112609.GD30902@calimero.vinschen.de> <9bddffb3-3ae2-566e-c412-331de1e616a9@embedded-brains.de> <9dbceb47-3a48-b8f9-056e-875597024d2c@embedded-brains.de> From: Kito Cheng Date: Thu, 27 Jul 2017 06:38:00 -0000 Message-ID: Subject: Re: [PATCH v2 3/3] Add ffsl(), ffsll(), fls(), flsl(), flsll() To: Sebastian Huber Cc: newlib@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00659.txt.bz2 > Do you have plans to add RISC-V support to upstream Newlib? Yes, I plan submit patches in next few weeks and I am doing testing now, we have already porting to newlib 2.5[1]. > We should first investigate why GCC performs this optimization. The file = is compiled with -fno-builtin, so it some other optimization. Maybe we need= something like __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-pa= tterns"))) as in string/local.h. -fno-builtin just mean do not emit any builtin function in front-end, but we've explicit call builtin function here, so -fno-builtin doesn't any help for this case. However I think I could add a local ffs.c in libc/machine/riscv to avoid this issue since I've saw it's really improve the code gen for some target which have ffs or ctz instructions, but the potential problem is maybe some target will hit this issue too. [1] https://github.com/riscv/riscv-newlib