From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 3DA833858016 for ; Wed, 28 Sep 2022 15:23:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3DA833858016 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 28SFMPAo008794; Wed, 28 Sep 2022 10:22:25 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 28SFMOLO008793; Wed, 28 Sep 2022 10:22:24 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 28 Sep 2022 10:22:24 -0500 From: Segher Boessenkool To: "Kewen.Lin" Cc: GCC Patches , David Edelsohn , AlanM Subject: Re: [PATCH v4] rs6000: Rework ELFv2 support for -fpatchable-function-entry* [PR99888] Message-ID: <20220928152224.GS25951@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! On Thu, Aug 25, 2022 at 01:50:28PM +0800, Kewen.Lin wrote: > --- a/gcc/config/rs6000/rs6000-internal.h > +++ b/gcc/config/rs6000/rs6000-internal.h > @@ -183,10 +183,15 @@ extern tree rs6000_fold_builtin (tree fndecl ATTRIBUTE_UNUSED, > tree *args ATTRIBUTE_UNUSED, > bool ignore ATTRIBUTE_UNUSED); > > +extern void rs6000_print_patchable_function_entry (FILE *, > + unsigned HOST_WIDE_INT, > + bool); > + > extern bool rs6000_passes_float; > extern bool rs6000_passes_long_double; > extern bool rs6000_passes_vector; > extern bool rs6000_returns_struct; > extern bool cpu_builtin_p; > > + > #endif No new random empty lines please. > + point would be 2, 6 and 14. It's possible to support those > + other counts of nops by not making a local entry point, but > + we don't have clear user cases for them, so leave them "use cases" > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -16717,9 +16717,13 @@ the area size or to remove it completely on a single function. > If @code{N=0}, no pad location is recorded. > > The NOP instructions are inserted at---and maybe before, depending on > -@var{M}---the function entry address, even before the prologue. > +@var{M}---the function entry address, even before the prologue. On > +PowerPC with the ELFv2 ABI, for one function with dual entry points, > +the local entry point is taken as the function entry for generation. I think "the local entry point is this function entry address" is a bit clearer. > -The maximum value of @var{N} and @var{M} is 65535. > +The maximum value of @var{N} and @var{M} is 65535. On PowerPC with the > +ELFv2 ABI, for one function with dual entry points, the supported values > +for @var{M} are 0, 2, 6 and 14. "for a function" Okay for trunk with those trivial chnges. Thanks! Segher