From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115197 invoked by alias); 17 Dec 2019 23:35:29 -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 115190 invoked by uid 89); 17 Dec 2019 23:35:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Dec 2019 23:35:28 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id xBHNZPwf001444; Tue, 17 Dec 2019 17:35:25 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id xBHNZPiR001440; Tue, 17 Dec 2019 17:35:25 -0600 Date: Tue, 17 Dec 2019 23:55:00 -0000 From: Segher Boessenkool To: Michael Meissner , gcc-patches@gcc.gnu.org, David Edelsohn Subject: Re: [PATCH] V10 patch #4, Add new prefixed/non-prefixed memory constraints Message-ID: <20191217233524.GS3152@gate.crashing.org> References: <20191212000707.GA25249@ibm-toto.the-meissners.org> <20191212002905.GD27911@ibm-toto.the-meissners.org> <20191217171529.GP3152@gate.crashing.org> <20191217222944.GA30291@ibm-tinman.the-meissners.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191217222944.GA30291@ibm-tinman.the-meissners.org> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg01239.txt.bz2 On Tue, Dec 17, 2019 at 05:29:44PM -0500, Michael Meissner wrote: > On Tue, Dec 17, 2019 at 11:15:29AM -0600, Segher Boessenkool wrote: > > > +;; Return true if the operand is a valid memory address that does not use a > > > +;; prefixed address. > > > +(define_predicate "non_prefixed_memory" > > > + (match_code "mem") > > > +{ > > > + enum insn_form iform > > > + = address_to_insn_form (XEXP (op, 0), mode, NON_PREFIXED_DEFAULT); > > > + > > > + return (iform != INSN_FORM_BAD > > > + && iform != INSN_FORM_PREFIXED_NUMERIC > > > + && iform != INSN_FORM_PCREL_LOCAL > > > + && iform != INSN_FORM_PCREL_EXTERNAL); > > > +}) > > > > Why can this not use just !address_is_prefixed? Why is an > > INSN_FORM_PCREL_EXTERNAL address neither prefixed nor non-prefixed? What > > does "BAD" mean, really? Should that ever happen, should that not ICE? > > You can't just invert !address_is_prefixed, because it would all things that > may not be valid memory addresses. Yes, so test that *explicitly*, in the "prefixed_memory" predicate as well please. Make the two predicates as much the same as possible. And what is with the INSN_FORM_PCREL_EXTERNAL? Segher