From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66485 invoked by alias); 27 Sep 2019 23:27:56 -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 66476 invoked by uid 89); 27 Sep 2019 23:27:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 spammy=sk:FIRST_P 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; Fri, 27 Sep 2019 23:27:55 +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 x8RNRrbP009978; Fri, 27 Sep 2019 18:27:53 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x8RNRrrv009977; Fri, 27 Sep 2019 18:27:53 -0500 Date: Fri, 27 Sep 2019 23:27:00 -0000 From: Segher Boessenkool To: Michael Meissner , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Subject: Re: [PATCH], V4.1, patch #2: Add prefixed insn attribute (revised) Message-ID: <20190927232752.GK9749@gate.crashing.org> References: <20190918234214.GA27521@ibm-toto.the-meissners.org> <20190924061010.GB13756@ibm-toto.the-meissners.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190924061010.GB13756@ibm-toto.the-meissners.org> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg01634.txt.bz2 Hi! On Tue, Sep 24, 2019 at 02:10:10AM -0400, Michael Meissner wrote: > +/* Return true if the address is a prefixed instruction that can be directly > + used in a memory instruction (i.e. using numeric offset or a PC-relative > + reference to a local symbol). This could use a bit of a rewrite... "Return whether the address is valid for a prefixed memory instruction [...]"? > + /* Use the default pattern for loading up PC-relative addresses. */ > + if (TARGET_PCREL && mode == Pmode > + && (SYMBOL_REF_P (operands[1]) || LABEL_REF_P (operands[1]) > + || GET_CODE (operands[1]) == CONST)) Maybe this can use some predicate function? That will make the CONST stand out more as being the special case here, too? > + unsigned int r = reg_or_subregno (reg); > + > + /* If we have a pseudo, use the default instruction format. */ > + if (r >= FIRST_PSEUDO_REGISTER) > + return NON_PREFIXED_DEFAULT; Please use if (!HARD_REGISTER_NUM_P (r)) > + (eq_attr "type" "load,fpload,vecload") > + (if_then_else (and (eq_attr "indexed" "no") > + (eq_attr "update" "no") > + (match_test "prefixed_load_p (insn)")) > + (const_string "yes") > + (const_string "no")) It looks like prefixed_load_p and prefixed_store_p should test for "indexed" "no" and "update" "no" themselves? The code here simplifies a bit then. (blank line before the default case please). > + (const_string "no"))) Okay for trunk with those things fixed. Thanks! Segher