From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3853 invoked by alias); 24 Oct 2017 09:57:23 -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 3839 invoked by uid 89); 24 Oct 2017 09:57:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=HTo:U*ebotcazou, sk:conserv X-HELO: mail-wm0-f68.google.com Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Oct 2017 09:57:21 +0000 Received: by mail-wm0-f68.google.com with SMTP id b9so9322738wmh.0 for ; Tue, 24 Oct 2017 02:57:20 -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=ZeRZrsuJsW8gkWxdbZ4yfXBa6VQP+T4eNGSuyKXvfok=; b=ars+JhsDQ8Mr2lGOVjLCPrS7l1Oq9NvERd/ET9/vmxzvHCfyN2fEq8QIwZAHJIo0Ye fpaBSulYtxXezvWtXXBkrmW978DuBWsKBk/C4v3jkG7nA3zy8SzwQbHN/VIwnjuGs1Ck 43/bSQ69N+xcWlwI5Xm0z/8C5tWTaeAK8gc7gHa9ZVqdbUbmvKn4gtWqJlN1Kj2O+uFT rsqe68KmLY/JQAzNeUPSlXGpph6SWg4SpdWdaIbs9ubEO8bF5kivjRdCnoNP0c1i+GvU skUynlCqE18DvB11+D6oUr9d0zePWcoAbVlGFS8BiqSEx2UsmpNtBf3n1jbdQKIDAELV FafA== X-Gm-Message-State: AMCzsaUW6TgMS1PNOOpSsa6TQrHrxWpLUNG6qk5zkUfGv3w3Y5WNMJor xip7tBt66o8Sr9Zq5AaEnmp0b0Ofbyc= X-Google-Smtp-Source: ABhQp+RGtjNTLHG98OBmYEQ9rwWYZ70MP8cytxecwLB2DLpkZ7f5o7eJ2uZdCF5K8DAKi5plsKnEJQ== X-Received: by 10.28.88.21 with SMTP id m21mr7429933wmb.111.1508839038954; Tue, 24 Oct 2017 02:57:18 -0700 (PDT) Received: from localhost (92.40.249.209.threembb.co.uk. [92.40.249.209]) by smtp.gmail.com with ESMTPSA id g75sm1630846wme.23.2017.10.24.02.57.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2017 02:57:18 -0700 (PDT) From: Richard Sandiford To: Eric Botcazou Mail-Followup-To: Eric Botcazou ,gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Cc: gcc-patches@gcc.gnu.org Subject: Re: [000/nnn] poly_int: representation of runtime offsets and sizes References: <871sltvm7r.fsf@linaro.org> <4728974.295PUQgt1k@polaris> Date: Tue, 24 Oct 2017 09:58:00 -0000 In-Reply-To: <4728974.295PUQgt1k@polaris> (Eric Botcazou's message of "Tue, 24 Oct 2017 11:09:48 +0200") Message-ID: <87o9owq35v.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-10/txt/msg01664.txt.bz2 Eric Botcazou writes: >> 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? Yeah. E.g. for ==, the two options would be: a) must_eq (a, b) -> a == b must_ne (a, b) -> a != b which has the weird property that (a == b) != (!(a != b)) b) must_eq (a, b) -> a == b may_ne (a, b) -> a != b which has the weird property that a can be equal to b when a != b may/must matters in a similar way as it does for alias analysis: "may" usually selects conservatively-correct, just-in-case behaviour while "must" selects something that would be wrong if the condition didn't hold. > 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... Sorry about that. It's the best I could come up with without losing the may/must distinction. Thanks, Richard