From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15373 invoked by alias); 2 Mar 2020 11:09:05 -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 15358 invoked by uid 89); 2 Mar 2020 11:09:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=classification, KewenLin, UD:Lin, UD:Kewen.Lin X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 11:09:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EBC2E31B; Mon, 2 Mar 2020 03:09:01 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 089FE3F6CF; Mon, 2 Mar 2020 03:09:00 -0800 (PST) From: Richard Sandiford To: "Kewen.Lin" Mail-Followup-To: "Kewen.Lin" ,Segher Boessenkool , GCC Patches , Bill Schmidt , "bin.cheng" , Richard Guenther , richard.sandiford@arm.com Cc: Segher Boessenkool , GCC Patches , Bill Schmidt , "bin.cheng" , Richard Guenther Subject: Re: [PATCH 2/4 GCC11] Add target hook stride_dform_valid_p References: <20200120131451.GX3191@gate.crashing.org> <555ba68c-140c-a263-86b6-c5ccf32d4752@linux.ibm.com> Date: Mon, 02 Mar 2020 11:09:00 -0000 In-Reply-To: <555ba68c-140c-a263-86b6-c5ccf32d4752@linux.ibm.com> (Kewen Lin's message of "Tue, 25 Feb 2020 17:46:03 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00028.txt "Kewen.Lin" writes: > on 2020/1/20 =E4=B8=8B=E5=8D=889:14, Segher Boessenkool wrote: >> Hi! >>=20 >> On Mon, Jan 20, 2020 at 10:42:12AM +0000, Richard Sandiford wrote: >>> "Kewen.Lin" writes: >>>> gcc/ChangeLog >>>> >>>> 2020-01-16 Kewen Lin >>>> >>>> * config/rs6000/rs6000.c (TARGET_STRIDE_DFORM_VALID_P): New macro. >>>> (rs6000_stride_dform_valid_p): New function. >>>> * doc/tm.texi: Regenerate. >>>> * doc/tm.texi.in (TARGET_STRIDE_DFORM_VALID_P): New hook. >>>> * target.def (stride_dform_valid_p): New hook. >>> >>> It looks like we should able to derive this information from the normal >>> legitimate_address_p hook. >>=20 >> Yes, probably. >>=20 >>> Also, "D-form" vs. "X-form" is AFAIK a PowerPC-specific classification. >>> It would be good to use a more generic term in target-independent code. >>=20 >> Yeah. X-form is [reg+reg] addressing; D-form is [reg+imm] addressing. >> We can do simple [reg] addressing in either form as well. Whether D-form >> can be used for some access depends on many factors (ISA version, mode of >> the datum, alignment, and how big the offset is of course). But the usu= al >> legitimate_address_p hook should do fine. The ivopts code already has an >> addr_offset_valid_p function, maybe that could be adjusted for this? >>=20 >>=20 >> Segher >>=20 > > Hi Segher and Richard S., > > Sorry for late response. Thanks for your comments on legitimate_address_= p hook > and function addr_offset_valid_p. I updated the IVOPTs part with > addr_offset_valid_p, although rs6000_legitimate_offset_address_p doesn't = check > strictly all the time (like worst_case is false), it works well with SPEC= 2017. > Based on it, the hook is simplified as attached patch. Thanks for the update. I think it would be better to add a --param rather than a bool hook though. Targets can then change the default (if necessary) using SET_OPTION_IF_UNSET. The user can override the default if they want to. It might also be better to start with an opt-out rather than an opt-in (i.e. with the default param value being true rather than false). With a default-off option, it's much harder to tell whether something has been deliberately turned off or whether no-one's thought about it either way. We can always flip the default later if it turns out that nothing other than rs6000 benefits. Richard