From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10665 invoked by alias); 30 May 2017 10:35:35 -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 9787 invoked by uid 89); 30 May 2017 10:35:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-wm0-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 May 2017 10:35:32 +0000 Received: by mail-wm0-f44.google.com with SMTP id e127so94277523wmg.1 for ; Tue, 30 May 2017 03:35:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version; bh=vxxQ4lUdH2UbEPhsPEHeBiicvpZXEn2wDuBWIeG0sDQ=; b=h3zjpQ/vuDHWoxV68LTYk7drI1ybecsClivxklCF/VlauF5s98jSFx4lUhjAV8qn6j 5KWeVIBY+MeqToyLznfJMkR4CUFq/FYYXKv+shTnSbQ70gjwioQpn20QJIWHjSpYTLD3 bx19Co8iib8C+X8zmEHjQkkyCMq4z1gqadVALEuIokdcM22t39bwNyp6ftJ3Y9Lf34cu AwkPCmydIKLJADJfjy5UO5ghJq3ISYN0dvcnIlp9btPHKXzg9Km66e58L8oH/mgLoDJB K8eeMpCFAxQW21uoUCcWNIZWNYfVdlvWgqjBaCQbJ3cN7fkufPoR5HB/mRlGwEXahQgW Po2Q== X-Gm-Message-State: AODbwcBWeLOiyqoEwaS/10l333bssWzvfGk33PPNip+3QvA7NU9oNFSA 89XkSH6MG2GVZczU X-Received: by 10.223.130.151 with SMTP id 23mr8786510wrc.16.1496140534701; Tue, 30 May 2017 03:35:34 -0700 (PDT) Received: from localhost ([2.26.27.176]) by smtp.gmail.com with ESMTPSA id l190sm17225671wmb.18.2017.05.30.03.35.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 May 2017 03:35:33 -0700 (PDT) From: Richard Sandiford To: Yuri Gribov Mail-Followup-To: Yuri Gribov ,GCC Patches , Alan Modra , rguenth@gcc.gnu.org, richard.sandiford@linaro.org Cc: GCC Patches , Alan Modra , rguenth@gcc.gnu.org Subject: Re: [PATCH 3/4 v3][PR 67328] Added bool conversion for wide_ints References: <87tw42onqo.fsf@linaro.org> Date: Tue, 30 May 2017 10:51:00 -0000 In-Reply-To: (Yuri Gribov's message of "Tue, 30 May 2017 09:33:56 +0100") Message-ID: <87lgpeocnf.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-05/txt/msg02249.txt.bz2 Yuri Gribov writes: > 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)); Ah, OK. That's equivalent to mask == -1 (or wi::eq_p (@2, -1), to avoid the temporary). I think it'd be better to use one of those instead. There's an argument that if ! is defined, it should return an integer of the same precision as the argument. Thanks, Richard