From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107641 invoked by alias); 24 Oct 2017 09:10:01 -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 107294 invoked by uid 89); 24 Oct 2017 09:10:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BRBL_LASTEXT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Oct 2017 09:09:52 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id E581981C43; Tue, 24 Oct 2017 11:09:49 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BespPUaQOgZ4; Tue, 24 Oct 2017 11:09:49 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id C457B81396; Tue, 24 Oct 2017 11:09:49 +0200 (CEST) From: Eric Botcazou To: Richard Sandiford Cc: gcc-patches@gcc.gnu.org Subject: Re: [000/nnn] poly_int: representation of runtime offsets and sizes Date: Tue, 24 Oct 2017 09:25:00 -0000 Message-ID: <4728974.295PUQgt1k@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: <871sltvm7r.fsf@linaro.org> References: <871sltvm7r.fsf@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2017-10/txt/msg01656.txt.bz2 > The patch that adds poly_int has detailed documentation, but the main > points are: > > * there's no total ordering between poly_ints, so the best we can do > when comparing them is to ask whether two values *might* or *must* > be related in a particular way. E.g. if mode A has size 2 + 2X > and mode B has size 4, the condition: > > GET_MODE_SIZE (A) <= GET_MODE_SIZE (B) > > is true for X<=1 and false for X>=2. This translates to: > > may_le (GET_MODE_SIZE (A), GET_MODE_SIZE (B)) == true > must_le (GET_MODE_SIZE (A), GET_MODE_SIZE (B)) == false > > Of course, the may/must distinction already exists in things like > alias analysis. I presume that you considered using traditional operators instead of awkward names, despite the lack of total ordering, and rejected it? Because: - && (bitpos == 0 || MEM_P (target))) + && (known_zero (bitpos) || MEM_P (target))) - && bitsize == TYPE_PRECISION (type)) + && must_eq (bitsize, TYPE_PRECISION (type))) - if (need_to_clear && size > 0) + if (need_to_clear && may_gt (size, 0)) is really ugly... -- Eric Botcazou