From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5618 invoked by alias); 27 Jul 2017 06:40:25 -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 5262 invoked by uid 89); 27 Jul 2017 06:40:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_20,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, fnobuiltin X-HELO: mail-ua0-f195.google.com Received: from mail-ua0-f195.google.com (HELO mail-ua0-f195.google.com) (209.85.217.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jul 2017 06:40:11 +0000 Received: by mail-ua0-f195.google.com with SMTP id d29so14856696uai.2 for ; Wed, 26 Jul 2017 23:40:11 -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=4vKhKW/B5tKK+9GjiTUI2J77ZjlrVIFe9DHtbGF4F1g=; b=j67P+2ZZYD8Ue5Zj3iD1Jt4om8aBZu5y2Oi7dnstweGTXsoYcMCG+ZzqrJh8iwvi98 gCUO4VUWV3dmgfOCCHWKq8zGktIMDpIuTBjmfAR25w8zqh13jdQBBVB9SVF5aaNkKZrT cDQtVFY2536Um1LKcp2w3YN2oEGeIngseLgolMLb2xKowDyI7j66kYq3fvV2vYCG/s4s +uN21yEYAOblWiGHdjE2GoVNBzna3xIssIJ6VqfX+xYK7UmyoegwpLQqo/cC6oQruY8Z pj3gC77wT5oR51cCVHZvtp+Zt7XPgkpAMQN2jemQvcD14DEWjlrHt1OYvF5XuXfj39ui vEYQ== X-Gm-Message-State: AIVw110mV7+NK9BM185/FXTZooIItXDTi2ofKO+Ru8dF6r+rtVMvfcBU XGfRKHkgDLfIJFgatKtLf44BH1kWOg== X-Received: by 10.176.82.110 with SMTP id j43mr1957517uaa.112.1501137609978; Wed, 26 Jul 2017 23:40:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.96.72 with HTTP; Wed, 26 Jul 2017 23:39:49 -0700 (PDT) In-Reply-To: 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:40: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/msg00660.txt.bz2 Btw, it's my working tree if you are interested https://github.com/kito-cheng/riscv-newlib/tree/riscv-newlib-submission-v1 On Thu, Jul 27, 2017 at 2:37 PM, Kito Cheng wrote: >> 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 nee= d something like __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-p= atterns"))) 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