From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3643 invoked by alias); 30 May 2017 08:33:56 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 3608 invoked by uid 89); 30 May 2017 08:33:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=HTo:U*rguenth X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-yw0-f180.google.com Received: from mail-yw0-f180.google.com (HELO mail-yw0-f180.google.com) (209.85.161.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 May 2017 08:33:54 +0000 Received: by mail-yw0-f180.google.com with SMTP id b68so36902061ywe.3; Tue, 30 May 2017 01:33:58 -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:in-reply-to:references:from:date :message-id:subject:to; bh=R05DKSLqAMVvcsH67HZMhMm3PEXoemtWWEHxf9lkYy8=; b=HbZDQQsHF519OnwokXd7/k9JygkzIt03/7k+HFsh0x8hEyQoo4JMkVMICQ9nQUDI9p 3LHl/wgNnRDoki+oNwOXD71D5y934NP4n1j3gQdXrHez7yqhc+m751PAGAjyee6+qJ2V WR2So7WuxRIfUivcSb+f2NpSnS5OLGREVsgTbNy/xT/6TUfm6MPtCP1J3y8FRNsC1rtJ fIh21/yIxRV9yif1qND6fNG2PXnTOil4JFBrora0+9ryn65gfY2oYt3fd0DCM6gq8zub wyWLEI4xIc3GsWPjCojdBkvDsP+gu2uQsygRNgveR/aIwv/YkFg7iZTF4JVuNo4I3hOh jQrg== X-Gm-Message-State: AODbwcAr3HCJO9ThlYvTbj4WskbUWf20c8kC0/bkJ0JnmtpeE12EZiGU 2tssWK3+e94aFvA1BsrpcOJqwnpjhA== X-Received: by 10.129.124.84 with SMTP id x81mr14597800ywc.164.1496133236939; Tue, 30 May 2017 01:33:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.194.199 with HTTP; Tue, 30 May 2017 01:33:56 -0700 (PDT) In-Reply-To: <87tw42onqo.fsf@linaro.org> References: <87tw42onqo.fsf@linaro.org> From: Yuri Gribov Date: Tue, 30 May 2017 08:38:00 -0000 Message-ID: Subject: Re: [PATCH 3/4 v3][PR 67328] Added bool conversion for wide_ints To: Yuri Gribov , GCC Patches , Alan Modra , rguenth@gcc.gnu.org, richard.sandiford@linaro.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg02240.txt.bz2 On Tue, May 30, 2017 at 7:35 AM, Richard Sandiford wrote: > Yuri Gribov writes: >> From 330209f721a598ec393dcb5d62de3457ee282153 Mon Sep 17 00:00:00 2001 >> From: Yury Gribov >> Date: Fri, 26 May 2017 07:53:10 +0100 >> Subject: [PATCH 3/4] Added bool conversion for wide_ints. >> >> gcc/ >> 2017-05-26 Yury Gribov >> >> * wide-int.cc (wi::zero_p_large): New method. >> * wide-int.h (wi::zero_p): New method. > > Do you still need this bit? It looks like it isn't used by the other > parts of the series. > > The idea was that wi::eq_p (x, 0) (or just x == 0, if x is a > wide-int-based type) is supposed to be as fast as a dedicated zero check. > It'd be OK to have a helper function anyway, but it should probably be > defined using wi::eq_p. > > The zero_p_large fallback can never return true, since a zero of > any precision will have a length of 1. Thanks Richard, I'll update the patch. The bool check is used in successive patch (4/4), in widest_int mask = wi::to_widest (@2); bool mask_all_ones_p = !(mask & (mask + 1)); -Y