From patchwork Sat Oct 19 18:21:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 284889 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 366AD2C00E0 for ; Sun, 20 Oct 2013 05:21:15 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= default; b=wAYOWo7VPJZiWUgKMIkVGiauZhWyvgIF5XKYmnDiYFxAXZjd1Wyl8 NGurskU7JB4tJa96er3XbT/LYtrEmjC5Zsx610MbN21rsurUe3+XLeDMNje+rE1d gHLhktKsdA/yq+L1UGkcDxd39ez8bSMu99PSKydrzS6qplWl4jC/vg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=default; bh=jQyTdKvyaUoMXFj7V7+iNZ4Yjao=; b=o4JpcWDxlXB1w8G3A4mk/O2SFGNq AP4pWc3ryIZ9JWzIknY9oV7eV/TLJncl2mF6u8e0n36/uN3AAZ+BchZXOTNeXJ7B ek6eeUL+vjCrarfIiR35PW3rsNeZ3fSQvHtFun9Ml+3B7vDF8uPQdMZGoZ8OnqDH ua6lLgTZqlmxuOo= Received: (qmail 30876 invoked by alias); 19 Oct 2013 18:21:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 30866 invoked by uid 89); 19 Oct 2013 18:21:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL, BAYES_00, FOREIGN_SUBJECT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=no version=3.3.2 X-HELO: qmta13.emeryville.ca.mail.comcast.net Received: from qmta13.emeryville.ca.mail.comcast.net (HELO qmta13.emeryville.ca.mail.comcast.net) (76.96.27.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 19 Oct 2013 18:21:08 +0000 Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta13.emeryville.ca.mail.comcast.net with comcast id f6JH1m0061wfjNsAD6M6tS; Sat, 19 Oct 2013 18:21:06 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta23.emeryville.ca.mail.comcast.net with comcast id f6M61m0040BKwT48j6M6CA; Sat, 19 Oct 2013 18:21:06 +0000 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: [wide-int] int_traits From: Mike Stump In-Reply-To: <87ob6l5oou.fsf@talisman.default> Date: Sat, 19 Oct 2013 11:21:05 -0700 Cc: Kenneth Zadeck , Richard Biener , gcc-patches@gcc.gnu.org Message-Id: <8F288C47-C5BA-4125-864C-93346A991CCF@comcast.net> References: <525EB50F.2090003@naturalbridge.com> <87ppr56on1.fsf@talisman.default> <525EFC33.4010304@naturalbridge.com> <87hacg720z.fsf@talisman.default> <30C4C2A0-38C8-4F3B-80B2-7AEFFB99AD0D@comcast.net> <52613396.3030605@naturalbridge.com> <87zjq563cz.fsf@talisman.default> <526280EA.4010809@naturalbridge.com> <87ob6l5oou.fsf@talisman.default> To: Richard Sandiford X-IsSubscribed: yes On Oct 19, 2013, at 7:18 AM, Richard Sandiford wrote: > So I think Mike's original patch was right and that this extra > "y.len == 1" check is redundant. So, gcc's optimizer agrees with your view, it is redundant. :-) I checked this in: Index: wide-int.h =================================================================== --- wide-int.h (revision 203860) +++ wide-int.h (working copy) @@ -1464,11 +1464,7 @@ inline bool wi::lts_p (const wide_int_ref &x, const wide_int_ref &y) { // We optimize x < y, where y is 64 or fewer bits. - // We have to be careful to not allow comparison to a large positive - // unsigned value like 0x8000000000000000, those would be encoded - // with a y.len == 2. - if (y.precision <= HOST_BITS_PER_WIDE_INT - && y.len == 1) + if (y.precision <= HOST_BITS_PER_WIDE_INT) { // If x fits directly into a shwi, we can compare directly. if (wi::fits_shwi_p (x))