From patchwork Fri Aug 3 12:32:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 174984 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]) by ozlabs.org (Postfix) with SMTP id B106B2C008B for ; Fri, 3 Aug 2012 22:32:29 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1344601950; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=VqJP30sdfUA793Lpz5y+MIR35ok=; b=yE4DuaaydOiAmcK JwdYK5vAycT7NbYu2uIkWephnU9pHyOY0N6kt7U/0WUi6sZ+soBsDMI3/AV/flxm FyyZFkpN3Nr/RNAwyLcYw53OJC04qx/URi9+b2sLQxlt+yl/9sPrvS20aSMV0fvH aUuOk24upi1MJz5hUo2jF+WL/Lao= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wp0EZrPTwW3Wj6aKdLtdesnSCtXlJb6s/d8yOwYfqzx7Uaneb4M6vmWVuDyyJr Nzg2o2NJNWOHyqX6RJEjpxDgjsdc8Yy//1tNyXbjgVVsmexprePcohmTVDtXUfgG vaf531EI6gCNHo5ao2mu0vsOLO20Msu8IqxPTJaWk6R2Y=; Received: (qmail 24004 invoked by alias); 3 Aug 2012 12:32:25 -0000 Received: (qmail 23995 invoked by uid 22791); 3 Aug 2012 12:32:24 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail1-relais-roc.national.inria.fr (HELO mail1-relais-roc.national.inria.fr) (192.134.164.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Aug 2012 12:32:03 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 03 Aug 2012 14:32:02 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1SxH2v-000776-Tt; Fri, 03 Aug 2012 14:32:01 +0200 Date: Fri, 3 Aug 2012 14:32:01 +0200 (CEST) From: Marc Glisse To: Richard Guenther cc: gcc-patches@gcc.gnu.org Subject: Re: VRP wrapping MULT_EXPR In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 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 On Fri, 3 Aug 2012, Richard Guenther wrote: >> +/* Some quadruple precision helpers. */ >> +static int >> +quad_int_cmp (double_int l0, double_int h0, >> + double_int l1, double_int h1, bool uns) >> +{ >> + int c = double_int_cmp (h0, h1, uns); >> + if (c != 0) return c; >> + return double_int_ucmp (l0, l1); >> +} > > I suppose that's appropriate for double-int.h as static inline function. > > Ok with or without moving it (we can do that as followup anyway) if > testing is ok. Thanks, I applied it without moving, and am now doing a quick bootstrap of the following (to make sure I didn't forget a ';' during the copy-paste). 2012-08-03 Marc Glisse * tree-vrp.c (quad_int_cmp): Move ... * double-int.h (quad_int_cmp): ... here. Index: tree-vrp.c =================================================================== --- tree-vrp.c (revision 190125) +++ tree-vrp.c (working copy) @@ -2181,30 +2181,21 @@ extract_range_from_multiplicative_op_1 ( { /* If the new range has its limits swapped around (MIN > MAX), then the operation caused one of them to wrap around, mark the new range VARYING. */ set_value_range_to_varying (vr); } else set_value_range (vr, type, min, max, NULL); } -/* Some quadruple precision helpers. */ -static int -quad_int_cmp (double_int l0, double_int h0, - double_int l1, double_int h1, bool uns) -{ - int c = double_int_cmp (h0, h1, uns); - if (c != 0) return c; - return double_int_ucmp (l0, l1); -} - +/* Quadruple precision helper. */ static void quad_int_pair_sort (double_int *l0, double_int *h0, double_int *l1, double_int *h1, bool uns) { if (quad_int_cmp (*l0, *h0, *l1, *h1, uns) > 0) { double_int tmp; tmp = *l0; *l0 = *l1; *l1 = tmp; tmp = *h0; *h0 = *h1; *h1 = tmp; } Index: double-int.h =================================================================== --- double-int.h (revision 190125) +++ double-int.h (working copy) @@ -219,20 +219,29 @@ double_int double_int_rrotate (double_in static inline bool double_int_negative_p (double_int cst) { return cst.high < 0; } int double_int_cmp (double_int, double_int, bool); int double_int_scmp (double_int, double_int); int double_int_ucmp (double_int, double_int); +static inline int +quad_int_cmp (double_int l0, double_int h0, + double_int l1, double_int h1, bool uns) +{ + int c = double_int_cmp (h0, h1, uns); + if (c != 0) return c; + return double_int_ucmp (l0, l1); +} + double_int double_int_max (double_int, double_int, bool); double_int double_int_smax (double_int, double_int); double_int double_int_umax (double_int, double_int); double_int double_int_min (double_int, double_int, bool); double_int double_int_smin (double_int, double_int); double_int double_int_umin (double_int, double_int); void dump_double_int (FILE *, double_int, bool);